diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..8d2a1fcea --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] + +# CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. +dotnet_diagnostic.CS8618.severity = none diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index f4366ad7e..f43dcaeaf 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - release/v1.0.0 schedule: - cron: "0 2 * * 1-5" @@ -18,7 +17,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.2 + dotnet-version: 5.0.202 #- name: Install Dependencies # run: npm install diff --git a/.github/workflows/cicd-dev-environment.yml b/.github/workflows/cicd-dev-environment.yml deleted file mode 100644 index 483552bd0..000000000 --- a/.github/workflows/cicd-dev-environment.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: .NET Core - -on: - push: - branches: - - develop - schedule: - - cron: "0 2 * * 1-5" - -jobs: - build: - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v1 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.2 - - #- name: Install Dependencies - # run: npm install - - - name: Pull Mix Heart & Identity - run: | - git clone --depth=50 --branch=master https://github.com/mixcore/mix.heart.git /home/runner/work/mix.core/mix.heart - git clone --depth=50 --branch=master https://github.com/mixcore/mix.identity.git /home/runner/work/mix.core/mix.identity - - - name: Build with dotnet - run: | - cd src/Mix.Cms.Web - dotnet build --configuration Release - dotnet pack -c Release -o out - diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 53afde475..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '32 13 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'csharp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/develop-v2_mixcore-platform.yml b/.github/workflows/develop-v2_mixcore-platform.yml new file mode 100644 index 000000000..39ed803de --- /dev/null +++ b/.github/workflows/develop-v2_mixcore-platform.yml @@ -0,0 +1,60 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - mixcore-platform + +on: + push: + branches: + - develop-v2 + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + include-prerelease: true + + - name: Build with dotnet + run: dotnet build src/applications/Mixcore/mixcore.csproj --configuration Release + + - name: dotnet publish + run: dotnet publish src/applications/Mixcore/mixcore.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + + deploy: + runs-on: windows-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: .net-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'mixcore-platform' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_eae485bfa224498681bd8915d6bd8cd5 }} + package: . diff --git a/.github/workflows/develop-v2_mixcore-v2-linux.yml b/.github/workflows/develop-v2_mixcore-v2-linux.yml new file mode 100644 index 000000000..2517eb208 --- /dev/null +++ b/.github/workflows/develop-v2_mixcore-v2-linux.yml @@ -0,0 +1,59 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy ASP.Net Core app to Azure Web App - mixcore-v2-linux + +on: + push: + branches: + - develop-v2 + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '6.0.x' + include-prerelease: true + + - name: Build with dotnet + run: dotnet build src/applications/Mixcore/mixcore.csproj --configuration Release + + - name: dotnet publish + run: dotnet publish src/applications/Mixcore/mixcore.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: .net-app + path: ${{env.DOTNET_ROOT}}/myapp + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: .net-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'mixcore-v2-linux' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A12BEB6F0D0743D48B61BC8B439ADBF1 }} + package: . diff --git a/.github/workflows/main.yml b/.github/workflows/mix.spa.portal-dispatch.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/mix.spa.portal-dispatch.yml diff --git a/.gitignore b/.gitignore index 47029d5e0..cd2512abb 100644 --- a/.gitignore +++ b/.gitignore @@ -274,3 +274,23 @@ src/Mix.Cms.Web/MixContent/mix-cms.db-wal src/Mix.Cms.Web/MixContent/mix-cms.db-shm /src/Mix.Cms.Web/wwwroot/mix-content/exports + +src/Mix.Cms.Web/MixContent/mix_cache.db + +*.db + +src/applications/Mixcore/mix.settings.json + +src/*/*/MixContent/ + +src/applications/Mixcore/Properties/PublishProfiles/ + +src/applications/Mixcore/Views/Shared/Templates/ + +src/applications/Mixcore/wwwroot/mix-content/exports/ + +src/applications/Mixcore/wwwroot/mix-content/ + +src/shared/__pycache__/ + +src/applications/Mixcore/logs/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..558b78729 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/framework/mix-heart"] + path = src/framework/mix-heart + url = https://github.com/mixcore/mix.heart.git diff --git a/.vscode/launch.json b/.vscode/launch.json index 159506564..f63280279 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,9 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/src/Mix.Cms.Web/bin/Debug/net5.0/Mix.Cms.Web.dll", + "program": "${workspaceFolder}/src/applications/Mixcore/bin/Debug/net6.0/Mixcore.dll", "args": [], - "cwd": "${workspaceFolder}/src/Mix.Cms.Web", + "cwd": "${workspaceFolder}/src/applications/Mixcore", "stopAtEntry": false, // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser "serverReadyAction": { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cba8d6da3..540fd012b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,7 +7,7 @@ "type": "process", "args": [ "build", - "${workspaceFolder}/src/Mix.Cms.Web/Mix.Cms.Web.csproj", + "${workspaceFolder}/src/applications/Mixcore/mixcore.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -19,7 +19,7 @@ "type": "process", "args": [ "publish", - "${workspaceFolder}/src/Mix.Cms.Web/Mix.Cms.Web.csproj", + "${workspaceFolder}/src/applications/Mixcore/mixcore.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], @@ -32,7 +32,7 @@ "args": [ "watch", "run", - "${workspaceFolder}/src/Mix.Cms.Web/Mix.Cms.Web.csproj", + "${workspaceFolder}/src/applications/Mixcore/mixcore.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], diff --git a/Dockerfile b/Dockerfile index a949ce01d..6442b91ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ WORKDIR /app # Copy everything else and build COPY src/. ./ -# RUN dotnet restore Mix.Cms.Web/Mix.Cms.Web.csproj -RUN dotnet publish Mix.Cms.Web/Mix.Cms.Web.csproj -c Release +# RUN dotnet restore Mix.Cms.Web/Mixcore.csproj +RUN dotnet publish Mix.Cms.Web/Mixcore.csproj -c Release # Build runtime image FROM mcr.microsoft.com/dotnet/sdk:5.0 AS runtime @@ -14,7 +14,7 @@ WORKDIR /app # COPY --from=node-env /app/Mix.Cms.Web/wwwroot . COPY --from=build-env /app/Mix.Cms.Web/bin/Release/net5.0/publish . EXPOSE 80 -ENTRYPOINT ["dotnet", "Mix.Cms.Web.dll"] +ENTRYPOINT ["dotnet", "mixcore.dll"] ############################# diff --git a/Mixcore.sln b/Mixcore.sln new file mode 100644 index 000000000..2dbef8ff4 --- /dev/null +++ b/Mixcore.sln @@ -0,0 +1,202 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31912.275 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "platform", "platform", "{45077DFB-D35A-4491-993C-2AC4C8AC838E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{5B29B975-B0AC-46B3-8398-4C8A22EAE355}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{38F30F45-7DB6-4097-BA85-788ACCCBC5F2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{4E880812-C336-4EB2-9FED-2E437957F50A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.library", "src\platform\mix.library\mix.library.csproj", "{5CC5900C-50FE-4D78-9E4F-7CE267355622}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixcore", "src\applications\Mixcore\mixcore.csproj", "{928B382F-48A0-4639-9EC0-0C9BE980C5C6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.common", "src\modules\mix.common\mix.common.csproj", "{E6801B38-0264-456C-B8E6-A73262B6CBA7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.database", "src\platform\mix.database\mix.database.csproj", "{3716FB3C-CDC3-45E7-9809-CF7F2DD30388}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.shared", "src\platform\mix.shared\mix.shared.csproj", "{4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "framework", "framework", "{A18F9CE9-32BA-46D6-B902-CF0E51102BD3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.account", "src\modules\mix.account\mix.account.csproj", "{19560515-92A4-4955-BDD9-E1CDA7E8A3BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.portal", "src\modules\mix.portal\mix.portal.csproj", "{C56B8C71-AEFB-4B4C-9545-03F6A646A998}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.signalr", "src\platform\mix.signalr\mix.signalr.csproj", "{8401BAD4-7658-4357-859C-19F40E731848}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.identity", "src\platform\mix.identity\mix.identity.csproj", "{681C6E43-9F8E-4A9B-AD03-12702CF47720}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.messenger", "src\modules\mix.messenger\mix.messenger.csproj", "{A92D009D-2C5B-46BC-893A-7AE995EE8814}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.quartz", "src\platform\mix.quartz\mix.quartz.csproj", "{C7AF2FD1-8490-4238-B40D-7245872FCFEC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.scheduler", "src\modules\mix.scheduler\mix.scheduler.csproj", "{F8E82C2E-0F24-4CD1-981D-436D08F73587}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8D3FF4E3-4C56-4FA6-81CC-686DE037FF59}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.xunittest", "src\test\mix.xunittest\mix.xunittest.csproj", "{CD0F866F-FF61-456B-AAEA-9960B17107E3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.grpc", "src\modules\mix.grpc\mix.grpc.csproj", "{80A478DE-09AD-4C60-B446-73946D8B0E51}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.queue", "src\platform\mix.queue\mix.queue.csproj", "{2E843175-B948-4D90-A11B-415EE67D9E1A}" +EndProject +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "shared", "src\shared\", "{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}" + ProjectSection(WebsiteProperties) = preProject + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" + Debug.AspNetCompiler.VirtualPath = "/localhost_65349" + Debug.AspNetCompiler.PhysicalPath = "src\shared\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_65349\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/localhost_65349" + Release.AspNetCompiler.PhysicalPath = "src\shared\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_65349\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "65349" + SlnRelativePath = "src\shared\" + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Heart", "src\framework\mix-heart\src\Mix.Heart\Mix.Heart.csproj", "{D4938E22-22C3-4364-A710-557B63954B5E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.tenancy", "src\modules\mix.tenancy\mix.tenancy.csproj", "{2D254550-CE54-43A2-8AE9-FAA72F2C0FD6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{634C95AF-27D5-4DE7-AA3D-6067C3682C91}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.communicator", "src\platform\mix.communicator\mix.communicator.csproj", "{5953D4C9-C11D-4307-815C-95898416A0FB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mix.constant", "src\platform\mix.constant\mix.constant.csproj", "{34A92D4D-B94A-4674-BBA4-8D2F80BECCB6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5CC5900C-50FE-4D78-9E4F-7CE267355622}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5CC5900C-50FE-4D78-9E4F-7CE267355622}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5CC5900C-50FE-4D78-9E4F-7CE267355622}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CC5900C-50FE-4D78-9E4F-7CE267355622}.Release|Any CPU.Build.0 = Release|Any CPU + {928B382F-48A0-4639-9EC0-0C9BE980C5C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {928B382F-48A0-4639-9EC0-0C9BE980C5C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {928B382F-48A0-4639-9EC0-0C9BE980C5C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {928B382F-48A0-4639-9EC0-0C9BE980C5C6}.Release|Any CPU.Build.0 = Release|Any CPU + {E6801B38-0264-456C-B8E6-A73262B6CBA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6801B38-0264-456C-B8E6-A73262B6CBA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6801B38-0264-456C-B8E6-A73262B6CBA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6801B38-0264-456C-B8E6-A73262B6CBA7}.Release|Any CPU.Build.0 = Release|Any CPU + {3716FB3C-CDC3-45E7-9809-CF7F2DD30388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3716FB3C-CDC3-45E7-9809-CF7F2DD30388}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3716FB3C-CDC3-45E7-9809-CF7F2DD30388}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3716FB3C-CDC3-45E7-9809-CF7F2DD30388}.Release|Any CPU.Build.0 = Release|Any CPU + {4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44}.Release|Any CPU.Build.0 = Release|Any CPU + {19560515-92A4-4955-BDD9-E1CDA7E8A3BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19560515-92A4-4955-BDD9-E1CDA7E8A3BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19560515-92A4-4955-BDD9-E1CDA7E8A3BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19560515-92A4-4955-BDD9-E1CDA7E8A3BC}.Release|Any CPU.Build.0 = Release|Any CPU + {C56B8C71-AEFB-4B4C-9545-03F6A646A998}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C56B8C71-AEFB-4B4C-9545-03F6A646A998}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C56B8C71-AEFB-4B4C-9545-03F6A646A998}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C56B8C71-AEFB-4B4C-9545-03F6A646A998}.Release|Any CPU.Build.0 = Release|Any CPU + {8401BAD4-7658-4357-859C-19F40E731848}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8401BAD4-7658-4357-859C-19F40E731848}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8401BAD4-7658-4357-859C-19F40E731848}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8401BAD4-7658-4357-859C-19F40E731848}.Release|Any CPU.Build.0 = Release|Any CPU + {681C6E43-9F8E-4A9B-AD03-12702CF47720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {681C6E43-9F8E-4A9B-AD03-12702CF47720}.Debug|Any CPU.Build.0 = Debug|Any CPU + {681C6E43-9F8E-4A9B-AD03-12702CF47720}.Release|Any CPU.ActiveCfg = Release|Any CPU + {681C6E43-9F8E-4A9B-AD03-12702CF47720}.Release|Any CPU.Build.0 = Release|Any CPU + {A92D009D-2C5B-46BC-893A-7AE995EE8814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A92D009D-2C5B-46BC-893A-7AE995EE8814}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A92D009D-2C5B-46BC-893A-7AE995EE8814}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A92D009D-2C5B-46BC-893A-7AE995EE8814}.Release|Any CPU.Build.0 = Release|Any CPU + {C7AF2FD1-8490-4238-B40D-7245872FCFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7AF2FD1-8490-4238-B40D-7245872FCFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7AF2FD1-8490-4238-B40D-7245872FCFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7AF2FD1-8490-4238-B40D-7245872FCFEC}.Release|Any CPU.Build.0 = Release|Any CPU + {F8E82C2E-0F24-4CD1-981D-436D08F73587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8E82C2E-0F24-4CD1-981D-436D08F73587}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8E82C2E-0F24-4CD1-981D-436D08F73587}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8E82C2E-0F24-4CD1-981D-436D08F73587}.Release|Any CPU.Build.0 = Release|Any CPU + {CD0F866F-FF61-456B-AAEA-9960B17107E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD0F866F-FF61-456B-AAEA-9960B17107E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD0F866F-FF61-456B-AAEA-9960B17107E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD0F866F-FF61-456B-AAEA-9960B17107E3}.Release|Any CPU.Build.0 = Release|Any CPU + {80A478DE-09AD-4C60-B446-73946D8B0E51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80A478DE-09AD-4C60-B446-73946D8B0E51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80A478DE-09AD-4C60-B446-73946D8B0E51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80A478DE-09AD-4C60-B446-73946D8B0E51}.Release|Any CPU.Build.0 = Release|Any CPU + {2E843175-B948-4D90-A11B-415EE67D9E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E843175-B948-4D90-A11B-415EE67D9E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E843175-B948-4D90-A11B-415EE67D9E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E843175-B948-4D90-A11B-415EE67D9E1A}.Release|Any CPU.Build.0 = Release|Any CPU + {932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}.Release|Any CPU.Build.0 = Debug|Any CPU + {D4938E22-22C3-4364-A710-557B63954B5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4938E22-22C3-4364-A710-557B63954B5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4938E22-22C3-4364-A710-557B63954B5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4938E22-22C3-4364-A710-557B63954B5E}.Release|Any CPU.Build.0 = Release|Any CPU + {2D254550-CE54-43A2-8AE9-FAA72F2C0FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D254550-CE54-43A2-8AE9-FAA72F2C0FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D254550-CE54-43A2-8AE9-FAA72F2C0FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D254550-CE54-43A2-8AE9-FAA72F2C0FD6}.Release|Any CPU.Build.0 = Release|Any CPU + {5953D4C9-C11D-4307-815C-95898416A0FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5953D4C9-C11D-4307-815C-95898416A0FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5953D4C9-C11D-4307-815C-95898416A0FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5953D4C9-C11D-4307-815C-95898416A0FB}.Release|Any CPU.Build.0 = Release|Any CPU + {34A92D4D-B94A-4674-BBA4-8D2F80BECCB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34A92D4D-B94A-4674-BBA4-8D2F80BECCB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34A92D4D-B94A-4674-BBA4-8D2F80BECCB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34A92D4D-B94A-4674-BBA4-8D2F80BECCB6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {45077DFB-D35A-4491-993C-2AC4C8AC838E} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {5B29B975-B0AC-46B3-8398-4C8A22EAE355} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {4E880812-C336-4EB2-9FED-2E437957F50A} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {5CC5900C-50FE-4D78-9E4F-7CE267355622} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {928B382F-48A0-4639-9EC0-0C9BE980C5C6} = {4E880812-C336-4EB2-9FED-2E437957F50A} + {E6801B38-0264-456C-B8E6-A73262B6CBA7} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {3716FB3C-CDC3-45E7-9809-CF7F2DD30388} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {4B1A6E00-C5E7-4DA7-B234-36EA35CC9B44} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {A18F9CE9-32BA-46D6-B902-CF0E51102BD3} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {19560515-92A4-4955-BDD9-E1CDA7E8A3BC} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {C56B8C71-AEFB-4B4C-9545-03F6A646A998} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {8401BAD4-7658-4357-859C-19F40E731848} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {681C6E43-9F8E-4A9B-AD03-12702CF47720} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {A92D009D-2C5B-46BC-893A-7AE995EE8814} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {C7AF2FD1-8490-4238-B40D-7245872FCFEC} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {F8E82C2E-0F24-4CD1-981D-436D08F73587} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {8D3FF4E3-4C56-4FA6-81CC-686DE037FF59} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {CD0F866F-FF61-456B-AAEA-9960B17107E3} = {8D3FF4E3-4C56-4FA6-81CC-686DE037FF59} + {80A478DE-09AD-4C60-B446-73946D8B0E51} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {2E843175-B948-4D90-A11B-415EE67D9E1A} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {932D5063-AEC8-4DA6-8C1E-21BA6214BD5A} = {38F30F45-7DB6-4097-BA85-788ACCCBC5F2} + {D4938E22-22C3-4364-A710-557B63954B5E} = {A18F9CE9-32BA-46D6-B902-CF0E51102BD3} + {2D254550-CE54-43A2-8AE9-FAA72F2C0FD6} = {5B29B975-B0AC-46B3-8398-4C8A22EAE355} + {5953D4C9-C11D-4307-815C-95898416A0FB} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + {34A92D4D-B94A-4674-BBA4-8D2F80BECCB6} = {45077DFB-D35A-4491-993C-2AC4C8AC838E} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0143C230-7F40-44B2-8BA3-EF5B92D55848} + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md index 56093493e..a0cecd6f1 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,52 @@ [![backer](https://opencollective.com/mixcore/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/mixcore#support) [![Donate](https://img.shields.io/badge/$-donate-ff69b4.svg)](https://www.paypal.me/mixcore) [![Buy us a coffee](https://img.shields.io/badge/$-BuyMeACoffee-orange.svg)](https://www.buymeacoffee.com/mixcore) -## Fully Open Source UI Tools to create multi-purpose Web Apps, Mobile Apps & Application Services +### Fully Open Source UI Tools to create multi-purpose Enterprise Web Apps, Mobile Apps & Application Services -### CMS and Dashboards built on top of ASP.Net Core / Dotnet Core, SignalR, Angular.JS and Bootstrap. -![Mixcore CMS](https://github.com/mixcore/mix.core/blob/master/assets/mixcore.png?raw=true "What is Mixcore CMS?") +## UI Screenshots + +### Admin Portal + +> Mixcore CMS Back-office is built on top of the much awaited Bootstrap 5. This makes starting a new project very simple. It also provides benefits if you are already working on a Bootstrap 5 project. + +(New Portal in Angular / Svelte will be coming soon) + +![Mixcore Admin Portal Bootstrap 5.x](https://user-images.githubusercontent.com/3785721/125382627-322d7d00-e3c0-11eb-8ff7-f02316770876.png "Mixcore CMS Admin Portal Bootstrap 5") + + +![Mixcore Admin Portal Bootstrap 5.x](https://user-images.githubusercontent.com/3785721/126033976-28302532-1284-4be8-b8dd-74258a227873.png "Mixcore CMS Admin Portal Bootstrap 5") + + +## Special features (Out of the box) + +- [x] **Databases** -MySQL, SQL Server, PostgreSQL, SQLite +- [x] **Reliability** - Member roles and permissions. +- [x] **High Security** - Strong Data Encryption and Security compliance. +- [x] **Multilingual** - Flexible multilingual content migration. +- [x] **High Performance** - Millisecond response time. +- [x] **Cross Platforms** - Powered by .NET Core and run everywhere. +- [x] **Online Coding** - Visual Studio Code's heart inside. +- [x] **Customizable Designs** - Build any kinds of website. +- [x] **SEO Friendly** - No extra plugin required. +- [x] **Media Management** - Multiple file formats for your website / application. +- [x] **Manage On The Go** - Manage and Code everywhere you want. +- [x] **Easy and Accessible** - Non deep tech knowledge required. +- [x] **Analytics** - Inside Google Analytics dashboard & no extra plugin required. +- [x] **Dynamic Modular Architecture** - Powerful module layers & Attribute sets feature. +- [x] **Extensibility** - API-first architecture for Plug & Play. +- [x] **Easy Backup** - Powerful 1 step export. +- [x] **More Coffee time!** - You can relax and explore more ton of features are not listed here... + +## Architecture +![image](https://user-images.githubusercontent.com/3785721/160266730-f02415a1-870b-45b2-ae4b-ed6c26ca5787.png) + + +### CMS and Dashboards built on top of ASP.Net Core / Dotnet Core, SignalR, Angular / Bootstrap / React / Vue / Svelte. |Services |Result |Services |Result | |---------|---------|---------|---------| +|Github workflow |[![Build Status](https://github.com/mixcore/mix.core/actions/workflows/build-check.yml/badge.svg)](https://github.com/mixcore/mix.core/actions/workflows/build-check.yml)| |Travis CI |[![Build Status](https://travis-ci.org/mixcore/mix.core.svg?branch=master)](https://travis-ci.org/mixcore/mix.core)|AppVeyor CI |[![Build status](https://ci.appveyor.com/api/projects/status/8o02frivdxa0dgpl/branch/master?svg=true)](https://ci.appveyor.com/project/Smilefounder/mix-core/branch/master) | Gitter |[![Join the chat at https://gitter.im/mix-core/Lobby](https://badges.gitter.im/mix-core/Lobby.svg)](https://gitter.im/mix-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)|Licenses status |[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmixcore%2Fmix.core.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmixcore%2Fmix.core?ref=badge_shield) | Codefactor |[![CodeFactor](https://www.codefactor.io/repository/github/mixcore/mix.core/badge)](https://www.codefactor.io/repository/github/mixcore/mix.core) |Azure|[![Build Status](https://dev.azure.com/mixcore/mix.core/_apis/build/status/mixcore.mix.core?branchName=master)](https://dev.azure.com/mixcore/mix.core/_build/latest?definitionId=1&branchName=master)| @@ -20,7 +58,7 @@ Codefactor |[![CodeFactor](https://www.codefactor.io/repository/github/mixco | |Links | |---------|---------| -|STAG / Demo |https://demo.mixcore.org or https://mochahost.demo.mixcore.org/portal (administrator / P@ssw0rd) Ref: [How to install Mixcore CMS with Azure Docker Composer](https://community.mixcore.org/topic/4/install-mixcore-cms-with-azure-and-docker-compose)| +|STAG / Demo |https://demo.mixcore.org or https://dev.mixcore.org or https://mochahost.demo.mixcore.org/portal (administrator / P@ssw0rd) Ref: [How to install Mixcore CMS with Azure Docker Composer](https://community.mixcore.org/topic/4/install-mixcore-cms-with-azure-and-docker-compose)| |Dev docs |https://docs.mixcore.org / https://mixcore.dev| |Community |https://community.mixcore.org| |Youtube |https://www.youtube.com/channel/UChqzh6JnC8HBUSQ9AWIcZAw| @@ -46,7 +84,7 @@ docker-compose up mkdir mixcore cd mixcore -git clone https://github.com/mixcore/mix.core.git +git clone --branch develop --recursive https://github.com/mixcore/mix.core.git ``` Optional: @@ -54,8 +92,7 @@ Optional: > Optional steps as those packages are Nuget Library ```bash -git clone https://github.com/mixcore/mix.heart.git -git clone https://github.com/mixcore/mix.identity.git +git submodule update --init --recursive ``` @@ -87,46 +124,12 @@ gulp build > Note: If you facing any System.Data.SqlClient.SqlException error, please replace all content inside "appsettings.json" file with "{}". -## Special features (Out of the box) - -- [x] **Reliability** - Member roles and permissions. -- [x] **High Security** - Strong Data Encryption and Security compliance. -- [x] **Multilingual** - Flexible multilingual content migration. -- [x] **High Performance** - Millisecond response time. -- [x] **Cross Platforms** - Powered by .NET Core and run everywhere. -- [x] **Online Coding** - Visual Studio Code's heart inside. -- [x] **Customizable Designs** - Build any kinds of website. -- [x] **SEO Friendly** - No extra plugin required. -- [x] **Media Management** - Multiple file formats for your website / application. -- [x] **Manage On The Go** - Manage and Code everywhere you want. -- [x] **Easy and Accessible** - Non deep tech knowledge required. -- [x] **Analytics** - Inside Google Analytics dashboard & no extra plugin required. -- [x] **Dynamic Modular Architecture** - Powerful module layers & Attribute sets feature. -- [x] **Extensibility** - API-first architecture for Plug & Play. -- [x] **Easy Backup** - Powerful 1 step export. -- [x] **More Coffee time!** - You can relax and explore more ton of features are not listed here... - -## UI Screenshots -### Default Theme: - -> [Shards UI Kit](https://designrevision.com/demo/shards/) Shards is a modern design system based on Bootstrap 4 that comes packed with **10 extra custom components** and **two pre-built landing pages**. It’s also lightweight with its stylesheet weighting only **~13kb minified and gzipped**. - -![Mixcore CMS default template with Shards UI Kit](https://docs.mixcore.org/img/basic-usage/first-step.png "Mixcore CMS default template with Shards UI Kit") - -### Admin Portal - -> Mixcore CMS Back-office is built on top of the much awaited Bootstrap 4. This makes starting a new project very simple. It also provides benefits if you are already working on a Bootstrap 4 project. - -![Mixcore Admin Portal Bootstrap 4.x](https://docs.mixcore.org/img/screencapture-stag-mixcore-org-portal-2019-08-04-16_04_15.jpg "Mixcore CMS Admin Portal Bootstrap 4") - ## Thanks to > This project has been developed using: -* [Creative Tim](https://www.creative-tim.com/) +* [.NET](https://www.microsoft.com/net/core) * [Bootstrap](https://getbootstrap.com/) * [BrowserStack](https://www.browserstack.com/) -* [Micon](http://xtoolkit.github.io/Micon/icons/) -* [.NET](https://www.microsoft.com/net/core) * [Designed by Freepik](https://www.freepik.com) * And more... @@ -146,6 +149,10 @@ Mixcore CMS is licensed under the **[MIT](https://github.com/mixcore/mix.core/bl [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmixcore%2Fmix.core.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmixcore%2Fmix.core?ref=badge_large) + +## Activity + +![Alt](https://repobeats.axiom.co/api/embed/4ec425735bae424c69c063f2bac106c3107b6db4.svg "Repobeats analytics image") ======= ## How to contribute diff --git a/diagrams/dg-overview-details.png b/diagrams/dg-overview-details.png new file mode 100644 index 000000000..1e6e1acea Binary files /dev/null and b/diagrams/dg-overview-details.png differ diff --git a/diagrams/dg-overview.png b/diagrams/dg-overview.png new file mode 100644 index 000000000..3694c7ef8 Binary files /dev/null and b/diagrams/dg-overview.png differ diff --git a/diagrams/mixstore.mmd b/diagrams/mixstore.mmd new file mode 100644 index 000000000..85f4670d0 --- /dev/null +++ b/diagrams/mixstore.mmd @@ -0,0 +1,22 @@ +stateDiagram-v2 + [*] --> MixcoreCms + MixcoreCms --> Init + Init --> InstallTheme + MixcoreCms --> MixPortal + MixPortal --> MixPage + MixPortal --> MixPost + MixPortal --> MixModule + MixPortal --> MixDatabase + MixDatabase --> MixNavigation + MixDatabase --> MixCategory + MixDatabase --> MixTag + MixPortal --> MixTheme + MixTheme --> InstallTheme + InstallTheme --> MixStore + MixStore --> Checkout: select theme + Checkout --> Install: free theme + Checkout --> Paypal: not free theme + Paypal --> Install: checkout completed + Install --> Success: no error during install + Install --> Error: error during install + Error --> Refund diff --git a/shared/{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}/CodeAnalysisLog.xml b/shared/{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}/CodeAnalysisLog.xml new file mode 100644 index 000000000..e2b874cd7 --- /dev/null +++ b/shared/{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}/CodeAnalysisLog.xml @@ -0,0 +1,28 @@ + + + + + Category + Certainty + Collapse All + Check Id + Error + error(s) + Expand All + Help + Line + message(s) + [Location not stored in Pdb] + Project + Resolution + Rule + Rule File + Rule Description + Source + Status + Target + Warning + warning(s) + Code Analysis Report + + diff --git a/src/Mix.Cms.Api.RestFul/default.appsettings.json b/shared/{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}/WebProject.lastcodeanalysissucceeded similarity index 100% rename from src/Mix.Cms.Api.RestFul/default.appsettings.json rename to shared/{932D5063-AEC8-4DA6-8C1E-21BA6214BD5A}/WebProject.lastcodeanalysissucceeded diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index 9b151bc60..000000000 Binary files a/src/.DS_Store and /dev/null differ diff --git a/src/Mix.Cms.Api.GraphQL/Controllers/GraphqlController.cs b/src/Mix.Cms.Api.GraphQL/Controllers/GraphqlController.cs deleted file mode 100644 index 5dfea5d4f..000000000 --- a/src/Mix.Cms.Api.GraphQL/Controllers/GraphqlController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Threading.Tasks; -using GraphQL; -using GraphQL.Types; -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Api.GraphQL.Infrastructure.Models; - -namespace Mix.Cms.Api.GraphQL.Controllers -{ - [Route("api/graphql")] - [ApiController] - public class GraphqlController : ControllerBase - { - private static readonly Schema graphQLSchema; - static GraphqlController() - { - var dbContext = new MixCmsContext(); - var tableNameLookup = new TableNameLookup(); - var metaDatabase = new DatabaseMetadata(dbContext, tableNameLookup); - var schema = new Schema { Query = new Mix.Cms.Api.GraphQL.Infrastructure.GraphQLQuery(dbContext, metaDatabase, tableNameLookup) }; - schema.Initialize(); - graphQLSchema = schema; - } - [HttpPost] - public async Task Get([FromBody] QueryRequest query) - { - var result = await new DocumentExecuter().ExecuteAsync( - new ExecutionOptions() - { - Schema = graphQLSchema, - Query = query.Query - } - ).ConfigureAwait(false); - if (result.Errors?.Count > 0) - { - return BadRequest(result.Errors); - } - return Ok(result); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/DbContextExtensions.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/DbContextExtensions.cs deleted file mode 100644 index 318a2cf60..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/DbContextExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public static class DbContextExtensions - { - public static IQueryable Query(this DbContext context, string entityName) => - context.Query(context.Model.FindEntityType(entityName).ClrType); - static readonly MethodInfo SetMethod = typeof(DbContext).GetMethod(nameof(DbContext.Set)); - public static IQueryable Query(this DbContext context, Type entityType) => - (IQueryable)SetMethod.MakeGenericMethod(entityType).Invoke(context, null); - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/GraphQLQuery.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/GraphQLQuery.cs deleted file mode 100644 index a6e19d368..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/GraphQLQuery.cs +++ /dev/null @@ -1,55 +0,0 @@ -using GraphQL.Types; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Api.GraphQL.Infrastructure.Interfaces; -using System; -using System.Linq; -using System.Reflection; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class GraphQLQuery : ObjectGraphType - { - private IDatabaseMetadata _dbMetadata; - private ITableNameLookup _tableNameLookup; - private DbContext _dbContext; - public GraphQLQuery( - DbContext dbContext, - IDatabaseMetadata dbMetadata, - ITableNameLookup tableNameLookup) - { - _dbMetadata = dbMetadata; - _tableNameLookup = tableNameLookup; - _dbContext = dbContext; - Name = "Query"; - var assem = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.ManifestModule.Name == "Mix.Cms.Lib.dll"); - - foreach (var metaTable in _dbMetadata.GetTableMetadatas()) - { - var type = assem.GetType(metaTable.AssemblyFullName); - var tableType = new TableType(metaTable, type); - var friendlyTableName = metaTable.TableName; - // _tableNameLookup.GetFriendlyName(metaTable.TableName); - AddField(new FieldType - { - Name = friendlyTableName, - Type = tableType.GetType(), - ResolvedType = tableType, - Resolver = new MyFieldResolver(metaTable, _dbContext), - Arguments = new QueryArguments(tableType.TableArgs) - }); - // lets add key to get list of current table - var listType = new ListGraphType(tableType); - AddField(new FieldType - { - Name = $"{friendlyTableName}_list", - Type = listType.GetType(), - ResolvedType = listType, - Resolver = new MyFieldResolver(metaTable, _dbContext), - Arguments = new QueryArguments( - tableType.TableArgs - ) - }); - } - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/IDatabaseMetadata.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/IDatabaseMetadata.cs deleted file mode 100644 index 9cc017423..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/IDatabaseMetadata.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Interfaces -{ - public interface IDatabaseMetadata - { - void ReloadMetadata(); - IEnumerable GetTableMetadatas(); - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/ITableNameLookup.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/ITableNameLookup.cs deleted file mode 100644 index 1f676eca0..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Interfaces/ITableNameLookup.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Interfaces -{ - public interface ITableNameLookup - { - bool InsertKeyName(string friendlyName); - string GetFriendlyName(string correctName); - } - -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/ColumnMetadata.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/ColumnMetadata.cs deleted file mode 100644 index 2f74fdb2a..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/ColumnMetadata.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class ColumnMetadata - { - public string ColumnName { get; set; } - public string DataType { get; set; } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/DatabaseMetadata.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/DatabaseMetadata.cs deleted file mode 100644 index fc19b47a0..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/DatabaseMetadata.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; -using Mix.Cms.Api.GraphQL.Infrastructure.Interfaces; -using System.Collections.Generic; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Models -{ - public sealed class DatabaseMetadata : IDatabaseMetadata - { - private readonly DbContext _dbContext; - private readonly ITableNameLookup _tableNameLookup; - private string _databaseName; - private IEnumerable _tables; - public DatabaseMetadata(DbContext dbContext, ITableNameLookup tableNameLookup) - { - _dbContext = dbContext; - _tableNameLookup = tableNameLookup; - _databaseName = _dbContext.Database.GetDbConnection().Database; - if (_tables == null) - ReloadMetadata(); - } - public IEnumerable GetTableMetadatas() - { - if (_tables == null) - return new List(); return _tables; - } - public void ReloadMetadata() - { - _tables = FetchTableMetaData(); - } - private IReadOnlyList FetchTableMetaData() - { - var metaTables = new List(); - foreach (var entityType in _dbContext.Model.GetEntityTypes()) - { - var tableName = entityType.GetTableName(); - metaTables.Add(new TableMetadata - { - TableName = tableName, - AssemblyFullName = entityType.ClrType.FullName, - Columns = GetColumnsMetadata(entityType) - }); - _tableNameLookup.InsertKeyName(tableName); - } - - return metaTables; - } - private IReadOnlyList GetColumnsMetadata(IEntityType entityType) - { - var tableColumns = new List(); foreach (var propertyType in entityType.GetProperties()) - { - tableColumns.Add(new ColumnMetadata - { - ColumnName = propertyType.Name, - DataType = propertyType.GetColumnType() - }); - } - return tableColumns; - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/QueryRequest.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/QueryRequest.cs deleted file mode 100644 index 76ec3262c..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/QueryRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Newtonsoft.Json.Linq; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Models -{ - public class QueryRequest - { - public string OperationName { get; set; } - public string NamedQuery { get; set; } - public string Query { get; set; } - public JObject Variables { get; set; } - } - -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableMetadata.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableMetadata.cs deleted file mode 100644 index 3791bc2ee..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableMetadata.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class TableMetadata - { - public string TableName { get; set; } - public string AssemblyFullName { get; set; } - public IEnumerable Columns { get; set; } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableNameLookup.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableNameLookup.cs deleted file mode 100644 index f015485f6..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Models/TableNameLookup.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Mix.Cms.Api.GraphQL.Infrastructure.Interfaces; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Models -{ - public class TableNameLookup : ITableNameLookup - { - private IDictionary _lookupTable = new Dictionary(); public bool InsertKeyName(string correctName) - { - if (!_lookupTable.ContainsKey(correctName)) - { - var friendlyName = CanonicalName(correctName); - _lookupTable.Add(correctName, friendlyName); - return true; - } - return false; - } - public string GetFriendlyName(string correctName) - { - if (!_lookupTable.TryGetValue(correctName, out string value)) - throw new Exception($"Could not get {correctName} out of the list."); - return value; - } - private string CanonicalName(string correctName) - { - var index = correctName.LastIndexOf("_"); var result = correctName.Substring( - index + 1, - correctName.Length - index - 1); return Char.ToLowerInvariant(result[0]) + result.Substring(1); - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Providers/DynamicLinqProvider.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Providers/DynamicLinqProvider.cs deleted file mode 100644 index 80ce71d39..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Providers/DynamicLinqProvider.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core.CustomTypeProviders; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure.Providers -{ - public class DynamicLinqProvider : IDynamicLinkCustomTypeProvider - { - public HashSet GetCustomTypes() - { - HashSet types = new HashSet(); - types.Add(typeof(EF)); - return types; - } - - public Dictionary> GetExtensionMethods() - { - throw new NotImplementedException(); - } - - public Type ResolveType(string typeName) - { - throw new NotImplementedException(); - } - - public Type ResolveTypeBySimpleName(string simpleTypeName) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/MyFieldResolver.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/MyFieldResolver.cs deleted file mode 100644 index cfe7898ea..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/MyFieldResolver.cs +++ /dev/null @@ -1,66 +0,0 @@ -using GraphQL; -using GraphQL.Resolvers; -using GraphQL.Types; -using Microsoft.EntityFrameworkCore; -using Mix.Heart.Extensions; -using System; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Linq.Expressions; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class MyFieldResolver: IFieldResolver - { - private TableMetadata _tableMetadata; - private DbContext _dbContext; - public MyFieldResolver(TableMetadata tableMetadata, DbContext dbContext) - { - _tableMetadata = tableMetadata; - _dbContext = dbContext; - } - - public object Resolve(IResolveFieldContext context) - { - var queryable = _dbContext.Query(_tableMetadata.AssemblyFullName); - - // Get filters - var filters = context.Arguments.Where(c => c.Key != "first" && c.Key != "offset"); - string predicates = string.Empty; - object[] args = new object[filters.Count()]; - int paramsCount = -1; - - foreach (var item in filters) - { - paramsCount++; - if (!string.IsNullOrEmpty(predicates)) - { - predicates += " and "; - } - args[paramsCount] = item.Value; - // Note: check for like function https://github.com/StefH/System.Linq.Dynamic.Core/issues/105 - predicates += $"{item.Key.ToTitleCase()} == @{paramsCount}"; - } - - if (context.FieldName.Contains("_list")) - { - var first = context.Arguments["first"] != null ? - context.GetArgument("first", int.MaxValue) : int.MaxValue; - var offset = context.Arguments["offset"] != null ? - context.GetArgument("offset", 0) : 0; - - if (paramsCount >= 0) - { - - queryable = queryable.Where(predicates, args); - } - - return queryable.Skip(offset).Take(first).ToDynamicList(); - } - else - { - return paramsCount >= 0 ? queryable.FirstOrDefault(predicates, args) : null; - } - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/NameFieldResolver.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/NameFieldResolver.cs deleted file mode 100644 index b4779fd76..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Resolvers/NameFieldResolver.cs +++ /dev/null @@ -1,34 +0,0 @@ -using GraphQL; -using GraphQL.Resolvers; -using GraphQL.Types; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class NameFieldResolver : IFieldResolver - { - private static object GetPropValue(object src, string propName) - { - return src.GetType().GetProperty(propName)?.GetValue(src, null); - } - - public object Resolve(IResolveFieldContext context) - { - var source = context.Source; - if (source == null) - { - return null; - } - var name = Char.ToUpperInvariant(context.FieldAst.Name[0]) + context.FieldAst.Name.Substring(1); - var value = GetPropValue(source, name); - //if (value == null) - //{ - // throw new InvalidOperationException($"Expected to find property {context.FieldAst.Name} on {context.Source.GetType().Name} but it does not exist."); - //} - return value; - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Infrastructure/Types/TableType.cs b/src/Mix.Cms.Api.GraphQL/Infrastructure/Types/TableType.cs deleted file mode 100644 index ba8135ad5..000000000 --- a/src/Mix.Cms.Api.GraphQL/Infrastructure/Types/TableType.cs +++ /dev/null @@ -1,97 +0,0 @@ -using GraphQL; -using GraphQL.Types; -using Mix.Cms.Lib.Helpers; -using Mix.Heart.Helpers; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.GraphQL.Infrastructure -{ - public class TableType : ObjectGraphType - { - public QueryArguments TableArgs - { - get; set; - } - private IDictionary _databaseTypeToSystemType; - public Type _type { get; set; } - protected IDictionary DatabaseTypeToSystemType - { - get - { - if (_databaseTypeToSystemType == null) - { - _databaseTypeToSystemType = new Dictionary { - { "uniqueidentifier", typeof(String) }, - { "char", typeof(String) }, - { "nvarchar(250)", typeof(String) }, - { "nvarchar(50)", typeof(String) }, - { "text", typeof(String) }, - { "int", typeof(int) }, - { "decimal", typeof(decimal) }, - { "bit", typeof(bool) } - }; - } - return _databaseTypeToSystemType; - } - } - public TableType(TableMetadata tableMetadata, Type type) - { - _type = type; - Name = tableMetadata.TableName; - foreach (var tableColumn in tableMetadata.Columns) - { - InitGraphTableColumn(tableColumn); - } - } - private void InitGraphTableColumn(ColumnMetadata columnMetadata) - { - var graphQLType = (ResolveColumnMetaType(columnMetadata.DataType)).GetGraphTypeFromType(true); - var columnField = Field( - graphQLType, - columnMetadata.ColumnName - ); - columnField.Resolver = new NameFieldResolver(); - FillArgs(columnMetadata.ColumnName); - } - private void FillArgs(string columnName) - { - var dataType = ReflectionHelper.GetPropertyType(_type, columnName); - if (TableArgs == null) - { - TableArgs = new QueryArguments(); - TableArgs.Add(new QueryArgument { Name = "first" }); - TableArgs.Add(new QueryArgument { Name = "offset" }); - } - if (dataType != null) - { - - switch (dataType.Name) - { - case "Int32": - TableArgs.Add(new QueryArgument { Name = columnName }); - break; - case "DateTime": - TableArgs.Add(new QueryArgument { Name = columnName }); - break; - case "Boolean": - TableArgs.Add(new QueryArgument { Name = columnName }); - break; - default: - TableArgs.Add(new QueryArgument { Name = columnName }); - break; - } - } - //TableArgs.Add(new QueryArgument { Name = "id" }); - //TableArgs.Add(new QueryArgument { Name = "first" }); - //TableArgs.Add(new QueryArgument { Name = "offset" }); - } - private Type ResolveColumnMetaType(string dbType) - { - if (DatabaseTypeToSystemType.ContainsKey(dbType)) - return DatabaseTypeToSystemType[dbType]; return typeof(String); - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Mix.Cms.Api.GraphQL.csproj b/src/Mix.Cms.Api.GraphQL/Mix.Cms.Api.GraphQL.csproj deleted file mode 100644 index 40a5d8915..000000000 --- a/src/Mix.Cms.Api.GraphQL/Mix.Cms.Api.GraphQL.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net5.0 - false - - - - - - - - - - - - - - - - - - - - diff --git a/src/Mix.Cms.Api.GraphQL/Program.cs b/src/Mix.Cms.Api.GraphQL/Program.cs deleted file mode 100644 index bdd0c5bf0..000000000 --- a/src/Mix.Cms.Api.GraphQL/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -namespace Mix.Cms.Api.GraphQL -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Properties/launchSettings.json b/src/Mix.Cms.Api.GraphQL/Properties/launchSettings.json deleted file mode 100644 index bb2b64a65..000000000 --- a/src/Mix.Cms.Api.GraphQL/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:56036", - "sslPort": 44391 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "weatherforecast", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Mix.Cms.Api.GraphQL": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "weatherforecast", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Readme.txt b/src/Mix.Cms.Api.GraphQL/Readme.txt deleted file mode 100644 index 8a430c6e3..000000000 --- a/src/Mix.Cms.Api.GraphQL/Readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -Ref: - https://dev.to/dotnet/how-you-can-build-a-web-api-using-graphql-net-core-and-entity-framework-1ago - https://hackernoon.com/how-to-implement-generic-queries-by-combining-entityframework-core-and-graphql-net-77ac8faf4a22 - https://graphql-dotnet.github.io/docs/guides/schema-generation/ \ No newline at end of file diff --git a/src/Mix.Cms.Api.GraphQL/ServiceCollectionExtensions.cs b/src/Mix.Cms.Api.GraphQL/ServiceCollectionExtensions.cs deleted file mode 100644 index 7b770afb9..000000000 --- a/src/Mix.Cms.Api.GraphQL/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -//using EntityGraphQL.Schema; -//using GraphQL.Types; -using GraphQL.Types; -using Microsoft.Extensions.DependencyInjection; -using Mix.Cms.Api.GraphQL.Infrastructure; -using Mix.Cms.Api.GraphQL.Infrastructure.Interfaces; -using Mix.Cms.Api.GraphQL.Infrastructure.Models; -//using Mix.Cms.Api.GraphQL.Infrastructure.Interfaces; -//using Mix.Cms.Api.GraphQL.Infrastructure.Models; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Api.GraphQL -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddMyGraphQL(this IServiceCollection services) - { - //services.AddDbContext(); - //services.AddScoped(); - //services.AddScoped(); - //services.AddScoped((resolver) => - //{ - // var dbContext = resolver.GetRequiredService(); - // var metaDatabase = resolver.GetRequiredService(); - // var tableNameLookup = resolver.GetRequiredService(); - // var schema = new Schema { Query = new GraphQLQuery(dbContext, metaDatabase, tableNameLookup) }; - // schema.Initialize(); - // return schema; - //}); - - //services.AddDbContext(); - // add schema provider so we don't need to create it everytime - // Also for this demo we expose all fields on MyDbContext. See below for details on building custom fields etc. - //services.AddSingleton(SchemaBuilder.FromObject(true)); - return services; - } - } -} diff --git a/src/Mix.Cms.Api.GraphQL/Startup.cs b/src/Mix.Cms.Api.GraphQL/Startup.cs deleted file mode 100644 index 43fc13308..000000000 --- a/src/Mix.Cms.Api.GraphQL/Startup.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace Mix.Cms.Api.GraphQL -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseHttpsRedirection(); - - app.UseRouting(); - - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Configurations/ApiConfigurationPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Configurations/ApiConfigurationPortalController.cs deleted file mode 100644 index 745e56926..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Configurations/ApiConfigurationPortalController.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixConfigurations; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/configuration")] - public class ApiConfigurationPortalController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - string category = Request.Query["category"]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.Keyword.Contains(keyword) - || model.Value.Contains(keyword) - ) - && (string.IsNullOrEmpty(category) - || model.Category == category - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Languages/ApiLanguageController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Languages/ApiLanguageController.cs deleted file mode 100644 index 21320004b..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Languages/ApiLanguageController.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixLanguages; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/language")] - public class ApiLanguageController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.Keyword.Contains(keyword) - || model.Value.Contains(keyword) - || model.DefaultValue.Contains(keyword) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseColumns/ApiMixDatabaseColumnController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseColumns/ApiMixDatabaseColumnController.cs deleted file mode 100644 index 40c457ad6..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseColumns/ApiMixDatabaseColumnController.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabaseColumns; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/mix-database-column/portal")] - public class ApiMixDatabaseColumnController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/en-us/mix-database-column/client - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.MixDatabaseName.Contains(keyword) - || model.Name.Contains(keyword) - || model.DefaultValue.Contains(keyword) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // GET: api/v1/rest/en-us/mix-database-column/client - [HttpGet("init/{mixDatabase}")] - public async Task>> Init(string mixDatabase) - { - int.TryParse(mixDatabase, out int mixDatabaseId); - var getData = await UpdateViewModel.Repository.GetModelListByAsync(f => f.MixDatabaseName == mixDatabase || f.MixDatabaseId == mixDatabaseId - , _context, _transaction); - - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataAssociations/ApiMixDatabaseDataAssociationPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataAssociations/ApiMixDatabaseDataAssociationPortalController.cs deleted file mode 100644 index 81a7b0637..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataAssociations/ApiMixDatabaseDataAssociationPortalController.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/mix-database-data-association/portal")] - public class ApiMixDatabaseDataAssociationPortalController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/{culture}/mix-database-data-association - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query["status"], out MixContentStatus status); - bool isAttributeId = int.TryParse(Request.Query["mixDatabaseId"], out int mixDatabaseId); - bool isFromDate = DateTime.TryParse(Request.Query["fromDate"], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query["toDate"], out DateTime toDate); - bool isParentType = Enum.TryParse(Request.Query["parentType"], out MixDatabaseParentType parentType); - string parentId = Request.Query["parentId"]; - string mixDatabaseName = Request.Query["mixDatabaseName"]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && ((isAttributeId && model.MixDatabaseId == mixDatabaseId) || model.MixDatabaseName == mixDatabaseName) - && (string.IsNullOrEmpty(parentId) - || (model.ParentId == parentId && model.ParentType == parentType) - ); - - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - //[HttpGet] - //[Route("navigation/{name}")] - //public async Task> GetNavigation(string name) - //{ - // var navs = await Lib.ViewModels.MixDatabaseDatas.Helper.FilterByKeywordAsync( - // _lang, MixConstants.MixDatabaseName.NAVIGATION, "equal", "name", name); - // return Ok(navs.Data.FirstOrDefault()?.Nav); - //} - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataValues/ApiMixDatabaseDataValueController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataValues/ApiMixDatabaseDataValueController.cs deleted file mode 100644 index be7a68941..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDataValues/ApiMixDatabaseDataValueController.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabaseDataValues; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/mix-database-data-value/portal")] - public class ApiMixDatabaseDataValueController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/en-us/mix-database-column/client - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query["status"], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query["fromDate"], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query["toDate"], out DateTime toDate); - string keyword = Request.Query["keyword"]; - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.MixDatabaseName.Contains(keyword) - || EF.Functions.Like(model.StringValue, $"%{keyword}%") - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/ApiMixDatabaseDataController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/ApiMixDatabaseDataController.cs deleted file mode 100644 index 332e73ced..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/ApiMixDatabaseDataController.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixDatabaseDatas; -using Mix.Domain.Core.ViewModels; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/mix-database-data/client")] - public class ApiMixDatabaseDataController : - BaseRestApiController - { - // GET: api/v1/rest/{culture}/mix-database-data/client/search - [HttpGet] - public override async Task>> Get() - { - var getData = await Helper.FilterByKeywordAsync(Request, _lang); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // GET: api/v1/rest/{culture}/mix-database-data - [HttpGet("init/{mixDatabaseName}")] - public async Task> Init(string mixDatabaseName) - { - var getAttrSet = await Lib.ViewModels.MixDatabases.ReadViewModel.Repository.GetSingleModelAsync(m => m.Name == mixDatabaseName); - if (getAttrSet.IsSucceed) - { - FormViewModel result = new FormViewModel() - { - Specificulture = _lang, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - }; - result.ExpandView(); - return Ok(result); - } - else - { - return BadRequest(getAttrSet.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataMvcController.cs deleted file mode 100644 index f9ff42ad0..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataMvcController.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabaseDatas; -using Mix.Domain.Core.ViewModels; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Route("api/v1/rest/{culture}/mix-database-data/mvc")] - public class MixDatabaseDataMvcController : - BaseReadOnlyApiController - { - // GET: api/v1/rest/{culture}/mix-database-data - [HttpGet] - public override async Task>> Get() - { - var getData = await Helper.FilterByKeywordAsync(Request, _lang); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataPortalController.cs deleted file mode 100644 index a59957964..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabaseDatas/MixDatabaseDataPortalController.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabaseDatas; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Route("api/v1/rest/{culture}/mix-database-data/portal")] - public class MixDatabaseDataPortalController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/{culture}/mix-database-data - [HttpGet] - public override async Task>> Get() - { - var getData = await Helper.FilterByKeywordAsync(Request, _lang); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // GET: api/v1/rest/{culture}/mix-database-data/additional-data - [HttpGet("additional-data")] - public async Task>> GetAdditionalData() - { - if (Enum.TryParse(Request.Query["parentType"].ToString(), out MixDatabaseParentType parentType) - && int.TryParse(Request.Query["parentId"].ToString(), out int parentId) && parentId > 0) - { - var getData = await Helper.GetAdditionalData(parentType, parentId.ToString(), Request, _lang); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - else - { - var getAttrSet = await Lib.ViewModels.MixDatabases.UpdateViewModel.Repository.GetSingleModelAsync( - m => m.Name == Request.Query["databaseName"].ToString()); - if (getAttrSet.IsSucceed) - { - AdditionalViewModel result = new AdditionalViewModel() - { - Specificulture = _lang, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Status = MixContentStatus.Published, - Fields = getAttrSet.Data.Fields, - ParentType = parentType - }; - result.ExpandView(); - return Ok(result); - } - return BadRequest(getAttrSet.Errors); - } - } - - // PUT: api/s/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for - // more details see https://aka.ms/RazorPagesCRUD. - [HttpPost("save-additional-data")] - public async Task SaveAdditionalData([FromBody] AdditionalViewModel data) - { - if (string.IsNullOrEmpty(data.Id)) - { - data.CreatedBy = User.Identity.Name; - } - else - { - data.ModifiedBy = User.Identity.Name; - data.LastModified = DateTime.UtcNow; - } - - var result = await base.SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - var current = await GetSingleAsync(data.Id); - if (!current.IsSucceed) - { - return NotFound(); - } - else - { - return BadRequest(result.Errors); - } - } - } - - // GET: api/v1/rest/{culture}/mix-database-data - [HttpGet("init/{mixDatabase}")] - public async Task> Init(string mixDatabase) - { - _ = int.TryParse(mixDatabase, out int mixDatabaseId); - var getAttrSet = await Lib.ViewModels.MixDatabases.UpdateViewModel.Repository.GetSingleModelAsync(m => m.Name == mixDatabase || m.Id == mixDatabaseId); - if (getAttrSet.IsSucceed) - { - FormViewModel result = new FormViewModel() - { - Specificulture = _lang, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Status = MixContentStatus.Published, - Fields = getAttrSet.Data.Fields - }; - result.ExpandView(); - return Ok(result); - } - else - { - return BadRequest(getAttrSet.Errors); - } - } - - // GET api/mix-database-data - [HttpGet("export")] - public async Task Export() - { - string mixDatabaseName = Request.Query["mixDatabaseName"].ToString(); - string exportPath = $"content/exports/module/{mixDatabaseName}"; - var getData = await Helper.FilterByKeywordAsync(Request, _lang); - - var jData = new List(); - if (getData.IsSucceed) - { - foreach (var item in getData.Data.Items) - { - jData.Add(item.Obj); - } - var result = Lib.ViewModels.MixDatabaseDatas.Helper.ExportAttributeToExcel(jData, string.Empty, exportPath, $"{mixDatabaseName}", null); - return Ok(result.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // POST api/mix-database-data - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("import-data/{mixDatabaseName}")] - public async Task>> ImportData(string mixDatabaseName, [FromForm] IFormFile file) - { - var getMixDatabase = await Lib.ViewModels.MixDatabases.ReadViewModel.Repository.GetSingleModelAsync( - m => m.Name == mixDatabaseName); - if (getMixDatabase.IsSucceed) - { - if (file != null) - { - var result = await Helper.ImportData(_lang, getMixDatabase.Data, file); - return Ok(result); - } - } - return new RepositoryResponse() { Status = 501 }; - } - - // DELETE: api/v1/rest/en-us/mix-database/portal/5 - [HttpDelete("{id}")] - public override async Task> Delete(string id) - { - var result = await DeleteAsync(id, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabaseController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabaseController.cs deleted file mode 100644 index 463d9ded1..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabaseController.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabases; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/mix-database/client")] - public class ApiMixDatabaseController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/en-us/mix-database/client - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.Name.Contains(keyword) - || model.Title.Contains(keyword) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabasePortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabasePortalController.cs deleted file mode 100644 index a2ed8625d..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/MixDatabases/ApiMixDatabasePortalController.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixDatabases; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [Produces("application/json")] - [Route("api/v1/rest/mix-database/portal")] - public class ApiMixDatabasePortalController : - BaseAuthorizedRestApiController - { - // GET: api/v1/rest/en-us/mix-database/portal - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query["status"], out MixContentStatus status); - bool isType = Enum.TryParse(Request.Query["type"], out MixDatabaseType type); - bool isFromDate = DateTime.TryParse(Request.Query["fromDate"], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query["toDate"], out DateTime toDate); - string keyword = Request.Query["keyword"]; - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isType || model.Type == type) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || model.Name.Contains(keyword) - || model.Title.Contains(keyword) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // DELETE: api/v1/rest/en-us/mix-database/portal/5 - [HttpDelete("{id}")] - public override async Task> Delete(string id) - { - var getData = await DeleteViewModel.Repository.GetSingleModelAsync(m => m.Id == int.Parse(id)); - - if (getData.IsSucceed) - { - var result = await getData.Data.RemoveModelAsync(true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - else - { - return NotFound(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataMvcController.cs deleted file mode 100644 index 9dacf42eb..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataMvcController.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixModuleDatas; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/module-data/mvc")] - public class ApiModuleDataMvcController : - BaseRestApiController - { - [HttpGet] - public override async Task>> Get() - { - bool isModuleId = int.TryParse(Request.Query["module_id"], out int moduleId); - bool isPostId = int.TryParse(Request.Query["post_id"], out int postId); - bool isPageId = int.TryParse(Request.Query[""], out int pageId); - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (model.ModuleId == moduleId) - && (!isPostId || model.PostId == postId) - && (!isPageId || model.PageId == pageId) - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Value, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet, HttpOptions] - [Route("init-form/{moduleId}")] - public async Task> InitByIdAsync(int moduleId) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Id == moduleId && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var ModuleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - }); - return Ok(ModuleData); - } - else - { - return BadRequest(); - } - } - - [HttpPost, HttpOptions] - [Route("save/{moduleName}")] - public async Task> SaveByName(string moduleName, [FromBody] JObject data) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Name == moduleName && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var moduleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - foreach (var item in moduleData.DataProperties) - { - moduleData.JItem[item.Name]["value"] = data[item.Name]?.Value(); - } - return await moduleData.SaveModelAsync(); - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataPortalController.cs deleted file mode 100644 index a2118ed61..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModuleDatas/ApiModuleDataPortalController.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixModuleDatas; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/module-data/portal")] - public class ApiModuleDataDataController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isModuleId = int.TryParse(Request.Query["module_id"], out int moduleId); - bool isPostId = int.TryParse(Request.Query["post_id"], out int postId); - bool isPageId = int.TryParse(Request.Query[""], out int pageId); - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (model.ModuleId == moduleId) - && (!isPostId || model.PostId == postId) - && (!isPageId || model.PageId == pageId) - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Value, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet("export")] - public async Task> Export() - { - bool isModuleId = int.TryParse(Request.Query["module_id"], out int moduleId); - bool isPostId = int.TryParse(Request.Query["post_id"], out int postId); - bool isPageId = int.TryParse(Request.Query[""], out int pageId); - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (model.ModuleId == moduleId) - && (!isPostId || model.PostId == postId) - && (!isPageId || model.PageId == pageId) - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Value, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - var exportData = new List(); - foreach (var item in getData.Data.Items) - { - item.JItem["created_date"] = new JObject() - { - new JProperty("dataType", 1), - new JProperty("value", item.CreatedDateTime.ToLocalTime().ToString("dd-MM-yyyy hh:mm:ss")) - }; - exportData.Add(item.JItem); - } - - string exportPath = $"Exports/Module/{moduleId}"; - var result = CommonHelper.ExportJObjectToExcel(exportData, string.Empty, exportPath, Guid.NewGuid().ToString(), null); - - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // GET api/module-data/create/id - [HttpGet, HttpOptions] - [Route("init-form/{moduleId}")] - public async Task> InitByIdAsync(int moduleId) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Id == moduleId && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var ModuleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - }); - return Ok(ModuleData); - } - else - { - return BadRequest(); - } - } - - // GET api/module-data/create/id - [HttpPost, HttpOptions] - [Route("save/{moduleName}")] - public async Task> SaveByName(string moduleName, [FromBody] JObject data) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Name == moduleName && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var moduleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - foreach (var item in moduleData.DataProperties) - { - moduleData.JItem[item.Name]["value"] = data[item.Name]?.Value(); - } - return await moduleData.SaveModelAsync(); - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModulePosts/ApiModulePostMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/ModulePosts/ApiModulePostMvcController.cs deleted file mode 100644 index 36a1f80f2..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/ModulePosts/ApiModulePostMvcController.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixModulePosts; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/module-post/mvc")] - public class ApiModulePostMvcController : - BaseRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - bool isModule = int.TryParse(Request.Query["page_id"], out int moduleId); - bool isPost = int.TryParse(Request.Query["post_id"], out int postId); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (!isModule || model.ModuleId == moduleId) - && (!isPost || model.PostId == postId) - && (string.IsNullOrWhiteSpace(keyword) - || (model.Description.Contains(keyword) - )); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModuleMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModuleMvcController.cs deleted file mode 100644 index 2e0965ec0..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModuleMvcController.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixModules; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/module/mvc")] - public class ApiModuleMvcController : - BaseRestApiController - { - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Title, $"%{keyword}%")) - || (EF.Functions.Like(model.Description, $"%{keyword}%")) - || (EF.Functions.Like(model.Name, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModulePortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModulePortalController.cs deleted file mode 100644 index ce42af39a..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Modules/ApiModulePortalController.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixModules; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/module/portal")] - public class ApiModuleController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Title, $"%{keyword}%")) - || (EF.Functions.Like(model.Description, $"%{keyword}%")) - || (EF.Functions.Like(model.Name, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/PagePosts/ApiPagePostMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/PagePosts/ApiPagePostMvcController.cs deleted file mode 100644 index 8be7b1410..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/PagePosts/ApiPagePostMvcController.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixPagePosts; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/page-post/mvc")] - public class ApiPagePostMvcController : - BaseRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - bool isPage = int.TryParse(Request.Query["page_id"], out int pageId); - bool isPost = int.TryParse(Request.Query["post_id"], out int postId); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (!isPage || model.PageId == pageId) - && (!isPost || model.PostId == postId) - && (string.IsNullOrWhiteSpace(keyword) - || (model.Description.Contains(keyword) - )); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Pages/ApiPagePortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Pages/ApiPagePortalController.cs deleted file mode 100644 index aa1f501fe..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Pages/ApiPagePortalController.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixPages; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/page/portal")] - public class ApiPageController : - BaseAuthorizedRestApiController - { - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (User.IsInRole("SuperAdmin") || model.CreatedBy == User.Claims.FirstOrDefault(c => c.Type == "Username").Value) - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Title, $"%{keyword}%")) - || (EF.Functions.Like(model.Excerpt, $"%{keyword}%")) - || (EF.Functions.Like(model.Content, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpPost] - public override Task> Create([FromBody] UpdateViewModel data) - { - // Handle your code here or do something before call the base Api. - return base.Create(data); - } - - - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPageNavigation/ApiPortalPageNavigationPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPageNavigation/ApiPortalPageNavigationPortalController.cs deleted file mode 100644 index 44122ee69..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPageNavigation/ApiPortalPageNavigationPortalController.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixPortalPagePortalPages; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/portal-page-navigation")] - public class ApiPortalPageNavigationPortalController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - bool isParentId = int.TryParse(Request.Query[MixRequestQueryKeywords.ParentId], out int parentId); - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (!isParentId || model.ParentId == parentId) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Description, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPages/ApiPortalPagePortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPages/ApiPortalPagePortalController.cs deleted file mode 100644 index 1249b1764..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/PortalPages/ApiPortalPagePortalController.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixPortalPages; -using Mix.Domain.Core.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/permission")] - public class ApiPortalPageController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - var exceptIds = Request.Query["exceptIds"].ToString(); - var lstExceptIds = !string.IsNullOrEmpty(exceptIds) ? exceptIds.Split(',').Select(m => int.Parse(m)).ToList() - : new List(); - - bool isLevel = int.TryParse(Request.Query["level"], out int level); - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (!isLevel || model.Level == level) - && (string.IsNullOrEmpty(exceptIds) || !lstExceptIds.Any(m => m == model.Id)) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.TextKeyword, $"%{keyword}%")) - || (EF.Functions.Like(model.TextDefault, $"%{keyword}%")) - || (EF.Functions.Like(model.Url, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostMvcController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostMvcController.cs deleted file mode 100644 index 7d105aada..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostMvcController.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixPosts; -using Mix.Domain.Core.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/post/mvc")] - public class ApiPostMvcController : - BaseReadOnlyApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string type = Request.Query["type"]; - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(type) || model.Type == type) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Title, $"%{keyword}%")) - || (EF.Functions.Like(model.Excerpt, $"%{keyword}%")) - || (EF.Functions.Like(model.Content, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet("get-by-attribute")] - public async Task>> GetByAttribute() - { - var result = await Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetModelistByMeta( - Request.Query[MixRequestQueryKeywords.DatabaseName], Request.Query["value"], _lang); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpGet("get-by-value-id")] - public async Task>> GetByValueId() - { - var result = await Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetPostListByValueId( - Request.Query["value"]); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPost("get-by-value-ids")] - public async Task>> GetByValueIds([FromBody] List valueIds) - { - var result = await Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetPostListByValueIds( - valueIds); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPost("search-post")] - public async Task>> SearchPost([FromBody] List dataIds, [FromQuery] string keyword) - { - var result = await Mix.Cms.Lib.ViewModels.MixPosts.Helper.SearchPostByIds( - keyword, dataIds); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpGet("get-by-data-id")] - public async Task>> GetByAttributeDataId() - { - var result = await Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetPostListByDataId( - Request.Query["value"] - , _lang); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return BadRequest(result.Errors); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostPortalController.cs deleted file mode 100644 index 6e53519dc..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Posts/ApiPostPortalController.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixPosts; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/{culture}/post/portal")] - public class ApiPostController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string type = Request.Query["type"]; - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - Expression> predicate = model => - model.Specificulture == _lang - && (!isStatus || model.Status == status) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(type) || model.Type == type) - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(model.Title, $"%{keyword}%")) - || (EF.Functions.Like(model.Excerpt, $"%{keyword}%")) - || (EF.Functions.Like(model.Content, $"%{keyword}%")) - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - public override ActionResult Default() - { - using (MixCmsContext context = new MixCmsContext()) - { - var transaction = context.Database.BeginTransaction(); - string template = !string.IsNullOrEmpty(Request.Query["template"].ToString()) - ? $"{Request.Query["template"]}.cshtml" - : null; - var model = new MixPost() - { - Specificulture = _lang, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Type = Request.Query["type"].ToString(), - Template = template - }; - var result = new UpdateViewModel(model, context, transaction); - return Ok(result); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Controllers/v1/Templates/ApiTemplatesPortalController.cs b/src/Mix.Cms.Api.RestFul/Controllers/v1/Templates/ApiTemplatesPortalController.cs deleted file mode 100644 index 2cca85d94..000000000 --- a/src/Mix.Cms.Api.RestFul/Controllers/v1/Templates/ApiTemplatesPortalController.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Controllers; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixTemplates; -using Mix.Domain.Core.ViewModels; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.RestFul.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/rest/template/portal")] - public class ApiTemplateController : - BaseAuthorizedRestApiController - { - - [HttpGet] - public override async Task>> Get() - { - bool isStatus = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Status], out MixContentStatus status); - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - string keyword = Request.Query[MixRequestQueryKeywords.Keyword]; - bool isTheme = int.TryParse(Request.Query["themeId"], out int themeId); - string folderType = Request.Query["folderType"]; - Expression> predicate = model => - (!isStatus || model.Status == status) - && (!isTheme || model.ThemeId == themeId) - && (!isFromDate || model.CreatedDateTime >= fromDate) - && (!isToDate || model.CreatedDateTime <= toDate) - && (string.IsNullOrEmpty(folderType) || model.FolderType == folderType) - && (string.IsNullOrEmpty(keyword) - || EF.Functions.Like(model.FileName, $"%{keyword}%") - || EF.Functions.Like(model.Content, $"%{keyword}%") - ); - var getData = await base.GetListAsync(predicate); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return BadRequest(getData.Errors); - } - } - - - [HttpGet("copy/{id}")] - public async Task> Copy(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - var copyResult = await getData.Data.CopyAsync(); - if (copyResult.IsSucceed) - { - return Ok(copyResult.Data); - } - else - { - return BadRequest(copyResult.Errors); - } - } - else - { - return NotFound(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Mix.Cms.Api.RestFul.csproj b/src/Mix.Cms.Api.RestFul/Mix.Cms.Api.RestFul.csproj deleted file mode 100644 index d04fba3a0..000000000 --- a/src/Mix.Cms.Api.RestFul/Mix.Cms.Api.RestFul.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - - net5.0 - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Mix.Cms.Api.RestFul/Program.cs b/src/Mix.Cms.Api.RestFul/Program.cs deleted file mode 100644 index 3308f70fa..000000000 --- a/src/Mix.Cms.Api.RestFul/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Mix.Cms.Api.RestFul -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Properties/launchSettings.json b/src/Mix.Cms.Api.RestFul/Properties/launchSettings.json deleted file mode 100644 index 4720a985c..000000000 --- a/src/Mix.Cms.Api.RestFul/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:62963", - "sslPort": 44377 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Mix.Cms.Api.RestFul": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Readme.md b/src/Mix.Cms.Api.RestFul/Readme.md deleted file mode 100644 index b16d7e28b..000000000 --- a/src/Mix.Cms.Api.RestFul/Readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ref - - Generic Basecontroller - https://www.strathweb.com/2018/04/generic-and-dynamically-generated-controllers-in-asp-net-core-mvc/ \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/ServiceCollectionExtensions.cs b/src/Mix.Cms.Api.RestFul/ServiceCollectionExtensions.cs deleted file mode 100644 index fab4d95f9..000000000 --- a/src/Mix.Cms.Api.RestFul/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.OpenApi.Models; - -namespace Mix.Cms.Api.RestFul -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddMixRestApi(this IServiceCollection services) - { - services.AddSwaggerGen(c => - { - c.SwaggerDoc("v1", new OpenApiInfo { Title = "Mixcore API", Version = "v3" }); - c.CustomSchemaIds(x => x.FullName); - }); - return services; - } - - public static IApplicationBuilder UseMixRestApi(this IApplicationBuilder app) - { - // Enable middleware to serve generated Swagger as a JSON endpoint. - app.UseSwagger(); - - // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), - // specifying the Swagger JSON endpoint. - app.UseSwaggerUI(c => - { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "Mixcore API V1"); - }); - - return app; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/Startup.cs b/src/Mix.Cms.Api.RestFul/Startup.cs deleted file mode 100644 index 299789bcf..000000000 --- a/src/Mix.Cms.Api.RestFul/Startup.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Mix.Cms.Lib.Extensions; - -namespace Mix.Cms.Api.RestFul -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers().AddNewtonsoftJson(); - services.AddGenerateApis(); - services.AddMixRestApi(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseHttpsRedirection(); - - app.UseRouting(); - app.UseMixRestApi(); - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api.RestFul/appsettings.Development.json b/src/Mix.Cms.Api.RestFul/appsettings.Development.json deleted file mode 100644 index 45fe774a9..000000000 --- a/src/Mix.Cms.Api.RestFul/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiAccountController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiAccountController.cs deleted file mode 100644 index 23e59ab7e..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiAccountController.cs +++ /dev/null @@ -1,494 +0,0 @@ -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Mix.Cms.Api.Helpers; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.Account; -using Mix.Domain.Core.ViewModels; -using Mix.Identity.Models; -using Mix.Identity.Models.AccountViewModels; -using Mix.Services; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - //[Authorize(Roles = "SuperAdmin,Admin")] - //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [Route("api/v1/account")] - public class ApiAccountController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly RoleManager _roleManager; - private readonly ILogger _logger; - private readonly IdentityHelper _helper; - - public ApiAccountController( - UserManager userManager, - SignInManager signInManager, - RoleManager roleManager, - ILogger logger) - { - _userManager = userManager; - _signInManager = signInManager; - _roleManager = roleManager; - _logger = logger; - _helper = new IdentityHelper(userManager, signInManager, roleManager); - } - - [TempData] - public string ErrorMessage { get; set; } - - // - // POST: /Account/Logout - [Route("Logout")] - [HttpGet, HttpPost, HttpOptions] - public async Task> Logout() - { - var result = new RepositoryResponse() { IsSucceed = true, Data = true }; - await _signInManager.SignOutAsync().ConfigureAwait(false); - await RefreshTokenViewModel.Repository.RemoveModelAsync(r => r.Username == User.Identity.Name); - return result; - } - - [Route("login")] - [HttpPost, HttpOptions] - [AllowAnonymous] - //[ValidateAntiForgeryToken] - public async Task>> Login([FromBody] LoginViewModel model) - { - RepositoryResponse loginResult = new RepositoryResponse(); - if (ModelState.IsValid) - { - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, set lockoutOnFailure: true - var result = await _signInManager.PasswordSignInAsync( - model.UserName, model.Password, isPersistent: model.RememberMe, lockoutOnFailure: true).ConfigureAwait(false); - if (result.Succeeded) - { - var user = await _userManager.FindByNameAsync(model.UserName).ConfigureAwait(false); - - var token = await _helper.GenerateAccessTokenAsync(user, model.RememberMe); - if (token != null) - { - token.Info = new MixUserViewModel(user); - await token.Info.LoadUserDataAsync(); - - loginResult.IsSucceed = true; - loginResult.Status = 1; - loginResult.Data = token; - _logger.LogInformation("User logged in."); - return Ok(loginResult); - } - else - { - return Ok(loginResult); - } - } - if (result.IsLockedOut) - { - loginResult.Errors.Add("This account has been locked out, please try again later."); - return BadRequest(loginResult); - } - else - { - loginResult.Errors.Add("Login failed"); - return BadRequest(loginResult); - } - } - else - { - return BadRequest(loginResult); - } - } - - //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [Route("refresh-token/{refreshTokenId}")] - [HttpGet, HttpOptions] - public async Task> RefreshToken(string refreshTokenId) - { - RepositoryResponse result = new RepositoryResponse(); - var getRefreshToken = await RefreshTokenViewModel.Repository.GetSingleModelAsync(t => t.Id == refreshTokenId); - if (getRefreshToken.IsSucceed) - { - var oldToken = getRefreshToken.Data; - if (oldToken.ExpiresUtc > DateTime.UtcNow) - { - var user = await _userManager.FindByEmailAsync(oldToken.Email); - await _signInManager.SignInAsync(user, true).ConfigureAwait(false); - - var token = await _helper.GenerateAccessTokenAsync(user, true); - if (token != null) - { - await oldToken.RemoveModelAsync(); - - token.Info = new MixUserViewModel(user); - await token.Info.LoadUserDataAsync(); - - result.IsSucceed = true; - result.Status = 1; - result.Data = token; - _logger.LogInformation("User refresh token."); - return result; - } - else - { - result.IsSucceed = false; - result.Data = token; - return result; - } - } - else - { - await oldToken.RemoveModelAsync(); - result.Errors.Add("Token expired"); - return result; - } - } - else - { - result.Errors.Add("Token expired"); - return result; - } - } - - [Route("Register")] - [HttpPost, HttpOptions] - [AllowAnonymous] - public async Task>> Register([FromBody] MixRegisterViewModel model) - { - RepositoryResponse result = new RepositoryResponse(); - if (ModelState.IsValid) - { - var user = new ApplicationUser - { - UserName = model.Username, - Email = model.Email, - FirstName = model.FirstName, - LastName = model.LastName, - Avatar = model.Avatar ?? MixService.GetConfig("DefaultAvatar"), - JoinDate = DateTime.UtcNow - }; - - var createResult = await _userManager.CreateAsync(user, password: model.Password).ConfigureAwait(false); - if (createResult.Succeeded) - { - _logger.LogInformation("User created a new account with password."); - user = await _userManager.FindByNameAsync(model.Username).ConfigureAwait(false); - var token = await _helper.GenerateAccessTokenAsync(user, true); - if (token != null) - { - result.IsSucceed = true; - result.Data = token; - _logger.LogInformation("User logged in."); - return result; - } - else - { - return Ok(result); - } - } - else - { - foreach (var error in createResult.Errors) - { - result.Errors.Add(error.Description); - } - return BadRequest(result); - } - } - - return BadRequest(result); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, - Roles = "SuperAdmin")] - [Route("user-in-role")] - [HttpPost, HttpOptions] - public async Task> ManageUserInRole([FromBody] UserRoleModel model) - { - var role = await _roleManager.FindByIdAsync(model.RoleId); - var result = new RepositoryResponse(); - - List errors = new List(); - - if (role == null) - { - errors.Add($"Role: {model.RoleId} does not exists"); - } - else if (model.IsUserInRole) - { - var appUser = await _userManager.FindByIdAsync(model.UserId); - - if (appUser == null) - { - errors.Add($"User: {model.UserId} does not exists"); - } - else if (!(await _userManager.IsInRoleAsync(appUser, role.Name))) - { - var addResult = await _userManager.AddToRoleAsync(appUser, role.Name); - - if (!addResult.Succeeded) - { - errors.Add($"User: {model.UserId} could not be added to role"); - } - } - } - else - { - var appUser = await _userManager.FindByIdAsync(model.UserId); - - if (appUser == null) - { - errors.Add($"User: {model.UserId} does not exists"); - } - - var removeResult = await _userManager.RemoveFromRoleAsync(appUser, role.Name); - if (!removeResult.Succeeded) - { - errors.Add($"User: {model.UserId} could not be removed from role"); - } - } - result.IsSucceed = errors.Count == 0; - result.Data = errors.Count == 0; - result.Errors = errors; - return result; - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpGet, HttpOptions] - [Route("details/{viewType}/{id}")] - [Route("details/{viewType}")] - public async Task Details(string viewType, string id = null) - { - ApplicationUser user = - string.IsNullOrEmpty(id) - ? new ApplicationUser() - : await _userManager.FindByIdAsync(id); ; - - if (user != null) - { - var mixUser = new MixUserViewModel(user); - await mixUser.LoadUserDataAsync(); - return Ok(new RepositoryResponse() - { - IsSucceed = true, - Data = mixUser - }); - } - return BadRequest(); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpGet, HttpOptions] - [Route("my-profile")] - public async Task> MyProfile() - { - string id = User.Claims.SingleOrDefault(c => c.Type == "Id")?.Value; - ApplicationUser user = await _userManager.FindByIdAsync(id); ; - - if (user != null) - { - var mixUser = new MixUserViewModel(user); - await mixUser.LoadUserDataAsync(); - return Ok(new RepositoryResponse() - { - IsSucceed = true, - Data = mixUser - }); - } - return BadRequest(); - } - - // POST api/template - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save( - [FromBody] MixUserViewModel model) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (model != null && model.User != null) - { - var user = await _userManager.FindByIdAsync(model.User.Id); - user.Email = model.User.Email; - user.FirstName = model.User.FirstName; - user.LastName = model.User.LastName; - user.Avatar = model.User.Avatar; - var updInfo = await _userManager.UpdateAsync(user); - result.IsSucceed = updInfo.Succeeded; - if (result.IsSucceed) - { - var saveData = await model.UserData.SaveModelAsync(true); - result.IsSucceed = saveData.IsSucceed; - result.Errors = saveData.Errors; - result.Exception = saveData.Exception; - } - if (result.IsSucceed && model.IsChangePassword) - { - var changePwd = await _userManager.ChangePasswordAsync(model.User, model.ChangePassword.CurrentPassword, model.ChangePassword.NewPassword); - if (!changePwd.Succeeded) - { - foreach (var err in changePwd.Errors) - { - result.Errors.Add(err.Description); - } - } - else - { - // Remove other token if change password success - var refreshToken = User.Claims.SingleOrDefault(c => c.Type == "RefreshToken")?.Value; - await RefreshTokenViewModel.Repository.RemoveModelAsync(r => r.Id != refreshToken); - } - } - MixFileRepository.Instance.EmptyFolder($"{MixFolders.MixCacheFolder}/Mix/Cms/Lib/ViewModels/Account/MixUsers/_{model.User.Id}"); - return result; - } - return result; - } - - // POST api/account/list - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpPost, HttpOptions] - [Route("list")] - public async Task>> GetList(RequestPaging request) - { - Expression> predicate = model => - (string.IsNullOrWhiteSpace(request.Keyword) - || ( - (EF.Functions.Like(model.UserName, $"%{request.Keyword}%")) - || (EF.Functions.Like(model.FirstName, $"%{request.Keyword}%")) - || (EF.Functions.Like(model.LastName, $"%{request.Keyword}%")) - ) - ) - && (!request.FromDate.HasValue - || (model.JoinDate >= request.FromDate.Value.ToUniversalTime()) - ) - && (!request.ToDate.HasValue - || (model.JoinDate <= request.ToDate.Value.ToUniversalTime()) - ); - - var data = await UserInfoViewModel.Repository.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex) - .ConfigureAwait(false); - if (data.IsSucceed) - { - data.Data.Items.ForEach(a => - { - a.DetailsUrl = MixCmsHelper.GetRouterUrl( - new { action = "profile", a.Id }, Request, Url); - } - ); - } - return data; - } - - [HttpPost, HttpOptions] - [Route("forgot-password")] - public async Task> ForgotPassword([FromBody] Mix.Identity.Models.AccountViewModels.ForgotPasswordViewModel model) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (string.IsNullOrEmpty(model.Email)) - { - result.IsSucceed = false; - result.Data = "Invalid Email"; - result.Errors.Add("Invalid Email"); - return result; - } - - var user = await _userManager.FindByEmailAsync(model.Email); - if (user == null) - { - result.IsSucceed = false; - result.Data = "Email Not Exist"; - result.Errors.Add("Email Not Exist"); - return result; - } - - //if (!await _userManager.IsEmailConfirmedAsync(user)) - // result.Data = "Invalid Email"; - - var confrimationCode = - await _userManager.GeneratePasswordResetTokenAsync(user); - - var callbackurl = $"{Request.Scheme}://{Request.Host}/security/reset-password/?token={System.Web.HttpUtility.UrlEncode(confrimationCode)}"; - var getEdmTemplate = await Lib.ViewModels.MixTemplates.ReadViewModel.Repository.GetSingleModelAsync( - m => m.FolderType == MixTemplateFolders.Edms && m.FileName == "ForgotPassword"); - string content = callbackurl; - if (getEdmTemplate.IsSucceed) - { - content = getEdmTemplate.Data.Content.Replace("[URL]", callbackurl); - } - MixService.SendMail( - to: user.Email, - subject: "Reset Password", - message: content); - - return result; - } - - [HttpPost] - [Route("reset-password")] - public async Task> ResetPassword([FromBody] Mix.Identity.Models.AccountViewModels.ResetPasswordViewModel model) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var user = await _userManager.FindByEmailAsync(model.Email); - if (user == null) - { - result.IsSucceed = false; - result.Data = "Invalid User"; - return result; - } - string code = System.Web.HttpUtility.UrlDecode(model.Code).Replace(' ', '+'); - var idRresult = await _userManager.ResetPasswordAsync( - user, model.Code, model.Password); - result.IsSucceed = idRresult.Succeeded; - foreach (var err in idRresult.Errors) - { - result.Errors.Add($"{err.Code}: {err.Description}"); - } - - return result; - } - - [HttpGet] - [Authorize(Roles = "SuperAdmin")] - [Route("remove-user/{id}")] - public async Task> RemoveUser(string id) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var user = await _userManager.FindByIdAsync(id); - if (user == null) - { - result.IsSucceed = false; - result.Data = "Invalid User"; - return result; - } - var idRresult = await _userManager.DeleteAsync(user); - result.IsSucceed = idRresult.Succeeded; - if (idRresult.Succeeded) - { - await UserInfoViewModel.Repository.RemoveModelAsync(u => u.Id == id); - } - foreach (var err in idRresult.Errors) - { - result.Errors.Add($"{err.Code}: {err.Description}"); - } - - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiConfigurationController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiConfigurationController.cs deleted file mode 100644 index 510345448..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiConfigurationController.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixConfigurations; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/configuration")] - public class ApiConfigurationController : - BaseGenericApiController - { - public ApiConfigurationController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) - : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/configuration/keyword - [HttpGet, HttpOptions] - [Route("delete/{keyword}")] - public async Task> DeleteAsync(string keyword) - { - var result = await base.DeleteAsync( - model => model.Keyword == keyword && model.Specificulture == _lang, true); - if (result.IsSucceed) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - } - return result; - } - - // GET api/configurations/keyword - [HttpGet, HttpOptions] - [Route("details/{keyword}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, string keyword) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (!string.IsNullOrEmpty(keyword)) - { - Expression> predicate = model => model.Keyword == keyword && model.Specificulture == _lang; - var portalResult = await base.GetSingleAsync($"{viewType}_{keyword}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixConfiguration() - { - Specificulture = _lang, - Category = "Site", - Status = MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (!string.IsNullOrEmpty(keyword)) - { - var beResult = await ReadMvcViewModel.Repository.GetSingleModelAsync(model => model.Keyword == keyword && model.Specificulture == _lang).ConfigureAwait(false); - return Ok(JObject.FromObject(beResult)); - } - else - { - var model = new MixConfiguration(); - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true, - Data = new ReadMvcViewModel(model) - { - Specificulture = _lang, - Status = MixContentStatus.Preview, - } - }; - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/configuration - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel model) - { - var result = await base.SaveAsync(model, true); - if (result.IsSucceed) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - // GET api/configuration - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - model.Specificulture == _lang - && (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.Keyword.Contains(request.Keyword) - || model.Description.Contains(request.Keyword))) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - switch (request.Key) - { - case "mvc": - var mvcResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(mvcResult)); - - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiCultureController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiCultureController.cs deleted file mode 100644 index d52d2dd4e..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiCultureController.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/culture")] - [Route("api/v1/{culture}/culture")] - public class ApiCultureController : - BaseGenericApiController - { - public ApiCultureController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/culture/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - var result = await base.DeleteAsync( - model => model.Id == id, true); - if (result.IsSucceed) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - } - return result; - } - - // GET api/cultures/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixCulture() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixCulture() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/culture - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel model) - { - if (model != null) - { - model.CreatedBy = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - // Only savesubmodels when create new => clone data from default culture - var result = await base.SaveAsync(model, model.Id == 0); - if (result.IsSucceed) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - } - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/culture - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.FullName.Contains(request.Keyword)) - ) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - switch (request.Key) - { - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiFileController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiFileController.cs deleted file mode 100644 index c78495403..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiFileController.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels; -using Mix.Domain.Core.ViewModels; -using Mix.Services; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/file")] - public class ApiFileController : BaseApiController - { - public ApiFileController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Post - - // Post api/files/id - [HttpGet, HttpOptions] - [Route("details")] - public RepositoryResponse Details(string folder, string filename) - { - // Request: Key => folder, Keyword => filename - if (!string.IsNullOrEmpty(folder)) - { - var file = MixFileRepository.Instance.GetFile(filename, folder); - - return new RepositoryResponse() - { - IsSucceed = file != null, - Data = file - }; - } - else - { - return new RepositoryResponse(); - } - } - - // GET api/files/id - [HttpGet, HttpOptions] - [Route("delete")] - public RepositoryResponse Delete() - { - string fullPath = Request.Query["fullPath"].ToString(); - var result = MixFileRepository.Instance.DeleteFile(fullPath); - return new RepositoryResponse() - { - IsSucceed = result, - Data = result - }; - } - - // POST api/values - /// - /// Uploads the image. - /// - /// The img information. - /// Ex: { "base64": "", "fileFolder":"" } - /// - [Route("upload-file")] - [HttpPost, HttpOptions] - public IActionResult Upload([FromForm] string folder, [FromForm] IFormFile file) - { - if (ModelState.IsValid) - { - var result = MixFileRepository.Instance.SaveFile(file, $"{folder}"); - return Ok(result); - } - return BadRequest(); - } - - // POST api/files - [HttpPost, HttpOptions] - [Route("save")] - public RepositoryResponse Save([FromBody] FileViewModel model) - { - if (model != null) - { - var result = MixFileRepository.Instance.SaveFile(model); - return new RepositoryResponse() - { - IsSucceed = result, - Data = model - }; - } - return new RepositoryResponse(); - } - - // GET api/files - - [HttpPost, HttpOptions] - [Route("list")] - public RepositoryResponse GetList([FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - var files = MixFileRepository.Instance.GetTopFiles(request.Key); - var directories = MixFileRepository.Instance.GetTopDirectories(request.Key); - return new RepositoryResponse() - { - IsSucceed = true, - Data = new FilePageViewModel() - { - Files = files, - Directories = directories - } - }; - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiInitCmsController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiInitCmsController.cs deleted file mode 100644 index aaddc38ef..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiInitCmsController.cs +++ /dev/null @@ -1,270 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Api.Helpers; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.Account; -using Mix.Cms.Lib.ViewModels.MixInit; -using Mix.Domain.Core.ViewModels; -using Mix.Identity.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/init")] - public class ApiInitCmsController : - BaseApiController - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly RoleManager _roleManager; - private readonly IdentityHelper _idHelper; - - public ApiInitCmsController( - UserManager userManager, - SignInManager signInManager, - RoleManager roleManager, - Microsoft.AspNetCore.SignalR.IHubContext hubContext, - IMemoryCache memoryCache - ) - : base(null, memoryCache, hubContext) - { - _userManager = userManager; - _signInManager = signInManager; - _roleManager = roleManager; - _idHelper = new IdentityHelper(userManager, signInManager, roleManager); - } - - #region Post - - /// - /// Step 1 when status = 0 - /// - Init Cms Database - /// - Init Account Database - /// - Init Selected Culture as default - /// - Init Menu Positions - /// - /// - /// - [HttpPost, HttpOptions] - [Route("init-cms/step-1")] - public async Task> Step1([FromBody] InitCmsViewModel model) - { - if (model != null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (MixService.GetConfig("InitStatus") == 0) - { - result = await InitStep1Async(model).ConfigureAwait(false); - } - return result; - } - return new RepositoryResponse(); - } - - /// - /// Step 2 when status = 1 - /// - Init SuperAdmin - /// - /// - /// - [HttpPost, HttpOptions] - [Route("init-cms/step-2")] - public async Task> InitSuperAdmin([FromBody] MixRegisterViewModel model) - { - RepositoryResponse result = new RepositoryResponse(); - if (ModelState.IsValid) - { - if (_userManager.Users.Count() == 0) - { - var user = new ApplicationUser - { - UserName = model.Username, - Email = model.Email, - FirstName = model.FirstName, - LastName = model.LastName, - Avatar = model.Avatar ?? MixService.GetConfig("DefaultAvatar"), - JoinDate = DateTime.UtcNow - }; - var createResult = await _userManager.CreateAsync(user, password: model.Password).ConfigureAwait(false); - if (createResult.Succeeded) - { - user = await _userManager.FindByEmailAsync(model.Email).ConfigureAwait(false); - await _userManager.AddToRoleAsync(user, "SuperAdmin"); - var token = await _idHelper.GenerateAccessTokenAsync(user, true); - if (token != null) - { - result.IsSucceed = true; - MixService.LoadFromDatabase(); - MixService.SetConfig("InitStatus", 2); - MixService.SaveSettings(); - MixService.Reload(); - result.Data = token; - return result; - } - else - { - return result; - } - } - else - { - foreach (var error in createResult.Errors) - { - result.Errors.Add(error.Description); - } - return result; - } - } - } - - return result; - } - - // /// - // /// Step 3 Run when status = 2 - // /// - Init Cms Configurations from files data/configuration.json - // /// - // /// - // /// - // [HttpPost, HttpOptions] - // [Route("init-cms/step-5")] - // public async Task> InitConfigurations([FromBody]List model) - // { - // if (model != null) - // { - // var result = new RepositoryResponse(); - // if (MixService.GetConfig("InitStatus") == 4) - // { - // string culture = MixService.GetConfig("DefaultCulture"); - // InitCmsService sv = new InitCmsService(); - // result = await sv.InitConfigurationsAsync(culture, model); - // if (result.IsSucceed) - // { - // MixService.LoadFromDatabase(); - // MixService.SetConfig("InitStatus", 5); - // MixService.SaveSettings(); - // MixService.Reload(); - // } - // } - // return result; - // } - // return new RepositoryResponse(); - // } - - /// - /// Step 4 when status = 3 - /// - Init Languages for translate from languages.json - /// - /// - /// - [HttpPost, HttpOptions] - [Route("init-cms/step-4")] - public async Task> InitLanguages([FromBody] List model) - { - if (model != null) - { - var result = new RepositoryResponse(); - if (MixService.GetConfig("InitStatus") == 3) - { - string culture = MixService.GetConfig("DefaultCulture"); - InitCmsService sv = new InitCmsService(); - result = await sv.InitLanguagesAsync(culture, model); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SetConfig("InitStatus", 4); - MixService.SetConfig("IsInit", true); - MixService.SaveSettings(); - _ = Services.MixCacheService.RemoveCacheAsync(); - MixService.Reload(); - } - } - return result; - } - return new RepositoryResponse(); - } - - /// - /// Step 5 when status = 4 (Finished) - /// - Init default theme - /// - /// - /// - [HttpPost, HttpOptions] - [Route("init-cms/step-3")] - //[RequestFormSizeLimit(valueCountLimit: 214748364)] // 200Mb - [DisableRequestSizeLimit] - public async Task> Save([FromForm] string model, [FromForm] IFormFile assets, [FromForm] IFormFile theme) - { - string user = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - return await Mix.Cms.Lib.ViewModels.MixThemes.Helper.InitTheme(model, user, _lang, assets, theme); - } - - #endregion Post - - #region Helpers - - private async Task> InitStep1Async(InitCmsViewModel model) - { - MixService.SetConnectionString(MixConstants.CONST_CMS_CONNECTION, model.ConnectionString); - MixService.SetConnectionString(MixConstants.CONST_MESSENGER_CONNECTION, model.ConnectionString); - MixService.SetConnectionString(MixConstants.CONST_ACCOUNT_CONNECTION, model.ConnectionString); - MixService.SetConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER, model.DatabaseProvider.ToString()); - MixService.SetConfig(MixConstants.CONST_SETTING_LANGUAGE, model.Culture.Specificulture); - MixService.SaveSettings(); - var result = await InitCmsService.InitCms(model.SiteName, model.Culture); - - if (result.IsSucceed) - { - await InitRolesAsync(); - result.IsSucceed = true; - MixService.LoadFromDatabase(); - MixService.SetConfig("DefaultCulture", model.Culture.Specificulture); - MixService.SetConfig("InitStatus", 1); - MixService.SaveSettings(); - //MixService.Reload(); - } - else - { - // if cannot init cms - // => reload from default settings - // => save to appSettings - MixService.Reload(); - MixService.SaveSettings(); - } - return result; - } - - private async Task InitRolesAsync() - { - bool isSucceed = true; - var getRoles = await RoleViewModel.Repository.GetModelListAsync(); - if (getRoles.IsSucceed && getRoles.Data.Count == 0) - { - var saveResult = await _roleManager.CreateAsync(new IdentityRole() - { - Id = Guid.NewGuid().ToString(), - Name = "SuperAdmin" - }); - isSucceed = saveResult.Succeeded; - } - return isSucceed; - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiMediaController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiMediaController.cs deleted file mode 100644 index 432491773..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiMediaController.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixMedias; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Route("api/v1/{culture}/media")] - public class ApiMediaController : - BaseGenericApiController - { - public ApiMediaController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/media/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id && model.Specificulture == _lang, true); - } - - // GET api/medias/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - default: - if (id.HasValue) - { - var beResult = await UpdateViewModel.Repository.GetSingleModelAsync(model => model.Id == id && model.Specificulture == _lang).ConfigureAwait(false); - return Ok(JObject.FromObject(beResult)); - } - else - { - var model = new MixMedia(); - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true, - Data = new UpdateViewModel(model) - { - Specificulture = _lang, - Status = MixContentStatus.Published, - } - }; - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/media - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromForm] string model, [FromForm] IFormFile file) - { - if (model != null) - { - var json = JObject.Parse(model); - var data = json.ToObject(); - data.Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus); - data.Specificulture = _lang; - data.File = file; - var result = await base.SaveAsync(data, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - [HttpPost, HttpOptions] - [Route("upload-media")] - public async Task> UploadMedia([FromForm] IFormFile file) - { - if (file != null) - { - var data = new UpdateViewModel() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Specificulture = _lang, - FileFolder = $"{MixService.GetTemplateUploadFolder(_lang)}", - File = file - }; - var result = await base.SaveAsync(data, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/media - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - var parsed = HttpUtility.ParseQueryString(request.Query ?? ""); - bool isLevel = int.TryParse(parsed.Get("level"), out int level); - ParseRequestPagingDate(request); - Expression> predicate = model => - model.Specificulture == _lang - && (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.Title.Contains(request.Keyword) - || model.Description.Contains(request.Keyword))) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - switch (request.Key) - { - default: - var portalResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(portalResult)); - } - } - - // POST api/update-infos - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - #endregion Post - - #region Helpers - - /// - /// Uploads the file asynchronous. - /// - /// The file. - /// The folder path. - /// - [HttpPost] - [Route("media/upload")] - protected async Task UploadFileAsync(IFormFile file, string folderPath) - { - if (file?.Length > 0) - { - string fileName = await CommonHelper.UploadFileAsync(folderPath, file).ConfigureAwait(false); - if (!string.IsNullOrEmpty(fileName)) - { - string filePath = string.Format("{0}/{1}", folderPath, fileName); - return filePath; - } - else - { - return string.Empty; - } - } - else - { - return string.Empty; - } - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseColumnController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseColumnController.cs deleted file mode 100644 index 0d38adf3b..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseColumnController.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Attributes; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixDatabaseColumns; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/mix-database-column")] - public class ApiMixDatabaseColumnController : - BaseGenericApiController - { - public ApiMixDatabaseColumnController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/mix-database-column/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id, true); - } - - // GET api/mix-database-columns/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixDatabaseColumn() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var result = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(result)); - } - else - { - var model = new MixDatabaseColumn() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - // GET api/module-data/create/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("init-form/{setId}")] - public async Task>> InitByName(int setId) - { - return await UpdateViewModel.Repository.GetModelListByAsync( - m => m.MixDatabaseId == setId).ConfigureAwait(false); - } - - #endregion Get - - #region Post - - // POST api/mix-database-column - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [RequestFormSizeLimit(valueCountLimit: 214748364)] // 200Mb - [Route("save")] - public async Task> Save(UpdateViewModel data) - { - if (data != null) - { - data.Specificulture = _lang; - var result = await base.SaveAsync(data, true); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/mix-database-column - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - (string.IsNullOrWhiteSpace(request.Keyword) - || (EF.Functions.Like(model.Name, $"%{request.Keyword}%")) - ); - switch (request.Key) - { - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseController.cs deleted file mode 100644 index c530b86be..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseController.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixDatabases; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/mix-database")] - public class ApiMixDatabaseController : - BaseGenericApiController - { - public ApiMixDatabaseController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/mix-database/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id, true); - } - - // GET api/mix-databases/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{name}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, string name, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue || !string.IsNullOrEmpty(name)) - { - Expression> predicate = model => (model.Id == id || model.Name == name); - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixDatabase() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue || !string.IsNullOrEmpty(name)) - { - Expression> predicate = model => model.Id == id || model.Name == name; - var result = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(result)); - } - else - { - var model = new MixDatabase() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/mix-database - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel data) - { - if (data != null) - { - data.Specificulture = _lang; - var result = await base.SaveAsync(data, true); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/mix-database - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - (string.IsNullOrWhiteSpace(request.Keyword) - || (EF.Functions.Like(model.Name, $"%{request.Keyword}%")) - || (EF.Functions.Like(model.Title, $"%{request.Keyword}%")) - ) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ) - ; - switch (request.Key) - { - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseDataController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseDataController.cs deleted file mode 100644 index 0c7fe1147..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiMixDatabaseDataController.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Models.Cms; -using Newtonsoft.Json.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/mix-database-data")] - public class ApiMixDatabaseDataController : - BaseApiController - { - public ApiMixDatabaseDataController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/attribute-datas/id - [HttpGet, HttpOptions] - [Route("details/{type}/{setId}/{id}/{viewType}")] - [Route("details/{type}/{setId}/{viewType}")] - public async Task> Details(int setId, string type, string viewType, string id) - { - string msg = string.Empty; - switch (type) - { - case "post": - return await GetPostDataAsync(setId, viewType, id); - - case "module": - break; - - case "page": - break; - - default: - break; - } - return BadRequest(); - } - - private async Task> GetPostDataAsync(int setId, string viewType, string id) - { - return await Task.FromResult(new JObject()); - //switch (viewType) - //{ - // case "portal": - // if (!string.IsNullOrEmpty(id)) - // { - // var result = new Lib.ViewModels.MixPostAttributeDatas.UpdateViewModel(setId); - // return Ok(JObject.FromObject(result)); - // } - // else - // { - // var model = new MixPostAttributeData() - // { - // Status = MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus), - // MixDatabaseId = setId, - // Specificulture = _lang, - // Priority = Lib.ViewModels.MixPostAttributeDatas.UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - // }; - - // RepositoryResponse result = - // await base.GetSingleAsync($"{viewType}_default", null, model); - // return Ok(JObject.FromObject(result)); - // } - // default: - // if (!string.IsNullOrEmpty(id)) - // { - // Expression> predicate = model => model.Id == id; - // var result = await base.GetSingleAsync( - // $"{viewType}_{id}", predicate); - // return Ok(JObject.FromObject(result)); - // } - // else - // { - // var model = new MixPostAttributeData() - // { - // Status = MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus) - // , - // Priority = Lib.ViewModels.MixPostAttributeDatas.UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - // }; - - // RepositoryResponse result = await base.GetSingleAsync( - // $"{viewType}_default", null, model); - // return Ok(JObject.FromObject(result)); - // } - //} - } - - #endregion Get - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiModuleController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiModuleController.cs deleted file mode 100644 index 35c087981..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiModuleController.cs +++ /dev/null @@ -1,244 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels; -using Mix.Cms.Lib.ViewModels.MixModules; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/module")] - public class ApiModuleController : - BaseGenericApiController - { - public ApiModuleController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/module/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id && model.Specificulture == _lang, true); - } - - // GET api/modules/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue) - { - Expression> predicate = model => model.Id == id && model.Specificulture == _lang; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixModule() - { - Specificulture = _lang, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue) - { - var beResult = await ReadMvcViewModel.Repository.GetSingleModelAsync(model => model.Id == id && model.Specificulture == _lang).ConfigureAwait(false); - if (beResult.IsSucceed) - { - beResult.Data.LoadData(); - } - return Ok(JObject.FromObject(beResult)); - } - else - { - var model = new MixModule(); - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true, - Data = new ReadMvcViewModel(model) - { - Specificulture = _lang, - Status = MixContentStatus.Preview, - } - }; - - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/module - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel model) - { - if (model != null) - { - model.CreatedBy = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - var result = await base.SaveAsync(model, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // POST api/module - [HttpPost, HttpOptions] - [Route("save/{id}")] - public async Task> SaveFields(int id, [FromBody] List fields) - { - if (fields != null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var property in fields) - { - if (result.IsSucceed) - { - result = await ReadListItemViewModel.Repository.UpdateFieldsAsync(c => c.Id == id && c.Specificulture == _lang, fields).ConfigureAwait(false); - } - else - { - break; - } - } - return result; - } - return new RepositoryResponse(); - } - - // POST api/module - [HttpPost, HttpOptions] - [Route("data/save/{name}/{formName}")] - public async Task> SaveData(string name, string formName, [FromBody] JObject obj) - { - // Get module by name - string _username = User?.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - var result = await UpdateViewModel.SaveByModuleName(_lang, _username, name, formName, obj); - if (result.IsSucceed) - { - return Ok(result); - } - else - { - return BadRequest(result); - } - } - - // GET api/module - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - var query = HttpUtility.ParseQueryString(request.Query ?? ""); - bool isType = int.TryParse(query.Get("type"), out int moduleType) && moduleType >= 0; - ParseRequestPagingDate(request); - Expression> predicate = model => - model.Specificulture == _lang - && (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (!isType || model.Type == moduleType) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (EF.Functions.Like(model.Name, $"%{request.Keyword}%")) - || (EF.Functions.Like(model.Title, $"%{request.Keyword}%")) - || (EF.Functions.Like(model.Description, $"%{request.Keyword}%")) - ) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - switch (request.Key) - { - case "mvc": - var mvcResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(mvcResult)); - - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - return JObject.FromObject(listItemResult); - } - } - - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - [HttpPost, HttpOptions] - [Route("apply-list")] - public async Task> ListActionAsync([FromBody] ListAction data) - { - Expression> predicate = model => - model.Specificulture == _lang - && data.Data.Contains(model.Id); - var result = new RepositoryResponse(); - switch (data.Action) - { - case "Delete": - return Ok(JObject.FromObject(await base.DeleteListAsync(predicate, true))); - - case "Export": - return Ok(JObject.FromObject(await base.ExportListAsync(predicate, MixStructureType.Module))); - - default: - return JObject.FromObject(new RepositoryResponse()); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiModuleDataController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiModuleDataController.cs deleted file mode 100644 index 3d2d2b873..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiModuleDataController.cs +++ /dev/null @@ -1,329 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixModuleDatas; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/module-data")] - public class ApiModuleDataController : - BaseGenericApiController - { - public ApiModuleDataController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - // GET api/module-data/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("details/{viewType}/{moduleId}/{id}")] - [Route("details/{viewType}/{moduleId}")] - public async Task> DetailsAsync(string viewType, int moduleId, string id = null) - { - if (string.IsNullOrEmpty(id)) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Id == moduleId && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var model = new MixModuleData( - ) - { - ModuleId = moduleId, - Specificulture = _lang, - Fields = getModule.Data.Fields, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - }; - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - - return result; - } - else - { - return new RepositoryResponse() { IsSucceed = false }; - } - } - else - { - Expression> predicate = model => model.Id == id && model.Specificulture == _lang; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return portalResult; - } - } - - // GET api/module-data/id - [HttpGet, HttpOptions] - [Route("edit/{id}")] - public Task> Edit(string id) - { - return base.GetSingleAsync($"read_{id}", model => model.Id == id && model.Specificulture == _lang); - } - - // GET api/module-data/create/id - [HttpGet, HttpOptions] - [Route("create/{moduleId}")] - public async Task> CreateAsync(int moduleId) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Id == moduleId && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var ModuleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = moduleId, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - return new RepositoryResponse() - { - IsSucceed = true, - Data = ModuleData - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - - // GET api/module-data/create/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("init-by-name/{moduleName}")] - public async Task> InitByName(string moduleName) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Name == moduleName && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var moduleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - return new RepositoryResponse() - { - IsSucceed = true, - Data = moduleData - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - - // GET api/module-data/create/id - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("save/{moduleName}")] - public async Task> SaveByName(string moduleName, [FromBody] JObject data) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Name == moduleName && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var moduleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - foreach (var item in moduleData.DataProperties) - { - moduleData.JItem[item.Name]["value"] = data[item.Name]?.Value(); - } - return await moduleData.SaveModelAsync(); - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - - // GET api/module-data/create/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("init/{moduleId}")] - public async Task> InitByIdAsync(int moduleId) - { - var getModule = await Lib.ViewModels.MixModules.ReadListItemViewModel.Repository.GetSingleModelAsync( - m => m.Id == moduleId && m.Specificulture == _lang).ConfigureAwait(false); - if (getModule.IsSucceed) - { - var ModuleData = new UpdateViewModel( - new MixModuleData() - { - ModuleId = getModule.Data.Id, - Specificulture = _lang, - Fields = getModule.Data.Fields - }); - return new RepositoryResponse() - { - IsSucceed = true, - Data = ModuleData - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Data = null, - Exception = getModule.Exception, - Errors = getModule.Errors - }; - } - } - - // GET api/module-data/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(string id) - { - return await base.DeleteAsync(model => model.Id == id && model.Specificulture == _lang); - } - - #region Post - - // POST api/moduleData - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Post([FromBody] UpdateViewModel data) - { - return await base.SaveAsync(data, true); - } - - // GET api/moduleData - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("export")] - public async Task>>> ExportData( - [FromBody] RequestPaging request) - { - var query = HttpUtility.ParseQueryString(request.Query ?? ""); - int.TryParse(query.Get("module_id"), out int moduleId); - int.TryParse(query.Get("post_id"), out int postId); - int.TryParse(query.Get("category_id"), out int pageId); - string key = $"{request.Key}_{request.PageSize}_{request.PageIndex}"; - - Expression> predicate = model => - model.Specificulture == _lang - && model.ModuleId == moduleId - && (string.IsNullOrEmpty(request.Keyword) || model.Value.Contains(request.Keyword)) - && (postId == 0 || model.PostId == postId) - && (pageId == 0 || model.PageId == pageId) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value.ToUniversalTime()) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value.ToUniversalTime()) - ); - - var portalResult = await base.GetListAsync(request, predicate); - //foreach (var item in portalResult.Data.Items) - //{ - // item.JItem["created_date"] = new JObject() - // { - // new JProperty("dataType", 1), - // new JProperty("value", item.CreatedDateTime.ToLocalTime().ToString("dd-MM-yyyy hh:mm:ss")) - // }; - // portalResult.Data.JsonItems.Add(item.JItem); - //} - - //string exportPath = $"Exports/Module/{moduleId}"; - //var result = CommonHelper.ExportJObjectToExcel(portalResult.Data.JsonItems, string.Empty, exportPath, Guid.NewGuid().ToString(), null); - return Ok(JObject.FromObject(portalResult)); - } - - // GET api/moduleData - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("list")] - public async Task>>> GetList( - [FromBody] RequestPaging request, int? level = 0) - { - var query = HttpUtility.ParseQueryString(request.Query ?? ""); - int.TryParse(query.Get("module_id"), out int moduleId); - int.TryParse(query.Get("post_id"), out int postId); - int.TryParse(query.Get("product_id"), out int productId); - int.TryParse(query.Get("category_id"), out int pageId); - - string key = $"{request.Key}_{request.PageSize}_{request.PageIndex}"; - Expression> predicate = model => - model.Specificulture == _lang - && model.ModuleId == moduleId - && (string.IsNullOrEmpty(request.Keyword) || model.Value.Contains(request.Keyword)) - && (postId == 0 || model.PostId == postId) - && (pageId == 0 || model.PageId == pageId) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value.ToUniversalTime()) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value.ToUniversalTime()) - ) - ; - var portalResult = await base.GetListAsync(request, predicate); - - return Ok(JObject.FromObject(portalResult)); - } - - // POST api/PortalPage - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - await MixCacheService.RemoveCacheAsync(); - return await ReadViewModel.UpdateInfosAsync(models); - } - else - { - return new RepositoryResponse>(); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiModulePostController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiModulePostController.cs deleted file mode 100644 index 838a9f027..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiModulePostController.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixModulePosts; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/module-post")] - [ApiExplorerSettings(IgnoreApi = false, GroupName = nameof(ApiModulePostController))] - public class ApiModulePostController : - BaseGenericApiController - { - public ApiModulePostController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/module/id - [HttpGet, HttpOptions] - [Route("delete/{moduleId}/{postId}")] - public async Task> DeleteAsync(int moduleId, int postId) - { - return await base.DeleteAsync( - model => model.PostId == postId && model.ModuleId == moduleId && model.Specificulture == _lang, true); - } - - // GET api/modules/id - [HttpGet, HttpOptions] - [Route("detail/{moduleId}/{postId}/{viewType}")] - public async Task> Details(string viewType, int? moduleId, int? postId) - { - string msg = string.Empty; - switch (viewType) - { - default: - if (moduleId.HasValue && postId.HasValue) - { - Expression> predicate = model => model.ModuleId == moduleId && model.PostId == postId && model.Specificulture == _lang; - var portalResult = await base.GetSingleAsync($"{viewType}_{moduleId}_{postId}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixModulePost() - { - Specificulture = _lang, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/module - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] ReadViewModel model) - { - if (model != null) - { - var result = await base.SaveAsync(model, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // POST api/module - [HttpPost, HttpOptions] - [Route("save/{id}/{postId}")] - public async Task> SaveFields(int moduleId, int postId, [FromBody] List fields) - { - if (fields != null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var property in fields) - { - if (result.IsSucceed) - { - result = await ReadViewModel.Repository.UpdateFieldsAsync(c => c.ModuleId == moduleId && c.PostId == postId && c.Specificulture == _lang, fields).ConfigureAwait(false); - } - else - { - break; - } - } - return result; - } - return new RepositoryResponse(); - } - - // GET api/module - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - var query = HttpUtility.ParseQueryString(request.Query ?? ""); - bool isModule = int.TryParse(query.Get("module_id"), out int moduleId); - bool isPost = int.TryParse(query.Get("post_id"), out int postId); - ParseRequestPagingDate(request); - Expression> predicate = model => - model.Specificulture == _lang - && (!isModule || model.ModuleId == moduleId) - && (!isPost || model.PostId == postId) - && (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.Description.Contains(request.Keyword) - )) - ; - string key = $"{request.Key}_{request.Query}_{request.PageSize}_{request.PageIndex}"; - switch (request.Key) - { - default: - - var listItemResult = await base.GetListAsync(request, predicate); - return JObject.FromObject(listItemResult); - } - } - - // POST api/update-infos - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - // POST api/update-infos - [HttpPost, HttpOptions] - [Route("save-list")] - public async Task>> SaveList([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiPagePostController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiPagePostController.cs deleted file mode 100644 index b60ec02fc..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiPagePostController.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixPagePosts; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/page-post")] - [ApiExplorerSettings(IgnoreApi = false, GroupName = nameof(ApiPagePostController))] - public class ApiPagePostController : - BaseGenericApiController - { - public ApiPagePostController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/page/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id && model.Specificulture == _lang, true); - } - - // GET api/pages/id - [HttpGet, HttpOptions] - [Route("detail/{pageId}/{postId}/{viewType}")] - public async Task> Details(string viewType, int? pageId, int? postId) - { - string msg = string.Empty; - switch (viewType) - { - default: - if (pageId.HasValue && postId.HasValue) - { - Expression> predicate = model => model.PageId == pageId && model.PostId == postId && model.Specificulture == _lang; - var portalResult = await base.GetSingleAsync($"{viewType}_{pageId}_{postId}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixPagePost() - { - Specificulture = _lang, - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/page - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] ReadViewModel model) - { - if (model != null) - { - var result = await base.SaveAsync(model, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // POST api/page - [HttpPost, HttpOptions] - [Route("save/{id}/{postId}")] - public async Task> SaveFields(int pageId, int postId, [FromBody] List fields) - { - if (fields != null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var property in fields) - { - if (result.IsSucceed) - { - result = await ReadViewModel.Repository.UpdateFieldsAsync(c => c.PageId == pageId && c.PostId == postId && c.Specificulture == _lang, fields).ConfigureAwait(false); - } - else - { - break; - } - } - return result; - } - return new RepositoryResponse(); - } - - // GET api/page - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - var query = HttpUtility.ParseQueryString(request.Query ?? ""); - bool isPage = int.TryParse(query.Get("page_id"), out int pageId); - bool isPost = int.TryParse(query.Get("post_id"), out int postId); - ParseRequestPagingDate(request); - Expression> predicate = model => - model.Specificulture == _lang - && (!isPage || model.PageId == pageId) - && (!isPost || model.PostId == postId) - && (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.Description.Contains(request.Keyword) - )) - ; - switch (request.Key) - { - default: - var listItemResult = await base.GetListAsync(request, predicate); - listItemResult.Data.Items.ForEach(n => - { - n.IsActived = true; - n.LoadPost(); - }); - return JObject.FromObject(listItemResult); - } - } - - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - // POST api/update-infos - [HttpPost, HttpOptions] - [Route("save-list")] - public async Task>> SaveList([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false); - } - else - { - return new RepositoryResponse>(); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiPermissionController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiPermissionController.cs deleted file mode 100644 index a35e6284c..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiPermissionController.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixPortalPages; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using System.Web; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/permission")] - public class ApiPermissionController : - BaseGenericApiController - { - public ApiPermissionController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/portalPage/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id, true); - } - - // GET api/portalPages/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixPortalPage() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixPortalPage() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/portalPage - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel model) - { - if (model != null) - { - model.CreatedBy = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - var result = await base.SaveAsync(model, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/portalPage - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - var parsed = HttpUtility.ParseQueryString(request.Query ?? ""); - bool isLevel = int.TryParse(parsed.Get("level"), out int level); - ParseRequestPagingDate(request); - Expression> predicate = model => - (!isLevel || model.Level == level) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.TextDefault.Contains(request.Keyword) - || model.Description.Contains(request.Keyword))) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - switch (request.Key) - { - default: - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - } - } - - // POST api/PortalPage - [HttpPost, HttpOptions] - [Route("update-infos")] - public async Task>> UpdateInfos([FromBody] List models) - { - if (models != null) - { - return await base.SaveListAsync(models, false);// ReadViewModel.UpdateInfosAsync(models); - } - else - { - return new RepositoryResponse>(); - } - } - - // POST api/PortalPage - [HttpPost, HttpOptions] - [Route("update-child-infos")] - public RepositoryResponse> UpdateNavInfos([FromBody] List models) - { - if (models != null) - { - // TODO Handle save fields - //return await Lib.ViewModels.MixPortalPagePortalPages.ReadViewModel.UpdateInfosAsync(models); - return new RepositoryResponse>(); - } - else - { - return new RepositoryResponse>(); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiPortalController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiPortalController.cs deleted file mode 100644 index 5ee1778fd..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiPortalController.cs +++ /dev/null @@ -1,509 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Heart.Helpers; -using Mix.Identity.Models; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/portal")] - public class ApiPortalController : - BaseApiController - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly RoleManager _roleManager; - - public ApiPortalController( - UserManager userManager, - SignInManager signInManager, - RoleManager roleManager, - MixCmsContext context, - Microsoft.AspNetCore.SignalR.IHubContext hubContext, - IMemoryCache memoryCache - ) - : base(context, memoryCache, hubContext) - { - _userManager = userManager; - _signInManager = signInManager; - _roleManager = roleManager; - } - - #region Get - - // GET api/category/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("{culture}/settings")] - [Route("settings")] - public RepositoryResponse Settings() - { - var cultures = CommonRepository.Instance.LoadCultures(); - var culture = cultures.FirstOrDefault(c => c.Specificulture == _lang); - GlobalSettingsViewModel settings = new GlobalSettingsViewModel() - { - Domain = MixService.GetConfig(MixAppSettingKeywords.Domain), - Lang = _lang, - PortalThemeSettings = MixService.GetConfig(MixAppSettingKeywords.PortalThemeSettings), - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, _lang), - Cultures = cultures, - PageTypes = CommonHelper.ParseEnumToObject(typeof(MixPageType)), - ModuleTypes = CommonHelper.ParseEnumToObject(typeof(MixModuleType)), - MixDatabaseTypes = CommonHelper.ParseEnumToObject(typeof(MixDatabaseType)), - DataTypes = CommonHelper.ParseEnumToObject(typeof(MixDataType)), - Statuses = CommonHelper.ParseEnumToObject(typeof(MixContentStatus)), - LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration") - }; - settings.LangIcon = culture?.Icon ?? MixService.GetConfig("Language"); - return new RepositoryResponse() - { - IsSucceed = true, - Data = settings - }; - } - - // GET api/category/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("{culture}/all-settings")] - [Route("all-settings")] - public RepositoryResponse AllSettingsAsync() - { - return GetAllSettings(); - } - - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("jarray-data/{name}")] - public RepositoryResponse loadData(string name) - { - try - { - var cultures = MixFileRepository.Instance.GetFile(name, MixFolders.JsonDataFolder, true, "[]"); - var obj = JObject.Parse(cultures.Content); - return new RepositoryResponse() - { - IsSucceed = true, - Data = obj["data"] as JArray - }; - } - catch - { - return new RepositoryResponse() - { - IsSucceed = true, - Data = null - }; - } - } - - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("json-data/{name}")] - public RepositoryResponse loadJsonData(string name) - { - var cultures = MixFileRepository.Instance.GetFile(name, MixFolders.JsonDataFolder, true, "{}"); - var obj = JObject.Parse(cultures.Content); - return new RepositoryResponse() - { - IsSucceed = true, - Data = obj["data"] as JObject - }; - } - - // GET api/category/id - [HttpGet, HttpOptions] - [Route("{culture}/translator")] - [Route("translator")] - public RepositoryResponse Languages() - { - return new RepositoryResponse() - { - IsSucceed = true, - Data = MixService.GetTranslator(_lang) - }; - } - - // GET api/configurations/id - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("{culture}/global-settings")] - [Route("global-settings")] - public RepositoryResponse GetGlobalSettings() - { - var cultures = CommonRepository.Instance.LoadCultures(); - var culture = cultures.FirstOrDefault(c => c.Specificulture == _lang); - - // Get Settings - GlobalSettingsViewModel configurations = new GlobalSettingsViewModel() - { - Domain = MixService.GetConfig(MixAppSettingKeywords.Domain), - Lang = _lang, - PortalThemeSettings = MixService.GetConfig(MixAppSettingKeywords.PortalThemeSettings), - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, _lang), - ApiEncryptKey = MixService.GetConfig(MixAppSettingKeywords.ApiEncryptKey), - ApiEncryptIV = MixService.GetConfig(MixAppSettingKeywords.ApiEncryptIV), - IsEncryptApi = MixService.GetConfig(MixAppSettingKeywords.IsEncryptApi), - Cultures = cultures, - PageTypes = CommonHelper.ParseEnumToObject(typeof(MixPageType)), - ModuleTypes = CommonHelper.ParseEnumToObject(typeof(MixModuleType)), - MixDatabaseTypes = CommonHelper.ParseEnumToObject(typeof(MixDatabaseType)), - DataTypes = CommonHelper.ParseEnumToObject(typeof(MixDataType)), - Statuses = CommonHelper.ParseEnumToObject(typeof(MixContentStatus)), - LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration") - }; - - configurations.LangIcon = culture?.Icon ?? MixService.GetConfig("Language"); - return new RepositoryResponse() - { - IsSucceed = true, - Data = JObject.FromObject(configurations) - }; - } - - // GET api/category/id - [HttpGet, HttpOptions] - [Route("{culture}/dashboard")] - public RepositoryResponse Dashboard(string culture) - { - return new RepositoryResponse() - { - IsSucceed = true, - Data = new DashboardViewModel(culture) - }; - } - - // GET api/v1/portal/check-config - [AllowAnonymous] - [HttpGet, HttpOptions] - [Route("check-config/{lastSync}")] - public RepositoryResponse checkConfig(DateTime lastSync) - { - var lastUpdate = MixService.GetConfig("LastUpdateConfiguration"); - if (lastSync.ToUniversalTime() < lastUpdate) - { - return GetAllSettings(); - } - else - { - return new RepositoryResponse() - { - IsSucceed = true, - }; - } - } - - // GET api/category/id - [HttpGet, HttpOptions] - [Route("sitemap")] - public async Task> SiteMapAsync() - { - return await SitemapService.ParseSitemapAsync(); - } - - // GET - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpGet, HttpOptions] - [Route("app-settings/details")] - public RepositoryResponse LoadAppSettings() - { - var settings = MixFileRepository.Instance.GetFile("appsettings", MixFileExtensions.Json, string.Empty, true, "{}"); - return new RepositoryResponse() { IsSucceed = true, Data = JObject.Parse(settings.Content) }; - } - - // GET api/category/id - [HttpGet, HttpOptions] - [Route("translate-url/{culture}/{type}/{id}")] - public async Task> TranslateUrlAsync(string culture, string type, int id) - { - switch (type) - { - case "Post": - var getPost = await Lib.ViewModels.MixPosts.ReadListItemViewModel.Repository.GetSingleModelAsync( - a => a.Id == id && a.Specificulture == culture); - if (getPost.IsSucceed) - { - return new RepositoryResponse() - { - IsSucceed = getPost.IsSucceed, - Data = MixCmsHelper.GetRouterUrl(new { action = "post", culture = _lang, id = getPost.Data.Id, getPost.Data.SeoName }, Request, Url) - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = getPost.IsSucceed, - Data = $"/{culture}" - }; - } - - case "Page": - var getPage = await Lib.ViewModels.MixPages.ReadListItemViewModel.Repository.GetSingleModelAsync( - a => a.Id == id && a.Specificulture == culture); - if (getPage.IsSucceed) - { - return new RepositoryResponse() - { - IsSucceed = getPage.IsSucceed, - Data = MixCmsHelper.GetRouterUrl( - new { culture = _lang, seoName = getPage.Data.SeoName }, Request, Url) - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = true, - Data = $"/{culture}" - }; - } - default: - return new RepositoryResponse() - { - IsSucceed = true, - Data = $"/{culture}" - }; - } - } - - #endregion Get - - #region Post - - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("encrypt-rsa")] - public RepositoryResponse EncryptRsa([FromBody] JObject model) - { - string data = model.GetValue("data").Value(); - return new RepositoryResponse() - { - Data = RSAEncryptionHelper.GetEncryptedText(data) - }; - } - - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("decrypt-rsa")] - public RepositoryResponse DecryptRsa([FromBody] JObject model) - { - string data = model.GetValue("data").Value(); - return new RepositoryResponse() - { - Data = Lib.Helpers.RSAEncryptionHelper.GetDecryptedText(data) - }; - } - - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("encrypt")] - public RepositoryResponse Encrypt([FromBody] JObject model) - { - string data = model.GetValue("data").Value(); - var encrypted = new JObject(new JProperty("encrypted", data)); - var key = System.Text.Encoding.UTF8.GetBytes("sw-cms-secret-key"); - return new RepositoryResponse() - { - Data = AesEncryptionHelper.EncryptString(data, Convert.ToBase64String(key)) - }; - } - - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("decrypt")] - public RepositoryResponse Decrypt([FromBody] JObject model) - { - string data = model.GetValue("data")?.Value(); - //string key = model.GetValue("key")?.Value(); - var key = System.Text.Encoding.UTF8.GetBytes("sw-cms-secret-key"); - return new RepositoryResponse() - { - Data = AesEncryptionHelper.DecryptString(data, Convert.ToBase64String(key)) - }; - } - - // POST api/category - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("app-settings/save")] - public RepositoryResponse SaveAppSettings([FromBody] JObject model) - { - var settings = MixFileRepository.Instance.GetFile("appsettings", MixFileExtensions.Json, string.Empty, true, "{}"); - if (model != null) - { - settings.Content = model.ToString(); - if (MixFileRepository.Instance.SaveFile(settings)) - { - MixService.Reload(); - if (!MixService.GetMixConfig("IsCache")) - { - Services.MixCacheService.RemoveCacheAsync(); - } - } - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - } - return new RepositoryResponse() { IsSucceed = model != null, Data = model }; - } - - // POST api/category - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("app-settings/save-global/{name}")] - public RepositoryResponse SaveGlobalSettings(string name, [FromBody] JObject model) - { - switch (name) - { - case "PortalThemeSettings": - MixService.SetConfig(name, model); - break; - - default: - MixService.SetConfig(name, model["value"].ToString()); - break; - } - var result = MixService.SaveSettings(); - return new RepositoryResponse() { IsSucceed = result }; - } - - // POST api/category - [HttpGet, HttpOptions] - [Route("app-settings/save-default")] - public RepositoryResponse SaveDefaultAppSettings() - { - return new RepositoryResponse() { IsSucceed = true, Data = MixService.SaveSettings() }; - } - - [AllowAnonymous] - [HttpPost, HttpOptions] - [Route("sendmail")] - public void SendMail([FromBody] JObject model) - { - MixService.SendMail(model.Value("subject"), model.Value("body"), MixService.GetConfig("ContactEmail", _lang)); - } - - // POST api/category - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("import")] - [Route("{culture}/import")] - public async Task> ImportAsync([FromForm] IFormFile assets) - { - string importFolder = $"Imports/Structures/{_lang}"; - var result = new RepositoryResponse(); - var saveFile = MixFileRepository.Instance.SaveWebFile(assets, $"{importFolder}/{assets.FileName}"); - if (saveFile != null) - { - var fileContent = MixFileRepository.Instance.GetWebFile($"{saveFile.Filename}{saveFile.Extension}", - saveFile.FileFolder); - var obj = JObject.Parse(fileContent.Content); - switch (obj["type"].Value()) - { - case "Language": - var arrLanguage = obj["data"].ToObject>(); - result = await Lib.ViewModels.MixLanguages.UpdateViewModel.ImportLanguages(arrLanguage, _lang); - return result; - - case "Configuration": - var arrConfiguration = obj["data"].ToObject>(); - result = await Lib.ViewModels.MixConfigurations.UpdateViewModel.ImportConfigurations(arrConfiguration, _lang); - return result; - - case "Module": - var arrModule = obj["data"].ToObject>(); - result = await Lib.ViewModels.MixModules.Helper.Import(arrModule, _lang); - return result; - - default: - return new RepositoryResponse() { IsSucceed = false }; - } - } - return new RepositoryResponse(); - } - - #endregion Post - - #region Helpers - - private RepositoryResponse GetAllSettings() - { - var cultures = CommonRepository.Instance.LoadCultures(); - var culture = cultures.FirstOrDefault(c => c.Specificulture == _lang); - - // Get Settings - GlobalSettingsViewModel configurations = new GlobalSettingsViewModel() - { - Domain = MixService.GetConfig(MixAppSettingKeywords.Domain), - Lang = _lang, - PortalThemeSettings = MixService.GetConfig(MixAppSettingKeywords.PortalThemeSettings), - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, _lang), - ApiEncryptKey = MixService.GetConfig(MixAppSettingKeywords.ApiEncryptKey), - ApiEncryptIV = MixService.GetConfig(MixAppSettingKeywords.ApiEncryptIV), - IsEncryptApi = MixService.GetConfig(MixAppSettingKeywords.IsEncryptApi), - Cultures = cultures, - PageTypes = CommonHelper.ParseEnumToObject(typeof(MixPageType)), - ModuleTypes = CommonHelper.ParseEnumToObject(typeof(MixModuleType)), - MixDatabaseTypes = CommonHelper.ParseEnumToObject(typeof(MixDatabaseType)), - DataTypes = CommonHelper.ParseEnumToObject(typeof(MixDataType)), - Statuses = CommonHelper.ParseEnumToObject(typeof(MixContentStatus)), - LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration") - }; - - configurations.LangIcon = culture?.Icon ?? MixService.GetConfig("Language"); - - // Get translator - var translator = new JObject() - { - new JProperty("lang",_lang), - new JProperty("data", MixService.GetTranslator(_lang)) - }; - - // Get Configurations - var settings = new JObject() - { - new JProperty("lang",_lang), - new JProperty("langIcon",configurations.LangIcon), - - new JProperty("data", MixService.GetLocalSettings(_lang)) - }; - JObject result = new JObject() - { - new JProperty("globalSettings", JObject.FromObject(configurations)), - new JProperty("translator", translator), - new JProperty("settings", JObject.FromObject(settings)) - }; - - return new RepositoryResponse() - { - IsSucceed = true, - Data = result - }; - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiRoleController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiRoleController.cs deleted file mode 100644 index 7079b663d..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiRoleController.cs +++ /dev/null @@ -1,213 +0,0 @@ -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR; -using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.Logging; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.Account; -using Mix.Cms.Lib.ViewModels.Account.MixRoles; -using Mix.Cms.Service.SignalR.Hubs; -using Mix.Domain.Core.ViewModels; -using Mix.Identity.Models; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/role")] - public class ApiRoleController : BaseApiController - { - protected readonly UserManager _userManager; - protected readonly SignInManager _signInManager; - protected readonly RoleManager _roleManager; - - //protected readonly IEmailSender _emailSender; - protected readonly ILogger _logger; - - public ApiRoleController(UserManager userManager, - SignInManager signInManager, - RoleManager roleManager, - //IEmailSender emailSender, - ILogger logger, - IMemoryCache memoryCache, - IHubContext hubContext) : base(null, memoryCache, hubContext) - { - _userManager = userManager; - _signInManager = signInManager; - _roleManager = roleManager; - //_emailSender = emailSender; - _logger = logger; - } - - //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpGet("claims")] - public object Claims() - { - return User.Claims.Select(c => - new - { - Type = c.Type, - Value = c.Value - }); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme - , Roles = "SuperAdmin")] - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task GetDetails(string id, string viewType) - { - switch (viewType) - { - case "portal": - var beResult = await UpdateViewModel.Repository.GetSingleModelAsync(r => r.Id == id); - if (beResult.IsSucceed) - { - await beResult.Data.LoadPermissions(); - } - return JObject.FromObject(beResult); - - default: - var result = await RoleViewModel.Repository.GetSingleModelAsync(r => r.Id == id); - return JObject.FromObject(result); - } - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [HttpGet, HttpOptions] - [Route("permissions")] - public async Task GetPermissions() - { - RepositoryResponse> permissions = new RepositoryResponse>() - { - IsSucceed = true, - Data = new List() - }; - var roles = User.Claims.Where(c => c.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role").ToList(); - if (!roles.Any(role => role.Value.ToUpper() == "SUPERADMIN")) - { - foreach (var item in roles) - { - var role = await _roleManager.FindByNameAsync(item.Value); - var temp = await ReadViewModel.Repository.GetSingleModelAsync(r => r.Id == role.Id); - if (temp.IsSucceed) - { - temp.Data.Permissions = Lib.ViewModels.MixPortalPages.ReadRolePermissionViewModel.Repository.GetModelListBy(p => p.Level == 0 - && (p.MixPortalPageRole.Any(r => r.RoleId == temp.Data.Id)) - ).Data; - permissions.Data.Add(temp.Data); - } - } - } - return JObject.FromObject(permissions); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin")] - [HttpGet, HttpPost, HttpOptions] - [Route("list")] - public async Task>> GetList() - { - return await RoleViewModel.Repository.GetModelListAsync(); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin")] - [HttpPost, HttpOptions] - [Route("create")] - public async Task> Save([FromBody] string name) - { - var role = new IdentityRole() - { - Name = name, - Id = Guid.NewGuid().ToString() - }; - - var result = await _roleManager.CreateAsync(role); - - return new RepositoryResponse() - { - IsSucceed = result.Succeeded, - Data = role, - Errors = result.Errors?.Select(e => $"{e.Code}: {e.Description}").ToList() - }; - } - - // POST api/role - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save( - [FromBody] UpdateViewModel model) - { - if (model != null) - { - var result = await model.SaveModelAsync(true).ConfigureAwait(false); - if (result.IsSucceed) - { - await result.Data.SavePermissionsAsync(result.Data.Model); - } - return result; - } - return new RepositoryResponse(); - } - - // POST api/role - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin")] - [HttpPost, HttpOptions] - [Route("update-permission")] - public async Task> Update( - [FromBody] Lib.ViewModels.MixPortalPageRoles.ReadViewModel model) - { - var result = new RepositoryResponse() { IsSucceed = true, Data = model }; - if (model != null) - { - if (model.IsActived) - { - model.CreatedBy = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - var saveResult = await model.SaveModelAsync(false); - result.IsSucceed = saveResult.IsSucceed; - - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await model.RemoveModelAsync(false); - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors.AddRange(saveResult.Errors); - } - } - return result; - } - return new RepositoryResponse(); - } - - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin")] - [Route("delete/{name}")] - public async Task> Delete(string name) - { - if (name != "SuperAdmin") - { - var result = await RoleViewModel.Repository.RemoveModelAsync(r => r.Name == name); - return result; - } - else - { - return new RepositoryResponse() - { - }; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiTemplateController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiTemplateController.cs deleted file mode 100644 index ca1f599cf..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiTemplateController.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixTemplates; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, - Roles = "SuperAdmin, Admin")] - [Produces("application/json")] - [Route("api/v1/{culture}/template")] - public class ApiTemplateController : - BaseGenericApiController - { - public ApiTemplateController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - [HttpGet, HttpOptions] - [Route("details/{viewType}/{themeId}/{folderType}/{id}")] - [Route("details/{viewType}/{themeId}/{folderType}")] - public async Task>> DetailsAsync(string viewType, int themeId, string folderType, int? id) - { - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{themeId}_{folderType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var getTheme = await Lib.ViewModels.MixThemes.ReadViewModel.Repository.GetSingleModelAsync(t => t.Id == themeId); - if (getTheme.IsSucceed) - { - var model = new MixTemplate() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - ThemeId = themeId, - ThemeName = getTheme.Data.Name, - Extension = MixService.GetConfig("TemplateExtension"), - FolderType = folderType - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - else - { - return new RepositoryResponse(); - } - } - } - - // GET api/category/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id, true); - } - - #endregion Get - - #region Post - - // POST api/template - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save( - [FromBody] Lib.ViewModels.MixTemplates.UpdateViewModel model) - { - return await base.SaveAsync(model, true); - } - - // GET api/template - [HttpPost, HttpOptions] - [Route("list/{themeId}")] - public async Task> GetList( - int themeId, - [FromBody] RequestPaging request - ) - { - Expression> predicate = model => - model.ThemeId == themeId - && (string.IsNullOrWhiteSpace(request.Key) - || - ( - model.FolderType == (request.Key) - )) - && (string.IsNullOrWhiteSpace(request.Keyword) - || - ( - model.FileName.Contains(request.Keyword) - || model.FileFolder.Contains(request.Keyword) - || model.FolderType == request.Keyword - )); - - switch (request.Key) - { - case "mvc": - var mvcResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(mvcResult)); - - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - - default: - var listItemResult = await base.GetListAsync(request, predicate); - - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiThemeController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiThemeController.cs deleted file mode 100644 index dbd4e385a..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiThemeController.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels; -using Mix.Cms.Lib.ViewModels.MixThemes; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/theme")] - public class ApiThemeController : - BaseGenericApiController - { - public ApiThemeController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/theme/id - [HttpGet, HttpOptions] - [Route("sync/{id}")] - public async Task>> Sync(int id) - { - var getTemplate = await Lib.ViewModels.MixTemplates.UpdateViewModel.Repository.GetModelListByAsync( - template => template.ThemeId == id).ConfigureAwait(false); - foreach (var item in getTemplate.Data) - { - await item.SaveModelAsync(true).ConfigureAwait(false); - } - return getTemplate; - } - - // GET api/theme/id - [HttpGet, HttpOptions] - [Route("export/{id}")] - public async Task> Export(int id) - { - var siteStructures = new SiteStructureViewModel(); - await siteStructures.InitAsync(_lang); - return new RepositoryResponse() - { - IsSucceed = true, - Data = siteStructures - }; - } - - // GET api/theme/id - [HttpPost, HttpOptions] - [Route("export/{id}")] - public Task> Export(int id, [FromBody] SiteStructureViewModel data) - { - return Lib.ViewModels.MixThemes.Helper.ExportTheme(id, data - , _lang, HttpContext.Request.Scheme, HttpContext.Request.Host.Value); - } - - // GET api/theme/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id, true); - } - - // GET api/themes/id - [HttpGet, HttpOptions] - [Route("details/{id}/{viewType}")] - [Route("details/{viewType}")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - switch (viewType) - { - case "portal": - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - if (portalResult.IsSucceed) - { - portalResult.Data.IsActived = MixService.GetConfig(MixAppSettingKeywords.ThemeId, _lang) == portalResult.Data.Id; - } - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixTheme() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - default: - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var result = await base.GetSingleAsync($"{viewType}_{id}", predicate); - if (result.IsSucceed) - { - result.Data.IsActived = MixService.GetConfig(MixAppSettingKeywords.ThemeId, _lang) == result.Data.Id; - } - return Ok(JObject.FromObject(result)); - } - else - { - var model = new MixTheme() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) - , - Priority = ReadViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - } - - #endregion Get - - #region Post - - // POST api/theme - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [DisableRequestSizeLimit] - [Route("save")] - public async Task> Save([FromForm] string model, [FromForm] IFormFile assets, [FromForm] IFormFile theme) - { - var data = JsonConvert.DeserializeObject(model); - - if (assets != null) - { - data.Asset = new FileViewModel(assets, data.AssetFolder); - MixFileRepository.Instance.SaveFile(assets, $"wwwroot/{data.AssetFolder}"); - } - if (theme != null) - { - string importFolder = $"Imports/Themes/{DateTime.UtcNow.ToString("dd-MM-yyyy")}/{data.Name}"; - data.TemplateAsset = new FileViewModel(theme, importFolder); - MixFileRepository.Instance.SaveFile(theme, $"wwwroot/{importFolder}"); - } - - // Load default blank if created new without upload theme - if (data.Id == 0 && theme == null) - { - if (data.IsCloneFromCurrentTheme) - { - var currentThemeFolder = $"{MixFolders.TemplatesFolder}/{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, _lang)}"; - var assetFolder = $"{MixFolders.SiteContentAssetsFolder}/{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, _lang)}/assets"; - MixFileRepository.Instance.CopyDirectory(currentThemeFolder, data.TemplateFolder); - MixFileRepository.Instance.CopyDirectory(assetFolder, $"wwwroot/{data.AssetFolder}"); - } - else - { - data.TemplateAsset = new FileViewModel() - { - Filename = "default_blank", - Extension = MixFileExtensions.Zip, - FileFolder = MixFolders.ImportFolder - }; - } - } - - if (data != null) - { - data.CreatedBy = User.Claims.FirstOrDefault(c => c.Type == "Username")?.Value; - data.Specificulture = _lang; - var result = await base.SaveAsync(data, true); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/theme - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - string.IsNullOrWhiteSpace(request.Keyword) - || (model.Name.Contains(request.Keyword) - ) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ) - ; - switch (request.Key) - { - case "portal": - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - - default: - - var listItemResult = await base.GetListAsync(request, predicate); - - return JObject.FromObject(listItemResult); - } - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/ApiUrlAliasController.cs b/src/Mix.Cms.Api/Controllers/v1/ApiUrlAliasController.cs deleted file mode 100644 index d78b516a6..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/ApiUrlAliasController.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixUrlAliases; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - [Produces("application/json")] - [Route("api/v1/{culture}/url-alias")] - public class ApiUrlAliasController : - BaseGenericApiController - { - public ApiUrlAliasController(MixCmsContext context, IMemoryCache memoryCache, Microsoft.AspNetCore.SignalR.IHubContext hubContext) : base(context, memoryCache, hubContext) - { - } - - #region Get - - // GET api/url-alias/id - [HttpGet, HttpOptions] - [Route("delete/{id}")] - public async Task> DeleteAsync(int id) - { - return await base.DeleteAsync( - model => model.Id == id && model.Specificulture == _lang, true); - } - - // GET api/url-aliass/id - [HttpGet, HttpOptions] - [Route("details/{id}")] - [Route("details")] - public async Task> Details(string viewType, int? id) - { - string msg = string.Empty; - if (id.HasValue) - { - Expression> predicate = model => model.Id == id; - var portalResult = await base.GetSingleAsync($"{viewType}_{id}", predicate); - return Ok(JObject.FromObject(portalResult)); - } - else - { - var model = new MixUrlAlias() - { - Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus), - Priority = UpdateViewModel.Repository.Max(a => a.Priority).Data + 1 - }; - - RepositoryResponse result = await base.GetSingleAsync($"{viewType}_default", null, model); - return Ok(JObject.FromObject(result)); - } - } - - #endregion Get - - #region Post - - // POST api/url-alias - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Roles = "SuperAdmin, Admin")] - [HttpPost, HttpOptions] - [Route("save")] - public async Task> Save([FromBody] UpdateViewModel model) - { - if (model != null) - { - var result = await base.SaveAsync(model, true); - return result; - } - return new RepositoryResponse() { Status = 501 }; - } - - // GET api/url-alias - [HttpPost, HttpOptions] - [Route("list")] - public async Task> GetList( - [FromBody] RequestPaging request) - { - ParseRequestPagingDate(request); - Expression> predicate = model => - (string.IsNullOrEmpty(request.Status) || model.Status == Enum.Parse(request.Status)) - && (string.IsNullOrWhiteSpace(request.Keyword) - || (model.Alias.Contains(request.Keyword)) - ) - && (!request.FromDate.HasValue - || (model.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (model.CreatedDateTime <= request.ToDate.Value) - ); - var portalResult = await base.GetListAsync(request, predicate); - return Ok(JObject.FromObject(portalResult)); - } - - #endregion Post - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/BaseApiControoler.cs b/src/Mix.Cms.Api/Controllers/v1/BaseApiControoler.cs deleted file mode 100644 index 43f9807e4..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/BaseApiControoler.cs +++ /dev/null @@ -1,150 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.SignalR; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Services; -using Mix.Cms.Service.SignalR.Hubs; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - public class BaseApiController : Controller - where TDbContext : DbContext - { - protected readonly IHubContext _hubContext; - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected readonly IMemoryCache _memoryCache; - - /// - /// The language - /// - protected string _lang; - - /// - /// The domain - /// - protected string _domain; - - /// - /// The repo - /// - /// - /// Initializes a new instance of the class. - /// - public BaseApiController(TDbContext context, IMemoryCache memoryCache, IHubContext hubContext) - { - _context = context; - _hubContext = hubContext; - _memoryCache = memoryCache; - } - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - AlertAsync("Executing request", 200); - base.OnActionExecuting(context); - } - - #endregion Overrides - - protected void RemoveCache() - { - if (_memoryCache != null) - { - //foreach (var item in MixConstants.cachedKeys) - //{ - // _memoryCache.Remove(item); - //} - //MixConstants.cachedKeys = new List(); - AlertAsync("Empty Cache", 200); - } - } - - protected async Task> GetSingleAsync(string key, Expression> predicate = null, TModel model = null) - where TView : ViewModelBase - where TModel : class - { - var cacheKey = $"{typeof(TModel).Name}_details_{_lang}_{key}"; - RepositoryResponse data = null; - //if (MixService.GetConfig("IsCache")) - //{ - // data = await MixCacheService.GetAsync>(cacheKey); - //} - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - //_memoryCache.Set(cacheKey, data); - //await MixCacheService.SetAsync(cacheKey, data); - } - else - { - data = new RepositoryResponse() - { - IsSucceed = true, - Data = DefaultRepository.Instance.ParseView(model) - }; - } - AlertAsync("Add Cache", 200, cacheKey); - } - data.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return data; - } - - protected void AlertAsync(string action, int status, string message = null) - { - var logMsg = new JObject() - { - new JProperty("created_at", DateTime.UtcNow), - new JProperty("ip_address", Request.HttpContext.Connection.RemoteIpAddress.ToString()), - new JProperty("user", User.Identity?.Name), - new JProperty("request_url", Request.Path.Value), - new JProperty("action", action), - new JProperty("status", status), - new JProperty("message", message) - }; - _hubContext.Clients.All.SendAsync("ReceiveMessage", logMsg); - } - - protected void ParseRequestPagingDate(RequestPaging request) - { - request.FromDate = request.FromDate.HasValue ? new DateTime(request.FromDate.Value.Year, request.FromDate.Value.Month, request.FromDate.Value.Day).ToUniversalTime() - : default(DateTime?); - request.ToDate = request.ToDate.HasValue ? new DateTime(request.ToDate.Value.Year, request.ToDate.Value.Month, request.ToDate.Value.Day).ToUniversalTime().AddDays(1) - : default(DateTime?); - } - - protected QueryString ParseQuery(RequestPaging request) - { - return new QueryString(request.Query); - } - - /// - /// Gets the language. - /// - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : MixService.GetConfig("Language"); - ViewBag.culture = _lang; - - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/BaseGenericApiController.cs b/src/Mix.Cms.Api/Controllers/v1/BaseGenericApiController.cs deleted file mode 100644 index 2906950fe..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/BaseGenericApiController.cs +++ /dev/null @@ -1,435 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.SignalR; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.Extensions.Caching.Memory; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Helpers; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - public class BaseGenericApiController : Controller - where TDbContext : DbContext - where TModel : class - { - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected readonly IHubContext _hubContext; - - protected IMemoryCache _memoryCache; - - /// - /// The language - /// - protected string _lang; - - protected bool _forbidden = false; - - protected bool _forbiddenPortal { - get { - var allowedIps = MixService.GetIpConfig("AllowedPortalIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - return _forbidden || ( - // allow localhost - //remoteIp != "::1" && - (allowedIps != null && !allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) - ); - } - } - - /// - /// The domain - /// - protected string _domain; - - /// - /// The repo - /// - /// - /// Initializes a new instance of the class. - /// - public BaseGenericApiController(TDbContext context, IMemoryCache memoryCache, IHubContext hubContext) - { - _context = context; - _hubContext = hubContext; - _memoryCache = memoryCache; - } - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - //remoteIp != "::1" && - (!allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) || - (exceptIps.Any(t => t.Value() == remoteIp)) - ) - { - _forbidden = true; - } - } - base.OnActionExecuting(context); - } - - #endregion Overrides - - protected async Task> GetSingleAsync(string key, Expression> predicate = null, TModel model = null) - where TView : ViewModelBase - { - var cacheKey = $"api_{_lang}_{typeof(TModel).Name.ToLower()}_details_{key}"; - RepositoryResponse data = null; - //if (MixService.GetConfig("IsCache")) - //{ - // data = await MixCacheService.GetAsync>(cacheKey); - //} - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - //_memoryCache.Set(cacheKey, data); - //await MixCacheService.SetAsync(cacheKey, data); - } - else - { - data = new RepositoryResponse() - { - IsSucceed = true, - Data = DefaultRepository.Instance.ParseView(model) - }; - } - } - data.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return data; - } - - protected async Task> GetSingleAsync(Expression> predicate = null, TModel model = null) - where TView : ViewModelBase - { - RepositoryResponse data = null; - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - else - { - data = new RepositoryResponse() - { - IsSucceed = true, - Data = DefaultRepository.Instance.ParseView(model) - }; - } - } - AlertAsync($"Get {typeof(TView).Name}", data?.Status ?? 400, data?.ResponseKey); - data.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return data; - } - - protected async Task> DeleteAsync(Expression> predicate, bool isDeleteRelated = false) - where TView : ViewModelBase - { - var data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - if (data.IsSucceed) - { - var result = await data.Data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(TView data, bool isDeleteRelated = false) - where TView : ViewModelBase - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task>> DeleteListAsync(Expression> predicate, bool isRemoveRelatedModel = false) - where TView : ViewModelBase - { - var data = await DefaultRepository.Instance.RemoveListModelAsync(isRemoveRelatedModel, predicate); - - return data; - } - - protected async Task> ExportListAsync(Expression> predicate, MixStructureType type) - { - var getData = await DefaultModelRepository.Instance.GetModelListByAsync(predicate, _context); - FileViewModel file = null; - if (getData.IsSucceed) - { - string exportPath = $"Exports/Structures/{typeof(TModel).Name}/{_lang}"; - string filename = $"{type.ToString()}_{DateTime.UtcNow.ToString("ddMMyyyy")}"; - var objContent = new JObject( - new JProperty("type", type.ToString()), - new JProperty("data", JArray.FromObject(getData.Data)) - ); - file = new FileViewModel() - { - Filename = filename, - Extension = MixFileExtensions.Json, - FileFolder = exportPath, - Content = objContent.ToString() - }; - // Copy current templates file - MixFileRepository.Instance.SaveWebFile(file); - } - UnitOfWorkHelper.HandleTransaction(getData.IsSucceed, true, _transaction); - return new RepositoryResponse() - { - IsSucceed = true, - Data = file, - }; - } - - protected async Task>> GetListAsync(RequestPaging request, Expression> predicate = null, TModel model = null) - where TView : ViewModelBase - { - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - data.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - AlertAsync($"Get List {typeof(TView).Name}", data?.Status ?? 400, data?.ResponseKey); - return data; - } - - protected async Task> SaveAsync(TView vm, bool isSaveSubModel) - where TView : ViewModelBase - { - if (vm != null) - { - var result = await vm.SaveModelAsync(isSaveSubModel).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task> SaveAsync(JObject obj, Expression> predicate) - where TView : ViewModelBase - { - if (obj != null) - { - List fields = new List(); - Type type = typeof(TModel); - foreach (var item in obj.Properties()) - { - var propName = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(item.Name); - PropertyInfo propertyInfo = type.GetProperty(propName); - if (propertyInfo != null) - { - object val = Convert.ChangeType(item.Value, propertyInfo.PropertyType); - var field = new EntityField() - { - PropertyName = propName, - PropertyValue = val - }; - fields.Add(field); - } - } - - var result = await DefaultRepository.Instance.UpdateFieldsAsync(predicate, fields); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task>> SaveListAsync(List lstVm, bool isSaveSubModel) - where TView : ViewModelBase - { - var result = await DefaultRepository.Instance.SaveListModelAsync(lstVm, isSaveSubModel); - - return result; - } - - protected RepositoryResponse> SaveList(List lstVm, bool isSaveSubModel) - where TView : ViewModelBase - { - var result = new RepositoryResponse>() { IsSucceed = true }; - if (lstVm != null) - { - foreach (var vm in lstVm) - { - var tmp = vm.SaveModel(isSaveSubModel, - _context, _transaction); - result.IsSucceed = result.IsSucceed && tmp.IsSucceed; - if (!tmp.IsSucceed) - { - result.Exception = tmp.Exception; - result.Errors.AddRange(tmp.Errors); - } - } - return result; - } - - return result; - } - - public JObject SaveEncrypt([FromBody] RequestEncrypted request) - { - //var key = Convert.FromBase64String(request.Key); //Encoding.UTF8.GetBytes(request.Key); - //var iv = Convert.FromBase64String(request.IV); //Encoding.UTF8.GetBytes(request.IV); - string encrypted = string.Empty; - string decrypt = string.Empty; - if (!string.IsNullOrEmpty(request.PlainText)) - { - encrypted = AesEncryptionHelper.EncryptStringToBytes_Aes(new JObject()).ToString(); - } - if (!string.IsNullOrEmpty(request.Encrypted)) - { - //decrypt = MixService.DecryptStringFromBytes_Aes(request.Encrypted, request.Key, request.IV); - } - JObject data = new JObject( - new JProperty("key", request.Key), - new JProperty("encrypted", encrypted), - new JProperty("plainText", decrypt)); - return data; - } - - protected void AlertAsync(string action, int status, string message = null) - { - var address = Request.Headers["X-Forwarded-For"]; - if (String.IsNullOrEmpty(address)) - { - address = Request.Host.Value; - } - var logMsg = new JObject() - { - new JProperty("created_at", DateTime.UtcNow), - new JProperty("id", Request.HttpContext.Connection.Id.ToString()), - new JProperty("address", address), - new JProperty("ip_address", Request.HttpContext.Connection.RemoteIpAddress.ToString()), - new JProperty("user", User.Identity?.Name?? User.Claims.SingleOrDefault(c=>c.Type == "Username")?.Value), - new JProperty("request_url", Request.Path.Value), - new JProperty("action", action), - new JProperty("status", status), - new JProperty("message", message) - }; - - //It's not possible to configure JSON serialization in the JavaScript client at this time (March 25th 2020). - //https://docs.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-3.1&tabs=dotnet - - _hubContext.Clients.All.SendAsync(Mix.Cms.Service.SignalR.Constants.HubMethods.ReceiveMethod, logMsg.ToString(Newtonsoft.Json.Formatting.None)); - } - - public static void Log(dynamic request, dynamic response) - { - string fullPath = $"{Environment.CurrentDirectory}/logs/api/{DateTime.Now.ToString("dd-MM-yyyy")}"; - if (!string.IsNullOrEmpty(fullPath) && !Directory.Exists(fullPath)) - { - Directory.CreateDirectory(fullPath); - } - string filePath = $"{fullPath}/log_api.json"; - - try - { - FileInfo file = new FileInfo(filePath); - string content = "[]"; - if (file.Exists) - { - using (StreamReader s = file.OpenText()) - { - content = s.ReadToEnd(); - } - System.IO.File.Delete(filePath); - } - - JArray arrExceptions = JArray.Parse(content); - JObject jex = new JObject - { - new JProperty("CreatedDateTime", DateTime.UtcNow), - new JProperty("request", JObject.FromObject(request)), - new JProperty("response", JObject.FromObject(response) ) - }; - arrExceptions.Add(jex); - content = arrExceptions.ToString(Newtonsoft.Json.Formatting.None); - - using (var writer = System.IO.File.CreateText(filePath)) - { - writer.WriteLine(content); - } - } - catch (Exception ex) - { - Console.WriteLine(ex); - // File invalid - } - } - - protected void ParseRequestPagingDate(RequestPaging request) - { - if (request.FromDate.HasValue) - { - request.FromDate = request.FromDate.Value.Kind == DateTimeKind.Utc ? request.FromDate.Value - : request.FromDate.Value.ToUniversalTime(); - } - if (request.ToDate.HasValue) - { - request.ToDate = request.ToDate.Value.Kind == DateTimeKind.Utc ? request.ToDate.Value - : request.ToDate.Value.ToUniversalTime(); - } - } - - protected QueryString ParseQuery(RequestPaging request) - { - return new QueryString(request.Query); - } - - /// - /// Gets the language. - /// - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : MixService.GetConfig("Language"); - ViewBag.culture = _lang; - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Controllers/v1/Mix/BaseRestApiController.cs b/src/Mix.Cms.Api/Controllers/v1/Mix/BaseRestApiController.cs deleted file mode 100644 index 69080f178..000000000 --- a/src/Mix.Cms.Api/Controllers/v1/Mix/BaseRestApiController.cs +++ /dev/null @@ -1,259 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Controllers.v1 -{ - public class BaseRestApiController : Controller - where TDbContext : DbContext - where TModel : class - { - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected string _lang; - protected bool _forbidden; - - /// - /// The domain - /// - protected string _domain; - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - //remoteIp != "::1" && - (!allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) || - (exceptIps.Any(t => t.Value() == remoteIp)) - ) - { - _forbidden = true; - } - } - base.OnActionExecuting(context); - } - - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : MixService.GetConfig("Language"); - ViewBag.culture = _lang; - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - - #endregion Overrides - - protected async Task> GetSingleAsync(Expression> predicate = null, TModel model = null) - where TView : ViewModelBase - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - else if (model != null) - { - data = new RepositoryResponse() - { - IsSucceed = true, - Data = DefaultRepository.Instance.ParseView(model) - }; - } - return data; - } - - protected async Task> DeleteAsync(Expression> predicate, bool isDeleteRelated = false) - where TView : ViewModelBase - { - var data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - if (data.IsSucceed) - { - var result = await data.Data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(TView data, bool isDeleteRelated = false) - where TView : ViewModelBase - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task>> DeleteListAsync(Expression> predicate, bool isRemoveRelatedModel = false) - where TView : ViewModelBase - { - var data = await DefaultRepository.Instance.RemoveListModelAsync(isRemoveRelatedModel, predicate); - - return data; - } - - protected async Task> ExportListAsync(Expression> predicate, string type) - { - var getData = await DefaultModelRepository.Instance.GetModelListByAsync(predicate, _context); - FileViewModel file = null; - if (getData.IsSucceed) - { - string exportPath = $"Exports/Structures/{typeof(TModel).Name}"; - string filename = $"{type.ToString()}_{DateTime.UtcNow.ToString("ddMMyyyy")}"; - var objContent = new JObject( - new JProperty("type", type.ToString()), - new JProperty("data", JArray.FromObject(getData.Data)) - ); - file = new FileViewModel() - { - Filename = filename, - Extension = MixFileExtensions.Json, - FileFolder = exportPath, - Content = objContent.ToString() - }; - // Copy current templates file - MixFileRepository.Instance.SaveWebFile(file); - } - UnitOfWorkHelper.HandleTransaction(getData.IsSucceed, true, _transaction); - return new RepositoryResponse() - { - IsSucceed = true, - Data = file, - }; - } - - protected async Task>> GetListAsync(Expression> predicate = null) - where TView : ViewModelBase - { - int.TryParse(Request.Query["pageIndex"], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query["direction"], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query["pageSize"], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query["orderBy"].ToString().ToTitleCase(), - Direction = direction - }; - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - return data; - } - - protected async Task> SaveAsync(TView vm, bool isSaveSubModel) - where TView : ViewModelBase - { - if (vm != null) - { - var result = await vm.SaveModelAsync(isSaveSubModel).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task> SaveAsync(JObject obj, Expression> predicate) - where TView : ViewModelBase - { - if (obj != null) - { - List fields = new List(); - Type type = typeof(TModel); - foreach (var item in obj.Properties()) - { - var propName = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(item.Name); - PropertyInfo propertyInfo = type.GetProperty(propName); - if (propertyInfo != null) - { - object val = Convert.ChangeType(item.Value, propertyInfo.PropertyType); - var field = new EntityField() - { - PropertyName = propName, - PropertyValue = val - }; - fields.Add(field); - } - } - - var result = await DefaultRepository.Instance.UpdateFieldsAsync(predicate, fields); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task>> SaveListAsync(List lstVm, bool isSaveSubModel) - where TView : ViewModelBase - { - var result = await DefaultRepository.Instance.SaveListModelAsync(lstVm, isSaveSubModel); - - return result; - } - - protected RepositoryResponse> SaveList(List lstVm, bool isSaveSubModel) - where TView : ViewModelBase - { - var result = new RepositoryResponse>() { IsSucceed = true }; - if (lstVm != null) - { - foreach (var vm in lstVm) - { - var tmp = vm.SaveModel(isSaveSubModel, - _context, _transaction); - result.IsSucceed = result.IsSucceed && tmp.IsSucceed; - if (!tmp.IsSucceed) - { - result.Exception = tmp.Exception; - result.Errors.AddRange(tmp.Errors); - } - } - return result; - } - - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Helpers/IdentityHelper.cs b/src/Mix.Cms.Api/Helpers/IdentityHelper.cs deleted file mode 100644 index d74135113..000000000 --- a/src/Mix.Cms.Api/Helpers/IdentityHelper.cs +++ /dev/null @@ -1,152 +0,0 @@ -using Microsoft.AspNetCore.Identity; -using Microsoft.IdentityModel.Tokens; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.Account; -using Mix.Identity.Models; -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; - -namespace Mix.Cms.Api.Helpers -{ - public class IdentityHelper - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly RoleManager _roleManager; - - public IdentityHelper( - UserManager userManager, - SignInManager signInManager, - RoleManager roleManager) - { - _userManager = userManager; - _signInManager = signInManager; - _roleManager = roleManager; - } - - public async Task GenerateAccessTokenAsync(ApplicationUser user, bool isRemember) - { - var dtIssued = DateTime.UtcNow; - var dtExpired = dtIssued.AddMinutes(MixService.GetAuthConfig("CookieExpiration")); - var dtRefreshTokenExpired = dtIssued.AddMinutes(MixService.GetAuthConfig("RefreshTokenExpiration")); - string refreshTokenId = string.Empty; - string refreshToken = string.Empty; - if (isRemember) - { - refreshToken = Guid.NewGuid().ToString(); - RefreshTokenViewModel vmRefreshToken = new RefreshTokenViewModel( - new RefreshTokens() - { - Id = refreshToken, - Email = user.Email, - IssuedUtc = dtIssued, - ClientId = MixService.GetAuthConfig("Audience"), - Username = user.UserName, - //Subject = SWCmsConstants.AuthConfiguration.Audience, - ExpiresUtc = dtRefreshTokenExpired - }); - - var saveRefreshTokenResult = await vmRefreshToken.SaveModelAsync(); - refreshTokenId = saveRefreshTokenResult.Data?.Id; - } - - AccessTokenViewModel token = new AccessTokenViewModel() - { - Access_token = await GenerateTokenAsync(user, dtExpired, refreshToken), - Refresh_token = refreshTokenId, - Token_type = MixService.GetAuthConfig("TokenType"), - Expires_in = MixService.GetAuthConfig("CookieExpiration"), - //UserData = user, - Issued = dtIssued, - Expires = dtExpired, - LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration") - }; - return token; - } - - public async Task GenerateTokenAsync(ApplicationUser user, DateTime expires, string refreshToken) - { - List claims = await GetClaimsAsync(user); - claims.AddRange(new[] - { - new Claim("Id", user.Id.ToString()), - new Claim("Username", user.UserName), - new Claim("RefreshToken", refreshToken) - }); - JwtSecurityToken jwtSecurityToken = new JwtSecurityToken( - issuer: MixService.GetAuthConfig("Issuer"), - audience: MixService.GetAuthConfig("Audience"), - notBefore: expires.AddMinutes(-MixService.GetAuthConfig("CookieExpiration")), - - claims: claims, - // our token will live 1 hour, but you can change you token lifetime here - expires: expires, - signingCredentials: new SigningCredentials(JwtSecurityKey.Create(MixService.GetAuthConfig("SecretKey")), SecurityAlgorithms.HmacSha256)); - return new JwtSecurityTokenHandler().WriteToken(jwtSecurityToken); - } - - public async Task> GetClaimsAsync(ApplicationUser user) - { - List claims = new List(); - var userRoles = await _userManager.GetRolesAsync(user); - foreach (var claim in user.Claims) - { - claims.Add(CreateClaim(claim.ClaimType, claim.ClaimValue)); - } - - foreach (var userRole in userRoles) - { - claims.Add(new Claim(ClaimTypes.Role, userRole)); - var role = await _roleManager.FindByNameAsync(userRole); - if (role != null) - { - var roleClaims = await _roleManager.GetClaimsAsync(role); - foreach (Claim roleClaim in roleClaims) - { - claims.Add(roleClaim); - } - } - } - return claims; - } - - public Claim CreateClaim(string type, string value) - { - return new Claim(type, value, ClaimValueTypes.String); - } - - public ClaimsPrincipal GetPrincipalFromExpiredToken(string token) - { - var tokenValidationParameters = new TokenValidationParameters - { - ValidateIssuer = MixService.GetAuthConfig("ValidateIssuer"), - ValidateAudience = MixService.GetAuthConfig("ValidateAudience"), - ValidateLifetime = MixService.GetAuthConfig("ValidateLifetime"), - ValidateIssuerSigningKey = MixService.GetAuthConfig("ValidateIssuerSigningKey"), - IssuerSigningKey = JwtSecurityKey.Create(MixService.GetAuthConfig("SecretKey")) - }; - - var tokenHandler = new JwtSecurityTokenHandler(); - SecurityToken securityToken; - var principal = tokenHandler.ValidateToken(token, tokenValidationParameters, out securityToken); - var jwtSecurityToken = securityToken as JwtSecurityToken; - if (jwtSecurityToken == null || !jwtSecurityToken.Header.Alg.Equals(SecurityAlgorithms.HmacSha256, StringComparison.InvariantCultureIgnoreCase)) - throw new SecurityTokenException("Invalid token"); - - return principal; - } - - public static class JwtSecurityKey - { - public static SymmetricSecurityKey Create(string secret) - { - return new SymmetricSecurityKey(Encoding.ASCII.GetBytes(secret)); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Mix.Cms.Api.csproj b/src/Mix.Cms.Api/Mix.Cms.Api.csproj deleted file mode 100644 index dd19cc801..000000000 --- a/src/Mix.Cms.Api/Mix.Cms.Api.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net5.0 - false - false - - - - - - - - - - - - - - diff --git a/src/Mix.Cms.Api/Mix.Cms.Api.csproj.user b/src/Mix.Cms.Api/Mix.Cms.Api.csproj.user deleted file mode 100644 index 4ff8b54f7..000000000 --- a/src/Mix.Cms.Api/Mix.Cms.Api.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - false - - \ No newline at end of file diff --git a/src/Mix.Cms.Api/Program.cs b/src/Mix.Cms.Api/Program.cs deleted file mode 100644 index 0227aacaa..000000000 --- a/src/Mix.Cms.Api/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Mix.Cms.Api -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Properties/launchSettings.json b/src/Mix.Cms.Api/Properties/launchSettings.json deleted file mode 100644 index 90d8e4b79..000000000 --- a/src/Mix.Cms.Api/Properties/launchSettings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:53500", - "sslPort": 44399 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Mix.Cms.Api": { - "commandName": "Project", - "dotnetRunMessages": "true", - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/Startup.cs b/src/Mix.Cms.Api/Startup.cs deleted file mode 100644 index 681ff4499..000000000 --- a/src/Mix.Cms.Api/Startup.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; - -namespace Mix.Cms.Api -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers(); - services.AddSwaggerGen(c => - { - c.SwaggerDoc("v1", new OpenApiInfo { Title = "Mix.Cms.Api", Version = "v1" }); - }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseSwagger(); - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Mix.Cms.Api v1")); - } - - app.UseHttpsRedirection(); - - app.UseRouting(); - - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Api/appsettings.Development.json b/src/Mix.Cms.Api/appsettings.Development.json deleted file mode 100644 index 45fe774a9..000000000 --- a/src/Mix.Cms.Api/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Attributes/RequestFormSizeLimitAttribute.cs b/src/Mix.Cms.Lib/Attributes/RequestFormSizeLimitAttribute.cs deleted file mode 100644 index 65451ef8c..000000000 --- a/src/Mix.Cms.Lib/Attributes/RequestFormSizeLimitAttribute.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Mvc.Filters; -using System; - -namespace Mix.Cms.Lib.Attributes -{ - /// - /// Filter to set size limits for request form data - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public class RequestFormSizeLimitAttribute : Attribute, IAuthorizationFilter, IOrderedFilter - { - private readonly FormOptions _formOptions; - - public RequestFormSizeLimitAttribute(int valueCountLimit) - { - _formOptions = new FormOptions() - { - ValueCountLimit = valueCountLimit, - KeyLengthLimit = valueCountLimit - }; - } - - public int Order { get; set; } - - public void OnAuthorization(AuthorizationFilterContext context) - { - var features = context.HttpContext.Features; - var formFeature = features.Get(); - - if (formFeature == null || formFeature.Form == null) - { - // Request form has not been read yet, so set the limits - features.Set(new FormFeature(context.HttpContext.Request, _formOptions)); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixAppSettingKeywords.cs b/src/Mix.Cms.Lib/Constants/MixAppSettingKeywords.cs deleted file mode 100644 index 4d98af52d..000000000 --- a/src/Mix.Cms.Lib/Constants/MixAppSettingKeywords.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixAppSettingKeywords - { - public const string SiteName = "SiteName"; - public const string ConnectionString = "ConnectionString"; - public const string OrderBy = "OrderBy"; - public const string DefaultBlankTemplateFolder = "DefaultTemplateFolder"; - public const string DefaultTemplateFolder = "DefaultTemplateFolder"; - public const string Language = "Language"; - public const string DefaultCulture = "DefaultCulture"; - public const string IsMysql = "IsMysql"; - public const string Domain = "Domain"; - public const string PortalThemeSettings = "PortalThemeSettings"; - public const string ThemeId = "ThemeId"; - public const string ThemeName = "ThemeName"; - public const string ThemeFolder = "ThemeFolder"; - public const string ApiEncryptKey = "ApiEncryptKey"; - public const string ApiEncryptIV = "ApiEncryptIV"; - public const string IsEncryptApi = "IsEncryptApi"; - public const string TemplateExtension = "TemplateExtension"; - public const string DefaultTheme = "DefaultTheme"; - public const string DefaultTemplate = "DefaultTemplate"; - public const string DefaultTemplateContent = "DefaultTemplateContent"; - public const string DefaultContentStatus = "DefaultContentStatus"; - public const string NextSyncContent = "NextSyncContent"; - public const string AllowedHosts = "AllowedHosts"; - public const string MaxPageSize = "MaxPageSize"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixColumnName.cs b/src/Mix.Cms.Lib/Constants/MixColumnName.cs deleted file mode 100644 index 6372d4d63..000000000 --- a/src/Mix.Cms.Lib/Constants/MixColumnName.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixColumnName - { - public const string Id = "Id"; - public const string Status = "Status"; - public const string Specificulture = "Specificulture"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixDatabaseNames.cs b/src/Mix.Cms.Lib/Constants/MixDatabaseNames.cs deleted file mode 100644 index e54626804..000000000 --- a/src/Mix.Cms.Lib/Constants/MixDatabaseNames.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixDatabaseNames - { - public const string ADDITIONAL_FIELD_PAGE = "sys_additional_field_page"; - public const string ADDITIONAL_FIELD_POST = "sys_additional_field_post"; - public const string ADDITIONAL_FIELD_MODULE = "sys_additional_field_module"; - public const string NAVIGATION = "sys_navigation"; - public const string MENU_ITEM = "sys_menu_item"; - public const string SYSTEM_CATEGORY = "sys_category"; - public const string SYSTEM_TAG = "sys_tag"; - public const string SYSTEM_USER_DATA = "sys_user_data"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixFileExtensions.cs b/src/Mix.Cms.Lib/Constants/MixFileExtensions.cs deleted file mode 100644 index 0a6778514..000000000 --- a/src/Mix.Cms.Lib/Constants/MixFileExtensions.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixFileExtensions - { - public const string CsHtml = ".cshtml"; - public const string Html = ".html"; - public const string Xml = ".xml"; - public const string Json = ".json"; - public const string Zip = ".zip"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixFolders.cs b/src/Mix.Cms.Lib/Constants/MixFolders.cs deleted file mode 100644 index 3eb4add19..000000000 --- a/src/Mix.Cms.Lib/Constants/MixFolders.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixFolders - { - public const string WebRootPath = "wwwroot"; - public const string TemplatesFolder = "Views/Shared/Templates"; - public const string JsonDataFolder = "MixContent/data"; - public const string MixCacheFolder = "MixContent/cache"; - public const string MixLogsFolder = "MixContent/logs"; - public const string ExportFolder = "mix-content/exports"; - public const string ImportFolder = "mix-content/imports/themes"; - public const string SiteContentAssetsFolder = "mix-content/assets"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Constants/MixRequestQueryKeywords.cs b/src/Mix.Cms.Lib/Constants/MixRequestQueryKeywords.cs deleted file mode 100644 index 55b50fbda..000000000 --- a/src/Mix.Cms.Lib/Constants/MixRequestQueryKeywords.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Mix.Cms.Lib.Constants -{ - public class MixRequestQueryKeywords - { - public const string FromDate = "fromDate"; - public const string ToDate = "toData"; - public const string Page = "page"; - public const string PageIndex = "pageIndex"; - public const string PageSize = "pageSize"; - public const string Direction = "direction"; - public const string OrderBy = "orderBy"; - public const string Status = "status"; - public const string DatabaseId = "databaseId"; - public const string DatabaseName = "databaseName"; - public const string Specificulture = "specificulture"; - public const string Keyword = "keyword"; - public const string ParentType = "parentType"; - public const string ParentId = "parentId"; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Controllers/BaseAuthorizedRestApiController.cs b/src/Mix.Cms.Lib/Controllers/BaseAuthorizedRestApiController.cs deleted file mode 100644 index 8fa9f29e1..000000000 --- a/src/Mix.Cms.Lib/Controllers/BaseAuthorizedRestApiController.cs +++ /dev/null @@ -1,578 +0,0 @@ -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Enums; -using Mix.Heart.Extensions; -using Mix.Heart.Helpers; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Controllers -{ - [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - [Produces("application/json")] - public class BaseAuthorizedRestApiController : Controller - where TDbContext : DbContext - where TModel : class - where TUpdate : ViewModelBase - where TRead : ViewModelBase - where TDelete : ViewModelBase - { - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected string _lang; - protected bool _forbidden; - - /// - /// The domain - /// - protected string _domain; - - #region Routes - - [HttpGet] - public virtual async Task>> Get() - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> getData = await DefaultRepository.Instance.GetModelListAsync( - request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet("{id}")] - public virtual async Task> Get(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return NoContent(); - } - } - - [HttpGet("duplicate/{id}")] - public virtual async Task> Duplicate(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - var data = getData.Data; - var idProperty = ReflectionHelper.GetPropertyType(data.GetType(), MixColumnName.Id); - switch (idProperty.Name.ToLower()) - { - case "int32": - ReflectionHelper.SetPropertyValue(data, new JProperty("id", 0)); - break; - - default: - ReflectionHelper.SetPropertyValue(data, new JProperty("id", default)); - break; - } - - var saveResult = await data.SaveModelAsync(true); - if (saveResult.IsSucceed) - { - string key = $"_{id}"; - key += !string.IsNullOrEmpty(_lang) ? $"_{_lang}" : string.Empty; - await MixCacheService.RemoveCacheAsync(typeof(TModel), key); - return Ok(saveResult.Data); - } - else - { - return BadRequest(saveResult.Errors); - } - } - else - { - return NoContent(); - } - } - - [HttpGet("default")] - public virtual ActionResult Default() - { - using (TDbContext context = UnitOfWorkHelper.InitContext()) - { - var transaction = context.Database.BeginTransaction(); - TUpdate data = ReflectionHelper.InitModel(); - ReflectionHelper.SetPropertyValue(data, new JProperty("Specificulture", _lang)); - ReflectionHelper.SetPropertyValue(data, new JProperty("Status", MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus))); - data.ExpandView(context, transaction); - return Ok(data); - } - } - - [HttpGet("remove-cache/{id}")] - public virtual async Task ClearCacheAsync(string id) - { - string key = $"_{id}"; - key += !string.IsNullOrEmpty(_lang) ? $"_{_lang}" : string.Empty; - await MixCacheService.RemoveCacheAsync(typeof(TModel), key); - return NoContent(); - } - - [HttpGet("remove-cache")] - public virtual async Task ClearCacheAsync() - { - await MixCacheService.RemoveCacheAsync(typeof(TModel)); - return NoContent(); - } - - [HttpPost] - public virtual async Task> Create([FromBody] TUpdate data) - { - ReflectionHelper.SetPropertyValue(data, new JProperty("CreatedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(data, new JProperty("Specificulture", _lang)); - ReflectionHelper.SetPropertyValue(data, new JProperty("Status", MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus))); - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPut("{id}")] - public virtual async Task Update(string id, [FromBody] TUpdate data) - { - if (data != null) - { - ReflectionHelper.SetPropertyValue(data, new JProperty("ModifiedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(data, new JProperty("LastModified", DateTime.UtcNow)); - var currentId = ReflectionHelper.GetPropertyValue(data, MixColumnName.Id).ToString(); - if (id != currentId) - { - return BadRequest(); - } - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - var current = await GetSingleAsync(currentId); - if (!current.IsSucceed) - { - return NotFound(); - } - else - { - return BadRequest(result.Errors); - } - } - } - else - { - return BadRequest(new NullReferenceException()); - } - } - - [HttpPatch("{id}")] - public virtual async Task Patch(string id, [FromBody] JObject fields) - { - var result = await GetSingleAsync(id); - if (result.IsSucceed) - { - ReflectionHelper.SetPropertyValue(result.Data, new JProperty("ModifiedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(result.Data, new JProperty("LastModified", DateTime.UtcNow)); - var saveResult = await result.Data.UpdateFieldsAsync(fields); - if (saveResult.IsSucceed) - { - return NoContent(); - } - else - { - return BadRequest(saveResult.Errors); - } - } - else - { - return NotFound(); - } - } - - [HttpDelete("{id}")] - public virtual async Task> Delete(string id) - { - var result = await DeleteAsync(id, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPost, HttpOptions] - [Route("list-action")] - public async Task> ListActionAsync([FromBody] ListAction data) - { - Expression> predicate = ReflectionHelper.GetExpression("Specificulture", _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - Expression> idPre = null; - foreach (var id in data.Data) - { - var temp = ReflectionHelper.GetExpression(MixColumnName.Id, id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - - idPre = idPre != null - ? idPre.AndAlso(temp) - : temp; - } - if (idPre != null) - { - predicate = predicate.AndAlso(idPre); - - switch (data.Action) - { - case "Delete": - return Ok(JObject.FromObject(await DeleteListAsync(predicate, true))); - - case "Publish": - return Ok(JObject.FromObject(await PublishListAsync(predicate))); - - case "Export": - return Ok(JObject.FromObject(await ExportListAsync(predicate))); - - default: - return JObject.FromObject(new RepositoryResponse()); - } - } - else - { - return BadRequest(); - } - } - - #endregion Routes - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - //remoteIp != "::1" && - (!allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) || - (exceptIps.Any(t => t.Value() == remoteIp)) - ) - { - _forbidden = true; - } - } - base.OnActionExecuting(context); - } - - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : string.Empty; - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - - #endregion Overrides - - #region Helpers - - private async Task>> PublishListAsync(Expression> predicate) - { - var data = await GetListAsync(predicate); - foreach (var item in data.Data.Items) - { - ReflectionHelper.SetPropertyValue(item, new JProperty("Status", MixContentStatus.Published)); - } - return await SaveListAsync(data.Data.Items, false); - } - - protected async Task> GetSingleAsync(string id) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression("Specificulture", _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(string id) - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression("Specificulture", _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> DeleteAsync(string id, bool isDeleteRelated = false) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - var data = await GetSingleAsync(id); - if (data.IsSucceed) - { - var result = await DeleteAsync(data.Data, isDeleteRelated); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(string id, bool isDeleteRelated = false) - { - var data = await GetSingleAsync(id); - if (data.IsSucceed) - { - var result = await DeleteAsync(data.Data, isDeleteRelated); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(TUpdate data, bool isDeleteRelated = false) - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(T data, bool isDeleteRelated = false) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task>> DeleteListAsync(Expression> predicate, bool isRemoveRelatedModel = false) - { - var data = await DefaultRepository.Instance.RemoveListModelAsync(isRemoveRelatedModel, predicate); - - return data; - } - - protected async Task> ExportListAsync(Expression> predicate) - { - string type = typeof(TModel).Name; - var getData = await DefaultRepository.Instance.GetModelListByAsync(predicate, _context); - var jData = new List(); - if (getData.IsSucceed) - { - string exportPath = $"{MixFolders.ExportFolder}/{typeof(TModel).Name}"; - foreach (var item in JArray.FromObject(getData.Data)) - { - jData.Add(JObject.FromObject(item)); - } - - var result = Lib.ViewModels.MixDatabaseDatas.Helper.ExportAttributeToExcel( - jData, string.Empty, exportPath, $"{type}", null); - - return result; - } - else - { - return new RepositoryResponse() - { - Errors = getData.Errors - }; - } - } - - protected async Task>> GetListAsync(Expression> predicate = null) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - return data; - } - - protected async Task> SaveAsync(T vm, bool isSaveSubModel) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - if (vm != null) - { - var result = await vm.SaveModelAsync(isSaveSubModel).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task> SavePropertiesAsync(JObject obj, Expression> predicate) - { - if (obj != null) - { - List fields = new List(); - Type type = typeof(TModel); - foreach (var item in obj.Properties()) - { - var propName = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(item.Name); - PropertyInfo propertyInfo = type.GetProperty(propName); - if (propertyInfo != null) - { - object val = Convert.ChangeType(item.Value, propertyInfo.PropertyType); - var field = new EntityField() - { - PropertyName = propName, - PropertyValue = val - }; - fields.Add(field); - } - } - - var result = await DefaultRepository.Instance.UpdateFieldsAsync(predicate, fields); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task>> SaveListAsync(List lstVm, bool isSaveSubModel) - { - var result = await DefaultRepository.Instance.SaveListModelAsync(lstVm, isSaveSubModel); - - return result; - } - - protected RepositoryResponse> SaveList(List lstVm, bool isSaveSubModel) - { - var result = new RepositoryResponse>() { IsSucceed = true }; - if (lstVm != null) - { - foreach (var vm in lstVm) - { - var tmp = vm.SaveModel(isSaveSubModel, - _context, _transaction); - result.IsSucceed = result.IsSucceed && tmp.IsSucceed; - if (!tmp.IsSucceed) - { - result.Exception = tmp.Exception; - result.Errors.AddRange(tmp.Errors); - } - } - return result; - } - - return result; - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Controllers/BaseReadOnlyApiController.cs b/src/Mix.Cms.Lib/Controllers/BaseReadOnlyApiController.cs deleted file mode 100644 index f0bd6a928..000000000 --- a/src/Mix.Cms.Lib/Controllers/BaseReadOnlyApiController.cs +++ /dev/null @@ -1,246 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Heart.Extensions; -using Mix.Heart.Helpers; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Controllers -{ - [Produces("application/json")] - public class BaseReadOnlyApiController : Controller - where TDbContext : DbContext - where TModel : class - where TView : Mix.Domain.Data.ViewModels.ViewModelBase - { - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected string _lang; - protected bool _forbidden; - - /// - /// The domain - /// - protected string _domain; - - #region Routes - - [HttpGet] - public virtual async Task>> Get() - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - Expression> predicate = null; - RepositoryResponse> getData = null; - if (!string.IsNullOrEmpty(_lang)) - { - predicate = ReflectionHelper.GetExpression(MixColumnName.Specificulture, _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - getData = await DefaultRepository.Instance.GetModelListByAsync( - predicate, - request.OrderBy, request.Direction, - request.PageSize, request.PageIndex, null, null) - .ConfigureAwait(false); - } - else - { - getData = await DefaultRepository.Instance.GetModelListAsync( - request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet("{id}")] - public virtual async Task> Get(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return NoContent(); - } - } - - [HttpGet("default")] - public virtual ActionResult Default() - { - using (TDbContext context = UnitOfWorkHelper.InitContext()) - { - var transaction = context.Database.BeginTransaction(); - TView data = ReflectionHelper.InitModel(); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Specificulture, _lang)); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Status, MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus))); - data.ExpandView(context, transaction); - return Ok(data); - } - } - - [HttpGet("remove-cache/{id}")] - public virtual async Task ClearCacheAsync(string id) - { - string key = $"_{id}"; - key += !string.IsNullOrEmpty(_lang) ? $"_{_lang}" : string.Empty; - await MixCacheService.RemoveCacheAsync(typeof(TModel), key); - return NoContent(); - } - - [HttpGet("remove-cache")] - public virtual async Task ClearCacheAsync() - { - await MixCacheService.RemoveCacheAsync(typeof(TModel)); - return NoContent(); - } - - #endregion Routes - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - //remoteIp != "::1" && - (!allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) || - (exceptIps.Any(t => t.Value() == remoteIp)) - ) - { - _forbidden = true; - } - } - base.OnActionExecuting(context); - } - - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : string.Empty; - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - - #endregion Overrides - - #region Helpers - - protected async Task> GetSingleAsync(string id) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression(MixColumnName.Specificulture, _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(string id) - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression(MixColumnName.Specificulture, _lang, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - where T : Mix.Domain.Data.ViewModels.ViewModelBase - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task>> GetListAsync(Expression> predicate = null) - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - return data; - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Controllers/BaseRestApiController .cs b/src/Mix.Cms.Lib/Controllers/BaseRestApiController .cs deleted file mode 100644 index 52b3e6310..000000000 --- a/src/Mix.Cms.Lib/Controllers/BaseRestApiController .cs +++ /dev/null @@ -1,577 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Enums; -using Mix.Heart.Extensions; -using Mix.Heart.Helpers; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Controllers -{ - [Produces("application/json")] - public class BaseRestApiController : Controller - where TDbContext : DbContext - where TModel : class - where TView : ViewModelBase - { - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected string _lang; - protected bool _forbidden; - - /// - /// The domain - /// - protected string _domain; - - #region Routes - - [HttpGet] - public virtual async Task>> Get() - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> getData = await DefaultRepository.Instance.GetModelListAsync( - request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - [HttpGet("{id}")] - public virtual async Task> Get(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return NoContent(); - } - } - - [HttpGet("duplicate/{id}")] - public virtual async Task> Duplicate(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - var data = getData.Data; - var idProperty = ReflectionHelper.GetPropertyType(data.GetType(), MixColumnName.Id); - switch (idProperty.Name.ToLower()) - { - case "int32": - ReflectionHelper.SetPropertyValue(data, new JProperty("id", 0)); - break; - - default: - ReflectionHelper.SetPropertyValue(data, new JProperty("id", default)); - break; - } - - var saveResult = await data.SaveModelAsync(true); - if (saveResult.IsSucceed) - { - string key = $"_{id}"; - key += !string.IsNullOrEmpty(_lang) ? $"_{_lang}" : string.Empty; - await MixCacheService.RemoveCacheAsync(typeof(TModel), key); - return Ok(saveResult.Data); - } - else - { - return BadRequest(saveResult.Errors); - } - } - else - { - return NoContent(); - } - } - - [HttpGet("default")] - public virtual ActionResult Default() - { - using (TDbContext context = UnitOfWorkHelper.InitContext()) - { - var transaction = context.Database.BeginTransaction(); - TView data = ReflectionHelper.InitModel(); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Specificulture, _lang)); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Status, MixService.GetConfig(MixAppSettingKeywords.DefaultContentStatus))); - data.ExpandView(context, transaction); - return Ok(data); - } - } - - [HttpGet("remove-cache/{id}")] - public virtual async Task ClearCacheAsync(string id) - { - string key = $"_{id}"; - key += !string.IsNullOrEmpty(_lang) ? $"_{_lang}" : string.Empty; - await MixCacheService.RemoveCacheAsync(typeof(TModel), key); - return NoContent(); - } - - [HttpGet("remove-cache")] - public virtual async Task ClearCacheAsync() - { - await MixCacheService.RemoveCacheAsync(typeof(TModel)); - return NoContent(); - } - - [HttpPost] - public virtual async Task> Create([FromBody] TView data) - { - ReflectionHelper.SetPropertyValue(data, new JProperty("CreatedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Specificulture, _lang)); - ReflectionHelper.SetPropertyValue(data, new JProperty(MixColumnName.Status, MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus))); - - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPut("{id}")] - public virtual async Task Update(string id, [FromBody] TView data) - { - if (data != null) - { - ReflectionHelper.SetPropertyValue(data, new JProperty("ModifiedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(data, new JProperty("LastModified", DateTime.UtcNow)); - var currentId = ReflectionHelper.GetPropertyValue(data, MixColumnName.Id).ToString(); - if (id != currentId) - { - return BadRequest(); - } - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - var current = await GetSingleAsync(currentId); - if (!current.IsSucceed) - { - return NotFound(); - } - else - { - return BadRequest(result.Errors); - } - } - } - else - { - return BadRequest(new NullReferenceException()); - } - } - - [HttpPatch("{id}")] - public virtual async Task Patch(string id, [FromBody] JObject fields) - { - var result = await GetSingleAsync(id); - if (result.IsSucceed) - { - ReflectionHelper.SetPropertyValue(result.Data, new JProperty("ModifiedBy", User.Claims.FirstOrDefault( - c => c.Type == "Username")?.Value)); - ReflectionHelper.SetPropertyValue(result.Data, new JProperty("LastModified", DateTime.UtcNow)); - var saveResult = await result.Data.UpdateFieldsAsync(fields); - if (saveResult.IsSucceed) - { - return NoContent(); - } - else - { - return BadRequest(saveResult.Errors); - } - } - else - { - return NotFound(); - } - } - - [HttpDelete("{id}")] - public virtual async Task> Delete(string id) - { - var result = await DeleteAsync(id, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpPost, HttpOptions] - [Route("list-action")] - public async Task> ListActionAsync([FromBody] ListAction data) - { - Expression> predicate = ReflectionHelper.GetExpression( - MixColumnName.Specificulture, - _lang, - MixHeartEnums.ExpressionMethod.Eq); - Expression> idPre = null; - foreach (var id in data.Data) - { - var temp = ReflectionHelper.GetExpression(MixColumnName.Id, id, MixHeartEnums.ExpressionMethod.Eq); - - idPre = idPre != null - ? idPre.AndAlso(temp) - : temp; - } - if (idPre != null) - { - predicate = predicate.AndAlso(idPre); - - switch (data.Action) - { - case "Delete": - return Ok(JObject.FromObject(await DeleteListAsync(predicate, true))); - - case "Publish": - return Ok(JObject.FromObject(await PublishListAsync(predicate))); - - case "Export": - return Ok(JObject.FromObject(await ExportListAsync(predicate))); - - default: - return JObject.FromObject(new RepositoryResponse()); - } - } - else - { - return BadRequest(); - } - } - - #endregion Routes - - #region Overrides - - /// - /// Called before the action method is invoked. - /// - /// The action executing context. - public override void OnActionExecuting(ActionExecutingContext context) - { - GetLanguage(); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - //remoteIp != "::1" && - (!allowedIps.Any(t => t.Value() == "*") && !allowedIps.Contains(remoteIp)) || - (exceptIps.Any(t => t.Value() == remoteIp)) - ) - { - _forbidden = true; - } - } - base.OnActionExecuting(context); - } - - protected void GetLanguage() - { - _lang = RouteData?.Values["culture"] != null ? RouteData.Values["culture"].ToString() : string.Empty; - _domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - } - - #endregion Overrides - - #region Helpers - - private async Task>> PublishListAsync(Expression> predicate) - { - var data = await GetListAsync(predicate); - foreach (var item in data.Data.Items) - { - ReflectionHelper.SetPropertyValue(item, new JProperty(MixColumnName.Status, MixContentStatus.Published)); - } - return await SaveListAsync(data.Data.Items, false); - } - - protected async Task> GetSingleAsync(string id) - where T : ViewModelBase - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression(MixColumnName.Specificulture, _lang, MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(string id) - { - Expression> predicate = ReflectionHelper.GetExpression(MixColumnName.Id, id, MixHeartEnums.ExpressionMethod.Eq); - if (!string.IsNullOrEmpty(_lang)) - { - var idPre = ReflectionHelper.GetExpression(MixColumnName.Specificulture, _lang, MixHeartEnums.ExpressionMethod.Eq); - predicate = predicate.AndAlso(idPre); - } - - return await GetSingleAsync(predicate); - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - where T : ViewModelBase - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> DeleteAsync(string id, bool isDeleteRelated = false) - where T : ViewModelBase - { - var data = await GetSingleAsync(id); - if (data.IsSucceed) - { - var result = await DeleteAsync(data.Data, isDeleteRelated); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(string id, bool isDeleteRelated = false) - { - var data = await GetSingleAsync(id); - if (data.IsSucceed) - { - var result = await DeleteAsync(data.Data, isDeleteRelated); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(TView data, bool isDeleteRelated = false) - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(T data, bool isDeleteRelated = false) - where T : ViewModelBase - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task>> DeleteListAsync(Expression> predicate, bool isRemoveRelatedModel = false) - { - var data = await DefaultRepository.Instance.RemoveListModelAsync(isRemoveRelatedModel, predicate); - - return data; - } - - protected async Task> ExportListAsync(Expression> predicate) - { - string type = typeof(TModel).Name; - var getData = await DefaultRepository.Instance.GetModelListByAsync(predicate, _context); - var jData = new List(); - if (getData.IsSucceed) - { - string exportPath = $"{MixFolders.ExportFolder}/{typeof(TModel).Name}"; - foreach (var item in JArray.FromObject(getData.Data)) - { - jData.Add(JObject.FromObject(item)); - } - - var result = Lib.ViewModels.MixDatabaseDatas.Helper.ExportAttributeToExcel( - jData, string.Empty, exportPath, $"{type}", null); - - return result; - } - else - { - return new RepositoryResponse() - { - Errors = getData.Errors - }; - } - } - - protected async Task>> GetListAsync(Expression> predicate = null) - where T : ViewModelBase - { - bool isFromDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.FromDate], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query[MixRequestQueryKeywords.ToDate], out DateTime toDate); - int.TryParse(Request.Query[MixRequestQueryKeywords.PageIndex], out int pageIndex); - bool isDirection = Enum.TryParse(Request.Query[MixRequestQueryKeywords.Direction], out MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query[MixRequestQueryKeywords.OrderBy].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - return data; - } - - protected async Task> SaveAsync(T vm, bool isSaveSubModel) - where T : ViewModelBase - { - if (vm != null) - { - var result = await vm.SaveModelAsync(isSaveSubModel).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task> SavePropertiesAsync(JObject obj, Expression> predicate) - { - if (obj != null) - { - List fields = new List(); - Type type = typeof(TModel); - foreach (var item in obj.Properties()) - { - var propName = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(item.Name); - PropertyInfo propertyInfo = type.GetProperty(propName); - if (propertyInfo != null) - { - object val = Convert.ChangeType(item.Value, propertyInfo.PropertyType); - var field = new EntityField() - { - PropertyName = propName, - PropertyValue = val - }; - fields.Add(field); - } - } - - var result = await DefaultRepository.Instance.UpdateFieldsAsync(predicate, fields); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task>> SaveListAsync(List lstVm, bool isSaveSubModel) - { - var result = await DefaultRepository.Instance.SaveListModelAsync(lstVm, isSaveSubModel); - - return result; - } - - protected RepositoryResponse> SaveList(List lstVm, bool isSaveSubModel) - { - var result = new RepositoryResponse>() { IsSucceed = true }; - if (lstVm != null) - { - foreach (var vm in lstVm) - { - var tmp = vm.SaveModel(isSaveSubModel, - _context, _transaction); - result.IsSucceed = result.IsSucceed && tmp.IsSucceed; - if (!tmp.IsSucceed) - { - result.Exception = tmp.Exception; - result.Errors.AddRange(tmp.Errors); - } - } - return result; - } - - return result; - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixContentStatus.cs b/src/Mix.Cms.Lib/Enums/MixContentStatus.cs deleted file mode 100644 index 45aaa4cc3..000000000 --- a/src/Mix.Cms.Lib/Enums/MixContentStatus.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixContentStatus - { - Deleted, - Preview, - Published, - Draft, - Schedule - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixDatabaseParentType.cs b/src/Mix.Cms.Lib/Enums/MixDatabaseParentType.cs deleted file mode 100644 index ecb4505cb..000000000 --- a/src/Mix.Cms.Lib/Enums/MixDatabaseParentType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixDatabaseParentType - { - Set, - Post, - Page, - Module, - User - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixDatabaseProvider.cs b/src/Mix.Cms.Lib/Enums/MixDatabaseProvider.cs deleted file mode 100644 index 77c741720..000000000 --- a/src/Mix.Cms.Lib/Enums/MixDatabaseProvider.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixDatabaseProvider - { - MSSQL, - MySQL, - PostgreSQL, - SQLITE - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixDatabaseType.cs b/src/Mix.Cms.Lib/Enums/MixDatabaseType.cs deleted file mode 100644 index 1fd35eb4b..000000000 --- a/src/Mix.Cms.Lib/Enums/MixDatabaseType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixDatabaseType - { - System, - Service - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixMenuItemType.cs b/src/Mix.Cms.Lib/Enums/MixMenuItemType.cs deleted file mode 100644 index 9a49fe3ac..000000000 --- a/src/Mix.Cms.Lib/Enums/MixMenuItemType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixMenuItemType - { - Page, - Module, - Post, - Database, - Uri - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixModuleType.cs b/src/Mix.Cms.Lib/Enums/MixModuleType.cs deleted file mode 100644 index 53917bcb2..000000000 --- a/src/Mix.Cms.Lib/Enums/MixModuleType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixModuleType - { - Content, - Data, - ListPost - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixMvcViewMode.cs b/src/Mix.Cms.Lib/Enums/MixMvcViewMode.cs deleted file mode 100644 index 03438f2c2..000000000 --- a/src/Mix.Cms.Lib/Enums/MixMvcViewMode.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixMvcViewMode - { - Post, - Page, - Module - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixUrlAliasType.cs b/src/Mix.Cms.Lib/Enums/MixUrlAliasType.cs deleted file mode 100644 index dcb0de608..000000000 --- a/src/Mix.Cms.Lib/Enums/MixUrlAliasType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixUrlAliasType - { - Page, - Post, - Product, - Module, - ModuleData - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Enums/MixUserStatus.cs b/src/Mix.Cms.Lib/Enums/MixUserStatus.cs deleted file mode 100644 index d52988653..000000000 --- a/src/Mix.Cms.Lib/Enums/MixUserStatus.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Mix.Cms.Lib.Enums -{ - public enum MixUserStatus - { - Active, - Deactive - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Extensions/MixAttributeValueModelExtensions.cs b/src/Mix.Cms.Lib/Extensions/MixAttributeValueModelExtensions.cs deleted file mode 100644 index 07b4bdddd..000000000 --- a/src/Mix.Cms.Lib/Extensions/MixAttributeValueModelExtensions.cs +++ /dev/null @@ -1,253 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; - -namespace Mix.Cms.Lib.Extensions -{ - public static class MixDatabaseDataValueModelExtensions - { - public static JProperty ToJProperty( - this MixDatabaseDataValue item, - MixCmsContext _context, - IDbContextTransaction _transaction) - { - switch (item.DataType) - { - case MixDataType.DateTime: - return new JProperty(item.MixDatabaseColumnName, item.DateTimeValue); - - case MixDataType.Date: - if (!item.DateTimeValue.HasValue) - { - if (DateTime.TryParseExact( - item.StringValue, - "MM/dd/yyyy HH:mm:ss", - CultureInfo.InvariantCulture, - DateTimeStyles.RoundtripKind, - out DateTime date)) - { - item.DateTimeValue = date; - } - } - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Time: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Double: - return (new JProperty(item.MixDatabaseColumnName, item.DoubleValue ?? 0)); - - case MixDataType.Boolean: - return (new JProperty(item.MixDatabaseColumnName, item.BooleanValue)); - - case MixDataType.Integer: - return (new JProperty(item.MixDatabaseColumnName, item.IntegerValue ?? 0)); - - case MixDataType.Reference: - return (new JProperty(item.MixDatabaseColumnName, new JArray())); - - case MixDataType.Upload: - string domain = MixService.GetConfig(MixAppSettingKeywords.Domain); - string url = !string.IsNullOrEmpty(item.StringValue) - ? !item.StringValue.Contains(domain) - ? $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}{item.StringValue}" - : item.StringValue - : null; - return (new JProperty(item.MixDatabaseColumnName, url)); - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - return (new JProperty(item.MixDatabaseColumnName, item.StringValue)); - } - } - - public static void ToModelValue(this ViewModels.MixDatabaseDataValues.UpdateViewModel item, - JToken property, - MixCmsContext _context = null, - IDbContextTransaction _transaction = null) - { - if (property == null) - { - return; - } - - if (item.Field.IsEncrypt) - { - var obj = property.Value(); - item.StringValue = obj.ToString(Formatting.None); - item.EncryptValue = obj["data"]?.ToString(); - item.EncryptKey = obj["key"]?.ToString(); - } - else - { - switch (item.Field.DataType) - { - case MixDataType.DateTime: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Date: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Time: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Double: - item.DoubleValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Boolean: - item.BooleanValue = property.Value(); - item.StringValue = property.Value()?.ToLower(); - break; - - case MixDataType.Integer: - item.IntegerValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Reference: - item.StringValue = property.Value(); - break; - - case MixDataType.Upload: - string mediaData = property.Value(); - if (mediaData.IsBase64()) - { - ViewModels.MixMedias.UpdateViewModel media = new ViewModels.MixMedias.UpdateViewModel() - { - Specificulture = item.Specificulture, - Status = MixContentStatus.Published, - MediaFile = new FileViewModel() - { - FileStream = mediaData, - Extension = ".png", - Filename = Guid.NewGuid().ToString(), - FileFolder = "Attributes" - } - }; - var saveMedia = media.SaveModel(true, _context, _transaction); - if (saveMedia.IsSucceed) - { - item.StringValue = saveMedia.Data.FullPath; - } - } - else - { - item.StringValue = mediaData; - } - break; - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - item.StringValue = property.Value(); - break; - } - } - } - - public static void LoadAllReferenceData(this JObject obj - , string dataId, int mixDatabaseId, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, - out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var refFields = context.MixDatabaseColumn.Where( - m => m.MixDatabaseId == mixDatabaseId - && m.DataType == MixDataType.Reference).ToList(); - - foreach (var item in refFields) - { - JArray arr = GetRelatedData(item.ReferenceId.Value, dataId, culture, _context, _transaction); - - if (obj.ContainsKey(item.Name)) - { - obj[item.Name] = arr; - } - else - { - obj.Add(new JProperty(item.Name, arr)); - } - } - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - } - - private static JArray GetRelatedData(int referenceId, string dataId, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, - out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - Expression> predicate = model => - (model.MixDatabaseId == referenceId) - && (model.ParentId == dataId && model.ParentType == MixDatabaseParentType.Set) - && model.Specificulture == culture - ; - var getData = ViewModels.MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetModelListBy(predicate, context, transaction); - - JArray arr = new JArray(); - foreach (var nav in getData.Data.OrderBy(v => v.Priority)) - { - arr.Add(nav.Data.Obj); - } - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - return arr; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Extensions/ModelBuilderExtensions.cs b/src/Mix.Cms.Lib/Extensions/ModelBuilderExtensions.cs deleted file mode 100644 index 8c0715cab..000000000 --- a/src/Mix.Cms.Lib/Extensions/ModelBuilderExtensions.cs +++ /dev/null @@ -1,501 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Models.Account; -using System; -using System.Linq; -using System.Reflection; - -namespace Mix.Cms.Lib.Extensions -{ - public static class ModelBuilderExtensions - { - public static ModelBuilder ApplyAllConfigurationsFromNamespace( - this ModelBuilder modelBuilder, Assembly assembly, string ns) - { - var applyGenericMethod = typeof(ModelBuilder) - .GetMethods(BindingFlags.Instance | BindingFlags.Public) - .Single(m => m.Name == nameof(ModelBuilder.ApplyConfiguration) - && m.GetParameters().Count() == 1 - && m.GetParameters().Single().ParameterType.GetGenericTypeDefinition() == typeof(IEntityTypeConfiguration<>)); - foreach (var type in assembly.GetTypes() - .Where(c => c.IsClass && !c.IsAbstract && !c.ContainsGenericParameters - && c.Namespace == ns - )) - { - foreach (var iface in type.GetInterfaces()) - { - if (iface.IsConstructedGenericType && iface.GetGenericTypeDefinition() == typeof(IEntityTypeConfiguration<>)) - { - var applyConcreteMethod = applyGenericMethod.MakeGenericMethod(iface.GenericTypeArguments[0]); - applyConcreteMethod.Invoke(modelBuilder, new object[] { Activator.CreateInstance(type) }); - break; - } - } - } - return modelBuilder; - } - - public static ModelBuilder ApplyPostgresIddentityConfigurations(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.RoleId); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.ClaimType).HasMaxLength(400); - - entity.Property(e => e.ClaimValue).HasMaxLength(400); - - entity.Property(e => e.RoleId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.Role) - .WithMany(p => p.AspNetRoleClaims) - .HasForeignKey(d => d.RoleId); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.NormalizedName) - .HasDatabaseName("RoleNameIndex") - .IsUnique() - .HasFilter("([NormalizedName] IS NOT NULL)"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ConcurrencyStamp) - .HasColumnType("varchar(400)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Name).HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.NormalizedName).HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.UserId); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.Property(e => e.ClaimType).HasMaxLength(400); - - entity.Property(e => e.ClaimValue).HasMaxLength(400); - - entity.Property(e => e.UserId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserClaimsApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserClaimsUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.LoginProvider, e.ProviderKey }) - .HasName("PK_AspNetUserLogins_1"); - - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.UserId); - - entity.Property(e => e.LoginProvider).HasMaxLength(50); - - entity.Property(e => e.ProviderKey).HasMaxLength(50); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.Property(e => e.ProviderDisplayName).HasMaxLength(400); - - entity.Property(e => e.UserId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserLoginsApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserLoginsUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.UserId, e.RoleId }); - - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.RoleId); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserRolesApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.Role) - .WithMany(p => p.AspNetUserRoles) - .HasForeignKey(d => d.RoleId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserRolesUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.UserId, e.LoginProvider, e.Name }); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.LoginProvider).HasMaxLength(50); - - entity.Property(e => e.Name).HasMaxLength(50); - - entity.Property(e => e.Value).HasMaxLength(400); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserTokens) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.NormalizedEmail) - .HasDatabaseName("EmailIndex"); - - entity.HasIndex(e => e.NormalizedUserName) - .HasDatabaseName("UserNameIndex") - .IsUnique() - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.Avatar).HasMaxLength(250); - - entity.Property(e => e.ConcurrencyStamp).HasMaxLength(250); - - entity.Property(e => e.Culture).HasMaxLength(50); - - entity.Property(e => e.Dob) - .HasColumnName("DOB") - .HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Email).HasMaxLength(250); - - entity.Property(e => e.FirstName).HasMaxLength(50); - - entity.Property(e => e.Gender).HasMaxLength(50); - - entity.Property(e => e.JoinDate).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastName).HasMaxLength(50); - - entity.Property(e => e.LockoutEnd).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy).HasMaxLength(250); - - entity.Property(e => e.NickName).HasMaxLength(50); - - entity.Property(e => e.NormalizedEmail).HasMaxLength(250); - - entity.Property(e => e.NormalizedUserName).HasMaxLength(250); - - entity.Property(e => e.PasswordHash).HasMaxLength(250); - - entity.Property(e => e.PhoneNumber).HasMaxLength(50); - - entity.Property(e => e.RegisterType).HasMaxLength(50); - - entity.Property(e => e.SecurityStamp).HasMaxLength(50); - - entity.Property(e => e.UserName).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.AllowedOrigin).HasMaxLength(100); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(100); - - entity.Property(e => e.Secret) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.ClientId).HasMaxLength(50); - - entity.Property(e => e.Email) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.ExpiresUtc).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.IssuedUtc).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Username).HasMaxLength(250); - }); - return modelBuilder; - } - - public static ModelBuilder ApplyIddentityConfigurations(this ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.RoleId); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.ClaimType).HasMaxLength(400); - - entity.Property(e => e.ClaimValue).HasMaxLength(400); - - entity.Property(e => e.RoleId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.Role) - .WithMany(p => p.AspNetRoleClaims) - .HasForeignKey(d => d.RoleId); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.NormalizedName) - .HasDatabaseName("RoleNameIndex") - .IsUnique() - .HasFilter("([NormalizedName] IS NOT NULL)"); - - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.ConcurrencyStamp).HasMaxLength(400); - - entity.Property(e => e.Name).HasMaxLength(250); - - entity.Property(e => e.NormalizedName).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.UserId); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.Property(e => e.ClaimType).HasMaxLength(400); - - entity.Property(e => e.ClaimValue).HasMaxLength(400); - - entity.Property(e => e.UserId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserClaimsApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserClaimsUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.LoginProvider, e.ProviderKey }) - .HasName("PK_AspNetUserLogins_1"); - - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.UserId); - - entity.Property(e => e.LoginProvider).HasMaxLength(50); - - entity.Property(e => e.ProviderKey).HasMaxLength(50); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.Property(e => e.ProviderDisplayName).HasMaxLength(400); - - entity.Property(e => e.UserId) - .IsRequired() - .HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserLoginsApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserLoginsUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.UserId, e.RoleId }); - - entity.HasIndex(e => e.ApplicationUserId); - - entity.HasIndex(e => e.RoleId); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.ApplicationUserId).HasMaxLength(50); - - entity.HasOne(d => d.ApplicationUser) - .WithMany(p => p.AspNetUserRolesApplicationUser) - .HasForeignKey(d => d.ApplicationUserId); - - entity.HasOne(d => d.Role) - .WithMany(p => p.AspNetUserRoles) - .HasForeignKey(d => d.RoleId); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserRolesUser) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.UserId, e.LoginProvider, e.Name }); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.LoginProvider).HasMaxLength(50); - - entity.Property(e => e.Name).HasMaxLength(50); - - entity.Property(e => e.Value).HasMaxLength(400); - - entity.HasOne(d => d.User) - .WithMany(p => p.AspNetUserTokens) - .HasForeignKey(d => d.UserId); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.NormalizedEmail) - .HasDatabaseName("EmailIndex"); - - entity.HasIndex(e => e.NormalizedUserName) - .HasDatabaseName("UserNameIndex") - .IsUnique() - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.Avatar).HasMaxLength(250); - - entity.Property(e => e.ConcurrencyStamp).HasMaxLength(250); - - entity.Property(e => e.Culture).HasMaxLength(50); - - entity.Property(e => e.Dob) - .HasColumnName("DOB") - .HasColumnType("datetime"); - - entity.Property(e => e.Email).HasMaxLength(250); - - entity.Property(e => e.FirstName).HasMaxLength(50); - - entity.Property(e => e.Gender).HasMaxLength(50); - - entity.Property(e => e.JoinDate).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.LastName).HasMaxLength(50); - - entity.Property(e => e.LockoutEnd).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy).HasMaxLength(250); - - entity.Property(e => e.NickName).HasMaxLength(50); - - entity.Property(e => e.NormalizedEmail).HasMaxLength(250); - - entity.Property(e => e.NormalizedUserName).HasMaxLength(250); - - entity.Property(e => e.PasswordHash).HasMaxLength(250); - - entity.Property(e => e.PhoneNumber).HasMaxLength(50); - - entity.Property(e => e.RegisterType).HasMaxLength(50); - - entity.Property(e => e.SecurityStamp).HasMaxLength(50); - - entity.Property(e => e.UserName).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.AllowedOrigin).HasMaxLength(100); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(100); - - entity.Property(e => e.Secret) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Id).HasMaxLength(50); - - entity.Property(e => e.ClientId).HasMaxLength(50); - - entity.Property(e => e.Email) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.ExpiresUtc).HasColumnType("datetime"); - - entity.Property(e => e.IssuedUtc).HasColumnType("datetime"); - - entity.Property(e => e.Username).HasMaxLength(250); - }); - return modelBuilder; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Extensions/ServiceCollectionExtensions.cs b/src/Mix.Cms.Lib/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 2e84f7baf..000000000 --- a/src/Mix.Cms.Lib/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Mix.Cms.Lib.Controllers; -using Mix.Heart.NetCore; -using System.Reflection; - -namespace Mix.Cms.Lib.Extensions -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddMyGraphQL(this IServiceCollection services) - { - services.AddSignalR(); - return services; - } - - public static IServiceCollection AddGenerateApis(this IServiceCollection services) - { - services.AddGeneratedRestApi(Assembly.GetExecutingAssembly(), typeof(BaseRestApiController<,,>)); - services.AddSignalR(); - return services; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Extensions/UrlHelperExtensions.cs b/src/Mix.Cms.Lib/Extensions/UrlHelperExtensions.cs deleted file mode 100644 index 469e412fc..000000000 --- a/src/Mix.Cms.Lib/Extensions/UrlHelperExtensions.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using System; - -namespace Mix.Cms.Lib.Extensions -{ - /// - /// extension methods. - /// - public static class MixUrlHelperExtensions - { - /// - /// Generates a fully qualified URL to an action method by using the specified action name, controller name and - /// route values. - /// - /// The URL helper. - /// The name of the action method. - /// The name of the controller. - /// The route values. - /// The absolute URL. - public static string AbsoluteAction( - this IUrlHelper url, - string actionName, - string controllerName, - object routeValues = null) - { - return url.Action(actionName, controllerName, routeValues, url.ActionContext.HttpContext.Request.Scheme); - } - - /// - /// Generates a fully qualified URL to the specified content by using the specified content path. Converts a - /// virtual (relative) path to an application absolute path. - /// - /// The URL helper. - /// The content path. - /// The absolute URL. - public static string AbsoluteContent( - this IUrlHelper url, - string contentPath) - { - HttpRequest request = url.ActionContext.HttpContext.Request; - return new Uri(new Uri(request.Scheme + "://" + request.Host.Value), url.Content(contentPath)).ToString(); - } - - /// - /// Generates a fully qualified URL to the specified route by using the route name and route values. - /// - /// The URL helper. - /// Name of the route. - /// The route values. - /// The absolute URL. - public static string AbsoluteRouteUrl( - this IUrlHelper url, - string routeName, - object routeValues = null) - { - return url.RouteUrl(routeName, routeValues, url.ActionContext.HttpContext.Request.Scheme); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Helpers/MixAttributeSetValueHelper.cs b/src/Mix.Cms.Lib/Helpers/MixAttributeSetValueHelper.cs deleted file mode 100644 index e03a85bf0..000000000 --- a/src/Mix.Cms.Lib/Helpers/MixAttributeSetValueHelper.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Helpers -{ - internal class MixDatabaseDataValueHelper - { - public static async Task>> FilterByOtherValueAsync( - string culture, string mixDatabaseName - , string filterType, Dictionary queries - , string responseName - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - Expression> valPredicate = m => m.MixDatabaseName == mixDatabaseName; - RepositoryResponse> result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new List() - }; - foreach (var fieldQuery in queries) - { - Expression> pre = GetValueFilter(filterType, fieldQuery.Key, fieldQuery.Value); - valPredicate = valPredicate.AndAlso(pre); - } - var query = context.MixDatabaseDataValue.Where(valPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - if (query != null) - { - Expression> predicate = - m => dataIds.Any(id => m.DataId == id) && - m.MixDatabaseColumnName == responseName; - result = await DefaultRepository.Instance.GetModelListByAsync( - predicate, context, transaction); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private static Expression> GetValueFilter(string filterType, string key, string value) - { - switch (filterType) - { - case "equal": - return m => m.MixDatabaseColumnName == key - && (EF.Functions.Like(m.StringValue, $"{value}")); - - case "contain": - return m => m.MixDatabaseColumnName == key && - (EF.Functions.Like(m.StringValue, $"%{value}%")); - } - return null; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Helpers/MixCmsHelper.cs b/src/Mix.Cms.Lib/Helpers/MixCmsHelper.cs deleted file mode 100644 index 435a16c51..000000000 --- a/src/Mix.Cms.Lib/Helpers/MixCmsHelper.cs +++ /dev/null @@ -1,539 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Models.Common; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Enums; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Helpers -{ - public class MixCmsHelper - { - public static string GetSEOString(string input) - { - return SeoHelper.GetSEOString(input); - } - - public static FileViewModel LoadDataFile(string folder, string name) - { - return MixFileRepository.Instance.GetFile(name, folder, true, "[]"); - } - - public static string GetAssetFolder(string culture = null) - { - culture ??= MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - return $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/" + - $"{MixFolders.SiteContentAssetsFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, culture)}/assets"; - } - - public static string GetUploadFolder(string culture = null) - { - culture ??= MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - return $"{MixFolders.SiteContentAssetsFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, culture)}/uploads/" + - $"{DateTime.UtcNow.ToString(MixConstants.CONST_UPLOAD_FOLDER_DATE_FORMAT)}"; - } - - public static string GetTemplateFolder(string culture) - { - return $"/{MixFolders.TemplatesFolder}/{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, culture)}"; - } - - public static T Property(JObject obj, string fieldName) - { - if (obj != null && obj.ContainsKey(fieldName) && obj[fieldName] != null) - { - return obj.Value(fieldName); - } - else - { - return default(T); - } - } - - public static string GetRouterUrl(object routeValues, HttpRequest request, IUrlHelper Url) - { - Type objType = routeValues.GetType(); - string url = ""; - foreach (PropertyInfo prop in objType.GetProperties()) - { - string name = prop.Name; - var value = prop.GetValue(routeValues, null).ToString(); - url += $"/{value}"; - } - return string.Format("{0}://{1}{2}", request.Scheme, request.Host, - url - ); - } - - public static string FormatPrice(double? price, string oldPrice = "0") - { - string strPrice = price?.ToString(); - if (string.IsNullOrEmpty(strPrice)) - { - return "0"; - } - string s1 = strPrice.Replace(",", string.Empty); - if (CheckIsPrice(s1)) - { - Regex rgx = new Regex("(\\d+)(\\d{3})"); - while (rgx.IsMatch(s1)) - { - s1 = rgx.Replace(s1, "$1" + "," + "$2"); - } - return s1; - } - return oldPrice; - } - - public static bool CheckIsPrice(string number) - { - if (number == null) - { - return false; - } - number = number.Replace(",", ""); - return double.TryParse(number, out _); - } - - public static double ReversePrice(string formatedPrice) - { - try - { - if (string.IsNullOrEmpty(formatedPrice)) - { - return 0; - } - return double.Parse(formatedPrice.Replace(",", string.Empty)); - } - catch - { - return 0; - } - } - - public static void LogException(Exception ex) - { - string fullPath = string.Format($"{Environment.CurrentDirectory}/logs"); - if (!string.IsNullOrEmpty(fullPath) && !Directory.Exists(fullPath)) - { - Directory.CreateDirectory(fullPath); - } - string filePath = $"{fullPath}/{DateTime.Now.ToString("YYYYMMDD")}/log_exceptions.json"; - - try - { - FileInfo file = new FileInfo(filePath); - string content = "[]"; - if (file.Exists) - { - using (StreamReader s = file.OpenText()) - { - content = s.ReadToEnd(); - } - File.Delete(filePath); - } - - JArray arrExceptions = JArray.Parse(content); - JObject jex = new JObject - { - new JProperty("CreatedDateTime", DateTime.UtcNow), - new JProperty("Details", JObject.FromObject(ex)) - }; - arrExceptions.Add(jex); - content = arrExceptions.ToString(); - - using (var writer = File.CreateText(filePath)) - { - writer.WriteLine(content); - } - } - catch - { - // File invalid - } - } - - public static System.Threading.Tasks.Task GetModuleAsync(string name, string culture, IUrlHelper url = null) - { - var cacheKey = $"vm_{culture}_module_{name}_mvc"; - var module = new Domain.Core.ViewModels.RepositoryResponse(); - - // If not cached yet => load from db - if (module == null || !module.IsSucceed) - { - module = ViewModels.MixModules.ReadMvcViewModel.GetBy(m => m.Name == name && m.Specificulture == culture); - } - - // If load successful => load details - - return Task.FromResult(module.Data); - } - - public static async System.Threading.Tasks.Task GetPageAsync(int id, string culture) - { - RepositoryResponse getPage = null; - if (getPage == null) - { - getPage = await ViewModels.MixPages.ReadMvcViewModel.Repository.GetSingleModelAsync(m => m.Id == id && m.Specificulture == culture); - } - - return getPage.Data; - } - - public static ViewModels.MixModules.ReadMvcViewModel GetModule(string name, string culture) - { - var module = ViewModels.MixModules.ReadMvcViewModel.GetBy(m => m.Name == name && m.Specificulture == culture); - return module.Data; - } - - public static ViewModels.MixPages.ReadMvcViewModel GetPage(int id, string culture) - { - var page = ViewModels.MixPages.ReadMvcViewModel.Repository.GetSingleModel(m => m.Id == id && m.Specificulture == culture); - return page.Data; - } - - public static async System.Threading.Tasks.Task GetTemplateByPath(string themeName, string templatePath) - { - string[] tmp = templatePath.Split('/'); - if (tmp[1].IndexOf('.') > 0) - { - tmp[1] = tmp[1].Substring(0, tmp[1].IndexOf('.')); - } - var getData = await ViewModels.MixTemplates.ReadViewModel.Repository.GetFirstModelAsync( - m => m.ThemeName == themeName && m.FolderType == tmp[0] && m.FileName == tmp[1]); - - return getData.Data; - } - - public static async System.Threading.Tasks.Task GetNavigation( - string name, string culture, IUrlHelper Url) - { - var navs = await ViewModels.MixDatabaseDatas.Helper.FilterByKeywordAsync( - culture, MixConstants.MixDatabaseName.NAVIGATION, "equal", "name", name); - var nav = navs.Data?.FirstOrDefault()?.Nav; - string activePath = Url.ActionContext.HttpContext.Request.Path; - - if (nav != null) - { - foreach (var cate in nav.MenuItems) - { - cate.IsActive = cate.Uri == activePath; - if (cate.IsActive) - { - nav.ActivedMenuItem = cate; - nav.ActivedMenuItems.Add(cate); - } - - foreach (var item in cate.MenuItems) - { - item.IsActive = item.Uri == activePath; - if (item.IsActive) - { - nav.ActivedMenuItem = item; - nav.ActivedMenuItems.Add(cate); - nav.ActivedMenuItems.Add(item); - } - cate.IsActive = cate.IsActive || item.IsActive; - } - } - } - - return nav; - } - - public static async Task>> GetListPostByAdditionalField( - string fieldName, object fieldValue, string culture, MixDataType dataType - , MixCompareOperatorKind filterType = MixCompareOperatorKind.Equal - , string orderByPropertyName = null, Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Asc, int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - PageIndex = pageIndex.HasValue ? pageIndex.Value : 0, - PageSize = pageSize - } - }; - // Get Value Predicate By Type - Expression> valPredicate = m => m.MixDatabaseName == MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST - && m.MixDatabaseColumnName == fieldName; - - var pre = GetValuePredicate(fieldValue.ToString(), filterType, dataType); - if (pre != null) - { - valPredicate = valPredicate.AndAlso(pre); - } - - var query = context.MixDatabaseDataValue.Where(valPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - var relatedQuery = context.MixDatabaseDataAssociation.Where( - m => m.ParentType == MixDatabaseParentType.Post && m.Specificulture == culture - && dataIds.Any(d => d == m.DataId)); - var postIds = relatedQuery.Select(m => int.Parse(m.ParentId)).Distinct().AsEnumerable().ToList(); - result = await DefaultRepository.Instance.GetModelListByAsync( - m => m.Specificulture == culture && postIds.Any(p => p == m.Id) - , orderByPropertyName, direction - , pageSize ?? 100, pageIndex ?? 0 - , null, null - , context, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - context.Dispose(); - } - } - } - - private static Expression> GetValuePredicate(string fieldValue - , MixCompareOperatorKind filterType, MixDataType dataType) - { - Expression> valPredicate = null; - switch (dataType) - { - case MixDataType.Date: - case MixDataType.Time: - if (DateTime.TryParse(fieldValue, out DateTime dtValue)) - { - valPredicate = FilterObjectSet("DateTimeValue", dtValue, filterType); - } - break; - - case MixDataType.Double: - if (double.TryParse(fieldValue, out double dbValue)) - { - valPredicate = FilterObjectSet("DoubleValue", dbValue, filterType); - } - break; - - case MixDataType.Boolean: - if (bool.TryParse(fieldValue, out bool boolValue)) - { - valPredicate = FilterObjectSet("BooleanValue", boolValue, filterType); - } - break; - - case MixDataType.Integer: - if (int.TryParse(fieldValue, out int intValue)) - { - valPredicate = FilterObjectSet("IntegerValue", intValue, filterType); - } - break; - - case MixDataType.Reference: - break; - - case MixDataType.Duration: - case MixDataType.Custom: - case MixDataType.DateTime: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Upload: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - case MixDataType.QRCode: - default: - valPredicate = FilterObjectSet("StringValue", fieldValue, filterType); - break; - } - - return valPredicate; - } - - public static Expression> FilterObjectSet(string propName, T data2, MixCompareOperatorKind filterType) - { - Type type = typeof(TModel); - var par = Expression.Parameter(type, "model"); - - Type fieldPropertyType; - Expression fieldPropertyExpression; - - FieldInfo fieldInfo = type.GetField(propName); - - if (fieldInfo == null) - { - PropertyInfo propertyInfo = type.GetProperty(propName); - - if (propertyInfo == null) - { - throw new Exception(); - } - - fieldPropertyType = propertyInfo.PropertyType; - fieldPropertyExpression = Expression.Property(par, propertyInfo); - } - else - { - fieldPropertyType = fieldInfo.FieldType; - fieldPropertyExpression = Expression.Field(par, fieldInfo); - } - - BinaryExpression eq = null; - switch (filterType) - { - case MixCompareOperatorKind.Equal: - eq = Expression.Equal(fieldPropertyExpression, - Expression.Constant(data2, fieldPropertyType)); - break; - - case MixCompareOperatorKind.LessThan: - eq = Expression.LessThan(fieldPropertyExpression, - Expression.Constant(data2, fieldPropertyType)); - break; - - case MixCompareOperatorKind.GreaterThan: - eq = Expression.GreaterThan(fieldPropertyExpression, - Expression.Constant(data2, fieldPropertyType)); - break; - - case MixCompareOperatorKind.LessThanOrEqual: - eq = Expression.LessThanOrEqual(fieldPropertyExpression, - Expression.Constant(data2, fieldPropertyType)); - break; - - case MixCompareOperatorKind.GreaterThanOrEqual: - eq = Expression.GreaterThanOrEqual(fieldPropertyExpression, - Expression.Constant(data2, fieldPropertyType)); - break; - - case MixCompareOperatorKind.InRange: - var method = typeof(string).GetMethod("Contains"); - var call = Expression.Call(par, method, Expression.Constant(data2, typeof(string))); - return Expression.Lambda>(call, par); - - default: - break; - } - return Expression.Lambda>(eq, par); - } - - public async static Task>> GetPostlistByMeta( - HttpContext context - , string keyword = null - , string culture = null - , string type = MixConstants.MixDatabaseName.SYSTEM_TAG - , string orderByPropertyName = "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection direction = MixHeartEnums.DisplayDirection.Desc - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - int maxPageSize = MixService.GetConfig("MaxPageSize"); - culture ??= MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - keyword ??= context.Request.Query["keyword"]; - int.TryParse(context.Request.Query[MixRequestQueryKeywords.Page], out int page); - int.TryParse(context.Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - pageSize = (pageSize > 0 && pageSize < maxPageSize) ? pageSize : maxPageSize; - page = (page > 0) ? page : 1; - - return await Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetModelistByMeta( - type, keyword, - culture, orderByPropertyName, direction, pageSize, page - 1, _context, _transaction); - } - - public async static Task>> GetPostlistByAdditionalField( - - string fieldName, string value, string culture - , string orderByPropertyName = null, Heart.Enums.MixHeartEnums.DisplayDirection direction = MixHeartEnums.DisplayDirection.Asc - , int? pageSize = null, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - int maxPageSize = MixService.GetConfig("MaxPageSize"); - string orderBy = MixService.GetConfig("OrderBy"); - pageSize = (pageSize > 0 && pageSize < maxPageSize) ? pageSize : maxPageSize; - pageIndex = (pageIndex >= 0) ? pageIndex : 0; - - return await Mix.Cms.Lib.ViewModels.MixPosts.Helper.SearchPostByField( - fieldName, value, - culture, orderByPropertyName ?? orderBy, direction, pageSize, pageIndex - 1, _context, _transaction); - } - - public static async Task>> GetAttributeDataByParent( - string culture, string mixDatabaseName, - string parentId, MixDatabaseParentType parentType, - string orderBy = "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection direction = MixHeartEnums.DisplayDirection.Desc, - int? pageSize = null, int? pageIndex = 0, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - return await ViewModels.MixDatabaseDatas.Helper.GetAttributeDataByParent( - culture, mixDatabaseName, - parentId, parentType, orderBy, direction, pageSize, pageIndex, _context, _transaction); - } - - public static async Task>> GetPostListByPageId( - HttpContext context - , int pageId - , string keyword = null - , string culture = null - , string orderBy = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = MixHeartEnums.DisplayDirection.Desc - , MixCmsContext _context = null, IDbContextTransaction _transaction = null - ) - { - int.TryParse(context.Request.Query[MixRequestQueryKeywords.Page], out int page); - int.TryParse(context.Request.Query[MixRequestQueryKeywords.PageSize], out int pageSize); - page = (page > 0) ? page : 1; - var result = await ViewModels.MixPosts.Helper.GetPostListByPageId( - pageId, keyword, culture, - orderBy, direction, pageSize, page - 1, _context, _transaction); - result.Data.Items.ForEach(m => m.LoadPost(_context, _transaction)); - return result; - } - - public static async Task>> GetAttributeDataListBySet( - HttpContext context - , string mixDatabaseName - , string culture = null - , Heart.Enums.MixHeartEnums.DisplayDirection direction = MixHeartEnums.DisplayDirection.Desc - , MixCmsContext _context = null, IDbContextTransaction _transaction = null - ) - { - var result = await ViewModels.MixDatabaseDatas.Helper.FilterByKeywordAsync( - context.Request, culture, mixDatabaseName); - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Helpers/QueryFilterHelper.cs b/src/Mix.Cms.Lib/Helpers/QueryFilterHelper.cs deleted file mode 100644 index c7b2fc556..000000000 --- a/src/Mix.Cms.Lib/Helpers/QueryFilterHelper.cs +++ /dev/null @@ -1,152 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models; -using Mix.Cms.Lib.Models.Cms; -using Mix.Heart.Extensions; -using Newtonsoft.Json.Linq; -using System; -using System.Linq.Expressions; - -namespace Mix.Cms.Lib.Helpers -{ - public class QueryFilterHelper - { - public void TestCreateModel() - { - ExpressionModel.Create(MixLogicalOperatorKind.And) - .AddExpression - ( - ExpressionModel.Create(MixLogicalOperatorKind.And) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.Equal, "ho_va_ten", "Tran Nhat Duy")) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.Equal, "status", "open")) - ).AddExpression - ( - ExpressionModel.Create(MixLogicalOperatorKind.And) - .AddExpression - ( - ExpressionModel.Create(MixLogicalOperatorKind.Or) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.Equal, "date", "2020/12/10", "2020/12/30")) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.Equal, "address", "Nguyen thi Minh Khai")) - ).AddExpression - ( - ExpressionModel.Create(MixLogicalOperatorKind.And) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.GreaterThan, "age", "18")) - .AddFunction(FunctionModel.Create(MixCompareOperatorKind.Equal, "gender", "male")) - ) - ); - } - - public static Expression> CreateExpression( - JObject jsonQuery) - { - Expression> root = null; - try - { - ExpressionModel expressionModel = jsonQuery.ToObject(); - root = GetExpression(expressionModel); - return root; - } - catch (Exception ex) - { - Console.Write(ex.ToString()); - } - - return null; - } - - private static Expression> GetExpression( - ExpressionModel expressionModel) - { - Expression> root = null; - try - { - expressionModel?.Functions?.ForEach(function => - { - root = CombineExpressionByType(expressionModel.ExpressionType, - root, GetFunction(function)); - }); - - expressionModel?.Expressions?.ForEach(expression => - { - root = CombineExpressionByType(expressionModel.ExpressionType, - root, GetExpression(expression)); - }); - - return root; - } - catch (Exception ex) - { - Console.Write(ex.ToString()); - return null; - } - } - - /// - /// Combine Two Expressions by Type - /// - /// - /// - /// - /// - /// - private static Expression> CombineExpressionByType( - MixLogicalOperatorKind type, - Expression> expr1, - Expression> expr2) - { - return type switch - { - MixLogicalOperatorKind.And => expr1.AndAlsoIf(expr1 != null, expr2), - MixLogicalOperatorKind.Or => expr1.OrIf(expr1 != null, expr2), - _ => expr2, - }; - } - - private static Expression> GetFunction(FunctionModel functionModel) - { - return functionModel.Rule switch - { - MixCompareOperatorKind.Equal => m => m.MixDatabaseColumnName == functionModel.FieldName - && EF.Functions.Like(m.StringValue, functionModel.Value), - - MixCompareOperatorKind.NotEqual => m => m.MixDatabaseColumnName == functionModel.FieldName - && !EF.Functions.Like(m.StringValue, functionModel.Value), - - MixCompareOperatorKind.Contain => m => m.MixDatabaseColumnName == functionModel.FieldName - && (EF.Functions.Like(m.StringValue, buildLikeString(functionModel.Value))), - - MixCompareOperatorKind.NotContain => m => m.MixDatabaseColumnName == functionModel.FieldName - && !(EF.Functions.Like(m.StringValue, buildLikeString(functionModel.Value))), - - MixCompareOperatorKind.InRange => m => m.MixDatabaseColumnName == functionModel.FieldName - && (string.Compare(m.StringValue, functionModel.MinValue) > 0 - && string.Compare(m.StringValue, functionModel.MaxValue) < 0), - - MixCompareOperatorKind.NotInRange => m => m.MixDatabaseColumnName == functionModel.FieldName - && (string.Compare(m.StringValue, functionModel.MinValue) < 0 - || string.Compare(m.StringValue, functionModel.MaxValue) > 0), - - MixCompareOperatorKind.GreaterThanOrEqual => m => m.MixDatabaseColumnName == functionModel.FieldName - && (string.Compare(m.StringValue, functionModel.Value) > 0 - || m.StringValue == functionModel.Value), - - MixCompareOperatorKind.GreaterThan => m => m.MixDatabaseColumnName == functionModel.FieldName - && string.Compare(m.StringValue, functionModel.Value) > 0, - - MixCompareOperatorKind.LessThanOrEqual => m => m.MixDatabaseColumnName == functionModel.FieldName - && (string.Compare(m.StringValue, functionModel.Value) < 0 - || m.StringValue == functionModel.Value), - - MixCompareOperatorKind.LessThan => m => m.MixDatabaseColumnName == functionModel.FieldName - && string.Compare(m.StringValue, functionModel.Value) < 0, - - _ => null, - }; - } - - private static string buildLikeString(string stringValue) - { - return $"%{stringValue}%"; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Interfaces/IMvcViewModel.cs b/src/Mix.Cms.Lib/Interfaces/IMvcViewModel.cs deleted file mode 100644 index e80ed388f..000000000 --- a/src/Mix.Cms.Lib/Interfaces/IMvcViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Mix.Cms.Lib.Interfaces -{ - public interface IMvcViewModel - { - public int Id { get; set; } - public string Layout { get; set; } - public string Title { get; set; } - public string SeoTitle { get; set; } - public string ThumbnailUrl { get; } - public string SeoDescription { get; set; } - public string TemplatePath { get; } - public string DetailsUrl { get; } - public string BodyClass { get; } - public ViewModels.MixTemplates.ReadListItemViewModel View { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/MiddleWares/IpRestrictionMiddleware.cs b/src/Mix.Cms.Lib/MiddleWares/IpRestrictionMiddleware.cs deleted file mode 100644 index b34ee60fb..000000000 --- a/src/Mix.Cms.Lib/MiddleWares/IpRestrictionMiddleware.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Options; -using Mix.Cms.Lib.Services; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.MiddleWares -{ - public class IpRestrictionMiddleware - { - public readonly RequestDelegate Next; - public readonly IpSecuritySettings IpSecuritySettings; - - public IpRestrictionMiddleware(RequestDelegate next, IOptions ipSecuritySettings) - { - Next = next; - IpSecuritySettings = ipSecuritySettings.Value; - } - - public async Task Invoke(HttpContext context) - { - if (MixService.GetIpConfig("IsRetrictIp")) - { - var ipAddress = (string)context.Connection.RemoteIpAddress?.ToString(); - string allowedIps = MixService.GetIpConfig("AllowedIps"); - string exceptIps = MixService.GetIpConfig("ExceptIps"); - string remoteIp = context.Connection?.RemoteIpAddress?.ToString(); - if ( - // allow localhost - (allowedIps != "*" && !allowedIps.Contains(remoteIp)) - || (exceptIps.Contains(remoteIp)) - ) - { - context.Response.StatusCode = 403; - return; - } - } - await Next(context); - } - } - - public class IpSecuritySettings - { - public bool IsRetrictIp { get; set; } - public string AllowedPortalIps { get; set; } - public string AllowedIps { get; set; } - public string ExceptIps { get; set; } - - public List AllowedIPsList { - get { return !string.IsNullOrEmpty(AllowedIps) ? AllowedIps.Split(',').ToList() : new List(); } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.Designer.cs deleted file mode 100644 index 6274abcf6..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.Designer.cs +++ /dev/null @@ -1,433 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; - -namespace Mix.Cms.Lib.Migrations.MixCmsAccount -{ - [DbContext(typeof(MixCmsAccountContext))] - [Migration("20200312035845_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.2") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RoleId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Name") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Value") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("CountryId") - .HasColumnType("int"); - - b.Property("Culture") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Dob") - .HasColumnName("DOB") - ; - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Gender") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsActived") - .HasColumnType("bit"); - - b.Property("JoinDate") - ; - - b.Property("LastModified") - ; - - b.Property("LastName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - ; - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NickName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RegisterType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("AllowedOrigin") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ApplicationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("int"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClientId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ExpiresUtc") - ; - - b.Property("IssuedUtc") - ; - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.cs b/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.cs deleted file mode 100644 index 5e2da4d72..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/20200312035845_Init.cs +++ /dev/null @@ -1,305 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Mix.Cms.Lib.Migrations.MixCmsAccount -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - ConcurrencyStamp = table.Column(maxLength: 400, nullable: true), - Name = table.Column(maxLength: 250, nullable: true), - NormalizedName = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - AccessFailedCount = table.Column(nullable: false), - Avatar = table.Column(maxLength: 250, nullable: true), - ConcurrencyStamp = table.Column(maxLength: 250, nullable: true), - CountryId = table.Column(nullable: false), - Culture = table.Column(maxLength: 50, nullable: true), - DOB = table.Column(nullable: true), - Email = table.Column(maxLength: 250, nullable: true), - EmailConfirmed = table.Column(nullable: false), - FirstName = table.Column(maxLength: 50, nullable: true), - Gender = table.Column(maxLength: 50, nullable: true), - IsActived = table.Column(nullable: false), - JoinDate = table.Column(nullable: false), - LastModified = table.Column(nullable: false), - LastName = table.Column(maxLength: 50, nullable: true), - LockoutEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - ModifiedBy = table.Column(maxLength: 250, nullable: true), - NickName = table.Column(maxLength: 50, nullable: true), - NormalizedEmail = table.Column(maxLength: 250, nullable: true), - NormalizedUserName = table.Column(maxLength: 250, nullable: true), - PasswordHash = table.Column(maxLength: 250, nullable: true), - PhoneNumber = table.Column(maxLength: 50, nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - RegisterType = table.Column(maxLength: 50, nullable: true), - SecurityStamp = table.Column(maxLength: 50, nullable: true), - TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - Active = table.Column(nullable: false), - AllowedOrigin = table.Column(maxLength: 100, nullable: true), - ApplicationType = table.Column(nullable: false), - Name = table.Column(maxLength: 100, nullable: false), - RefreshTokenLifeTime = table.Column(nullable: false), - Secret = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "RefreshTokens", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - ClientId = table.Column(maxLength: 50, nullable: true), - Email = table.Column(maxLength: 250, nullable: false), - Username = table.Column(maxLength: 250, nullable: true), - ExpiresUtc = table.Column(nullable: false), - IssuedUtc = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RefreshTokens", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 400, nullable: true), - ClaimValue = table.Column(maxLength: 400, nullable: true), - RoleId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true), - ClaimType = table.Column(maxLength: 400, nullable: true), - ClaimValue = table.Column(maxLength: 400, nullable: true), - UserId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(maxLength: 50, nullable: false), - ProviderKey = table.Column(maxLength: 50, nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true), - ProviderDisplayName = table.Column(maxLength: 400, nullable: true), - UserId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins_1", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(maxLength: 50, nullable: false), - RoleId = table.Column(maxLength: 50, nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(maxLength: 50, nullable: false), - LoginProvider = table.Column(maxLength: 50, nullable: false), - Name = table.Column(maxLength: 50, nullable: false), - Value = table.Column(maxLength: 400, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AspNetUserTokens_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true, - filter: "([NormalizedName] IS NOT NULL)"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_ApplicationUserId", - table: "AspNetUserClaims", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_ApplicationUserId", - table: "AspNetUserLogins", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_ApplicationUserId", - table: "AspNetUserRoles", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true, - filter: "([NormalizedUserName] IS NOT NULL)"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "RefreshTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/MixCmsAccountContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/MixCmsAccount/MixCmsAccountContextModelSnapshot.cs deleted file mode 100644 index 3b62de137..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixCmsAccount/MixCmsAccountContextModelSnapshot.cs +++ /dev/null @@ -1,431 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; - -namespace Mix.Cms.Lib.Migrations.MixCmsAccount -{ - [DbContext(typeof(MixCmsAccountContext))] - partial class MixCmsAccountContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.2") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RoleId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Name") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Value") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("CountryId") - .HasColumnType("int"); - - b.Property("Culture") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Dob") - .HasColumnName("DOB") - ; - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Gender") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsActived") - .HasColumnType("bit"); - - b.Property("JoinDate") - ; - - b.Property("LastModified") - ; - - b.Property("LastName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - ; - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NickName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RegisterType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("AllowedOrigin") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ApplicationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("int"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClientId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ExpiresUtc") - ; - - b.Property("IssuedUtc") - ; - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.Designer.cs b/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.Designer.cs deleted file mode 100644 index 70d1c219f..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.Designer.cs +++ /dev/null @@ -1,257 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Messenger.Models.Data; - -namespace Mix.Cms.Messenger.Migrations -{ - [DbContext(typeof(MixChatServiceContext))] - [Migration("20181119151731_init")] - partial class init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", b => - { - b.Property("Id"); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("Description") - ;//.HasColumnType("ntext"); - - b.Property("HostId") - .HasMaxLength(128); - - b.Property("IsOpen"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50); - - b.Property("TeamId"); - - b.Property("Title") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_hub_room"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerMessage", b => - { - b.Property("Id"); - - b.Property("Content") - ;//.HasColumnType("ntext"); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("RoomId"); - - b.Property("TeamId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoomId") - .HasName("IX_messenger_message_RoomId"); - - b.HasIndex("TeamId") - .HasName("IX_messenger_message_TeamId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_message_UserId"); - - b.ToTable("mix_messenger_message"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavRoomUser", b => - { - b.Property("RoomId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.Property("JoinedDate") - .HasColumnType("datetime"); - - b.HasKey("RoomId", "UserId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_nav_room_user_UserId"); - - b.ToTable("mix_messenger_nav_room_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavTeamUser", b => - { - b.Property("TeamId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.Property("JoinedDate") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Status"); - - b.HasKey("TeamId", "UserId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_nav_team_user_UserId"); - - b.ToTable("mix_messenger_nav_team_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", b => - { - b.Property("Id"); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("HostId") - .HasMaxLength(128); - - b.Property("IsOpen") - .ValueGeneratedOnAdd() - ;//.HasDefaultValueSql("((1))"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250); - - b.Property("Type"); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_team"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerUser", b => - { - b.Property("Id") - .HasMaxLength(50); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("FacebookId") - .HasMaxLength(50); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250); - - b.Property("Status") - .ValueGeneratedOnAdd() - ;//.HasDefaultValueSql("((1))"); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerUserDevice", b => - { - b.Property("UserId") - .HasMaxLength(50); - - b.Property("DeviceId") - .HasMaxLength(50); - - b.Property("ConnectionId") - .IsRequired() - .HasMaxLength(50); - - b.Property("EndDate") - .HasColumnType("datetime"); - - b.Property("StartDate") - .HasColumnType("datetime"); - - b.Property("Status"); - - b.HasKey("UserId", "DeviceId"); - - b.ToTable("mix_messenger_user_device"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerMessage", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", "Room") - .WithMany("MixMessengerMessage") - .HasForeignKey("RoomId") - .HasConstraintName("FK_messenger_message_messenger_hub_room"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", "Team") - .WithMany("MixMessengerMessage") - .HasForeignKey("TeamId") - .HasConstraintName("FK_messenger_message_messenger_team"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerMessage") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_message_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavRoomUser", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", "Room") - .WithMany("MixMessengerNavRoomUser") - .HasForeignKey("RoomId") - .HasConstraintName("FK_messenger_nav_room_user_messenger_hub_room"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerNavRoomUser") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_nav_room_user_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavTeamUser", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", "Team") - .WithMany("MixMessengerNavTeamUser") - .HasForeignKey("TeamId") - .HasConstraintName("FK_messenger_nav_team_user_messenger_team"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerNavTeamUser") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_nav_team_user_messenger_user"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.cs b/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.cs deleted file mode 100644 index 63ec18d2a..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixMessenger/20181119151731_init.cs +++ /dev/null @@ -1,217 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Mix.Cms.Messenger.Migrations -{ - public partial class init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "mix_messenger_hub_room", - columns: table => new - { - Id = table.Column(nullable: false), - Avatar = table.Column(maxLength: 250, nullable: true), - CreatedDate = table.Column(type: "datetime", nullable: false), - Description = table.Column(nullable: true), - HostId = table.Column(maxLength: 128, nullable: true), - IsOpen = table.Column(nullable: false), - LastModified = table.Column(type: "datetime", nullable: true), - Name = table.Column(maxLength: 50, nullable: false), - TeamId = table.Column(nullable: true), - Title = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_hub_room", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_team", - columns: table => new - { - Id = table.Column(nullable: false), - Avatar = table.Column(maxLength: 250, nullable: true), - CreatedDate = table.Column(type: "datetime", nullable: false), - HostId = table.Column(maxLength: 128, nullable: true), - IsOpen = table.Column(nullable: true), - Name = table.Column(maxLength: 250, nullable: false), - Type = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_team", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_user", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - FacebookId = table.Column(maxLength: 50, nullable: true), - Avatar = table.Column(maxLength: 250, nullable: true), - CreatedDate = table.Column(type: "datetime", nullable: false), - LastModified = table.Column(type: "datetime", nullable: true), - Name = table.Column(maxLength: 250, nullable: false), - Status = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_user_device", - columns: table => new - { - UserId = table.Column(maxLength: 50, nullable: false), - ConnectionId = table.Column(maxLength: 50, nullable: false), - DeviceId = table.Column(maxLength: 50, nullable: false), - Status = table.Column(nullable: false), - StartDate = table.Column(type: "datetime", nullable: false), - EndDate = table.Column(type: "datetime", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_user_device", x => new { x.UserId, x.DeviceId }); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_message", - columns: table => new - { - Id = table.Column(nullable: false), - Content = table.Column(nullable: true), - CreatedDate = table.Column(type: "datetime", nullable: false), - RoomId = table.Column(nullable: true), - TeamId = table.Column(nullable: true), - UserId = table.Column(maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_message", x => x.Id); - table.ForeignKey( - name: "FK_messenger_message_messenger_hub_room", - column: x => x.RoomId, - principalTable: "mix_messenger_hub_room", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_messenger_message_messenger_team", - column: x => x.TeamId, - principalTable: "mix_messenger_team", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_messenger_message_messenger_user", - column: x => x.UserId, - principalTable: "mix_messenger_user", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_nav_room_user", - columns: table => new - { - RoomId = table.Column(nullable: false), - UserId = table.Column(maxLength: 50, nullable: false), - JoinedDate = table.Column(type: "datetime", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_nav_room_user", x => new { x.RoomId, x.UserId }); - table.ForeignKey( - name: "FK_messenger_nav_room_user_messenger_hub_room", - column: x => x.RoomId, - principalTable: "mix_messenger_hub_room", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_messenger_nav_room_user_messenger_user", - column: x => x.UserId, - principalTable: "mix_messenger_user", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_messenger_nav_team_user", - columns: table => new - { - TeamId = table.Column(nullable: false), - UserId = table.Column(maxLength: 50, nullable: false), - JoinedDate = table.Column(type: "datetime", nullable: false), - LastModified = table.Column(type: "datetime", nullable: true), - Status = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_messenger_nav_team_user", x => new { x.TeamId, x.UserId }); - table.ForeignKey( - name: "FK_messenger_nav_team_user_messenger_team", - column: x => x.TeamId, - principalTable: "mix_messenger_team", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_messenger_nav_team_user_messenger_user", - column: x => x.UserId, - principalTable: "mix_messenger_user", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_messenger_message_RoomId", - table: "mix_messenger_message", - column: "RoomId"); - - migrationBuilder.CreateIndex( - name: "IX_messenger_message_TeamId", - table: "mix_messenger_message", - column: "TeamId"); - - migrationBuilder.CreateIndex( - name: "IX_messenger_message_UserId", - table: "mix_messenger_message", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_messenger_nav_room_user_UserId", - table: "mix_messenger_nav_room_user", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_messenger_nav_team_user_UserId", - table: "mix_messenger_nav_team_user", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "mix_messenger_message"); - - migrationBuilder.DropTable( - name: "mix_messenger_nav_room_user"); - - migrationBuilder.DropTable( - name: "mix_messenger_nav_team_user"); - - migrationBuilder.DropTable( - name: "mix_messenger_user_device"); - - migrationBuilder.DropTable( - name: "mix_messenger_hub_room"); - - migrationBuilder.DropTable( - name: "mix_messenger_team"); - - migrationBuilder.DropTable( - name: "mix_messenger_user"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/MixMessenger/MixChatServiceContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/MixMessenger/MixChatServiceContextModelSnapshot.cs deleted file mode 100644 index 9ac25872c..000000000 --- a/src/Mix.Cms.Lib/Migrations/MixMessenger/MixChatServiceContextModelSnapshot.cs +++ /dev/null @@ -1,255 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Messenger.Models.Data; - -namespace Mix.Cms.Messenger.Migrations -{ - [DbContext(typeof(MixChatServiceContext))] - partial class MixChatServiceContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", b => - { - b.Property("Id"); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("Description") - ;//.HasColumnType("ntext"); - - b.Property("HostId") - .HasMaxLength(128); - - b.Property("IsOpen"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50); - - b.Property("TeamId"); - - b.Property("Title") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_hub_room"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerMessage", b => - { - b.Property("Id"); - - b.Property("Content") - ;//.HasColumnType("ntext"); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("RoomId"); - - b.Property("TeamId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoomId") - .HasName("IX_messenger_message_RoomId"); - - b.HasIndex("TeamId") - .HasName("IX_messenger_message_TeamId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_message_UserId"); - - b.ToTable("mix_messenger_message"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavRoomUser", b => - { - b.Property("RoomId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.Property("JoinedDate") - .HasColumnType("datetime"); - - b.HasKey("RoomId", "UserId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_nav_room_user_UserId"); - - b.ToTable("mix_messenger_nav_room_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavTeamUser", b => - { - b.Property("TeamId"); - - b.Property("UserId") - .HasMaxLength(50); - - b.Property("JoinedDate") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Status"); - - b.HasKey("TeamId", "UserId"); - - b.HasIndex("UserId") - .HasName("IX_messenger_nav_team_user_UserId"); - - b.ToTable("mix_messenger_nav_team_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", b => - { - b.Property("Id"); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("HostId") - .HasMaxLength(128); - - b.Property("IsOpen") - .ValueGeneratedOnAdd() - ;//.HasDefaultValueSql("((1))"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250); - - b.Property("Type"); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_team"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerUser", b => - { - b.Property("Id") - .HasMaxLength(50); - - b.Property("Avatar") - .HasMaxLength(250); - - b.Property("CreatedDate") - .HasColumnType("datetime"); - - b.Property("FacebookId") - .HasMaxLength(50); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250); - - b.Property("Status") - .ValueGeneratedOnAdd() - ;//.HasDefaultValueSql("((1))"); - - b.HasKey("Id"); - - b.ToTable("mix_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerUserDevice", b => - { - b.Property("UserId") - .HasMaxLength(50); - - b.Property("DeviceId") - .HasMaxLength(50); - - b.Property("ConnectionId") - .IsRequired() - .HasMaxLength(50); - - b.Property("EndDate") - .HasColumnType("datetime"); - - b.Property("StartDate") - .HasColumnType("datetime"); - - b.Property("Status"); - - b.HasKey("UserId", "DeviceId"); - - b.ToTable("mix_messenger_user_device"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerMessage", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", "Room") - .WithMany("MixMessengerMessage") - .HasForeignKey("RoomId") - .HasConstraintName("FK_messenger_message_messenger_hub_room"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", "Team") - .WithMany("MixMessengerMessage") - .HasForeignKey("TeamId") - .HasConstraintName("FK_messenger_message_messenger_team"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerMessage") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_message_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavRoomUser", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerHubRoom", "Room") - .WithMany("MixMessengerNavRoomUser") - .HasForeignKey("RoomId") - .HasConstraintName("FK_messenger_nav_room_user_messenger_hub_room"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerNavRoomUser") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_nav_room_user_messenger_user"); - }); - - modelBuilder.Entity("Mix.Cms.Messenger.Models.Data.MixMessengerNavTeamUser", b => - { - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerTeam", "Team") - .WithMany("MixMessengerNavTeamUser") - .HasForeignKey("TeamId") - .HasConstraintName("FK_messenger_nav_team_user_messenger_team"); - - b.HasOne("Mix.Cms.Messenger.Models.Data.MixMessengerUser", "User") - .WithMany("MixMessengerNavTeamUser") - .HasForeignKey("UserId") - .HasConstraintName("FK_messenger_nav_team_user_messenger_user"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.Designer.cs deleted file mode 100644 index ec54c599b..000000000 --- a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.Designer.cs +++ /dev/null @@ -1,2484 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations -{ - [DbContext(typeof(MsSqlMixCmsContext))] - [Migration("20210107122622_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("nvarchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("bit"); - - b.Property("IsMultiple") - .HasColumnType("bit"); - - b.Property("IsRequire") - .HasColumnType("bit"); - - b.Property("IsSelect") - .HasColumnType("bit"); - - b.Property("IsUnique") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("float"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.cs b/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.cs deleted file mode 100644 index 25a1fc32a..000000000 --- a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210107122622_Init.cs +++ /dev/null @@ -1,1120 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Lib.Migrations -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - migrationBuilder.CreateTable( - name: "mix_cache", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Value = table.Column(type: "ntext", nullable: false, collation: "Vietnamese_CI_AS"), - ExpiredDateTime = table.Column(type: "datetime", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cache", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_cms_user", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Address = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Avatar = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - FirstName = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastName = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - MiddleName = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - PhoneNumber = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - Username = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Email = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cms_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_culture", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Alias = table.Column(type: "varchar(150)", nullable: true, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - FullName = table.Column(type: "nvarchar(150)", nullable: true, collation: "Vietnamese_CI_AS"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LCID = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_culture", x => x.Id); - table.UniqueConstraint("AK_mix_culture_Specificulture", x => x.Specificulture); - }); - - migrationBuilder.CreateTable( - name: "mix_database", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - Name = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - FormTemplate = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - EdmTemplate = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - EdmSubject = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - EdmFrom = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - EdmAutoSend = table.Column(type: "bit", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_column", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Configurations = table.Column(type: "nvarchar(max)", nullable: true), - Regex = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: true), - Title = table.Column(type: "nvarchar(max)", nullable: true), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - DefaultValue = table.Column(type: "ntext", nullable: true), - Name = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - Options = table.Column(type: "ntext", nullable: true), - IsRequire = table.Column(type: "bit", nullable: false), - IsEncrypt = table.Column(type: "bit", nullable: false), - IsMultiple = table.Column(type: "bit", nullable: false), - IsSelect = table.Column(type: "bit", nullable: false), - IsUnique = table.Column(type: "bit", nullable: false), - ReferenceId = table.Column(type: "int", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_column", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_association", - columns: table => new - { - Id = table.Column(type: "nvarchar(450)", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - ParentId = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - ParentType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_association", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_value", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - MixDatabaseColumnId = table.Column(type: "int", nullable: false), - MixDatabaseColumnName = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - MixDatabaseName = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Regex = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - BooleanValue = table.Column(type: "bit", nullable: true), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - DateTimeValue = table.Column(type: "datetime", nullable: true), - DoubleValue = table.Column(type: "float", nullable: true), - IntegerValue = table.Column(type: "int", nullable: true), - StringValue = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - EncryptValue = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - EncryptKey = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - EncryptType = table.Column(type: "int", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_value", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_media", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - FileFolder = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FileName = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FileProperties = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - FileSize = table.Column(type: "bigint", nullable: false), - FileType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Tags = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - Source = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - TargetUrl = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_media", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - TextKeyword = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Url = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - TextDefault = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Level = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_theme", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Thumbnail = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Name = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - PreviewUrl = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_theme", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_configuration", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Category = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Value = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_configuration", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Configuration_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_language", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Category = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Value = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - DefaultValue = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_language", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Language_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Description = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Fields = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Thumbnail = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Name = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Template = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - FormTemplate = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - EdmTemplate = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Type = table.Column(type: "int", nullable: false), - PostType = table.Column(type: "nvarchar(max)", nullable: true), - PageSize = table.Column(type: "int", nullable: true), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_page", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Content = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - CssClass = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Excerpt = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Layout = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - Level = table.Column(type: "int", nullable: true), - SeoDescription = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - SeoKeywords = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "Vietnamese_CI_AS"), - SeoTitle = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - StaticUrl = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Tags = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Template = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - PostType = table.Column(type: "nvarchar(max)", nullable: true), - Views = table.Column(type: "int", nullable: true), - PageSize = table.Column(type: "int", nullable: true), - ExtraFields = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - Content = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - PublishedDateTime = table.Column(type: "datetime", nullable: true), - Excerpt = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - ExtraProperties = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Icon = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - SeoDescription = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - SeoKeywords = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "Vietnamese_CI_AS"), - SeoTitle = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Source = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Tags = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Template = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Thumbnail = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Title = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Type = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - Views = table.Column(type: "int", nullable: true), - ExtraFields = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_url_alias", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - SourceId = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Type = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: true), - Alias = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - CreatedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", unicode: false, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_url_alias", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Url_Alias_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_database_data_mix_database_MixDatabaseId", - column: x => x.MixDatabaseId, - principalTable: "mix_database", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_navigation", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: false), - ParentId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_navigation", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page1", - column: x => x.ParentId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_role", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PageId = table.Column(type: "int", nullable: false), - RoleId = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", unicode: false, maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_role", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_role_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_file", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - StringContent = table.Column(type: "ntext", nullable: false, collation: "Vietnamese_CI_AS"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - FileFolder = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FileName = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - ThemeId = table.Column(type: "int", nullable: true), - ThemeName = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_file", x => x.Id); - table.ForeignKey( - name: "FK_mix_file_mix_template", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_template", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Content = table.Column(type: "ntext", nullable: false, collation: "Vietnamese_CI_AS"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - FileFolder = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FileName = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - MobileContent = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Scripts = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - SpaContent = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - Styles = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - ThemeId = table.Column(type: "int", nullable: false), - ThemeName = table.Column(type: "nvarchar(250)", nullable: false, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_template", x => x.Id); - table.ForeignKey( - name: "FK_mix_template_mix_theme", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - ModuleId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Menu_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Page_Module_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - ModuleId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: true), - PostId = table.Column(type: "int", nullable: true), - Fields = table.Column(type: "ntext", nullable: false, collation: "Vietnamese_CI_AS"), - Value = table.Column(type: "ntext", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Data_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_module_data_mix_page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_module_data_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - PostId = table.Column(type: "int", nullable: false), - ModuleId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - PostId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_association", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - SourceId = table.Column(type: "int", nullable: false), - DestinationId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(400)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_association", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_association_mix_post", - columns: x => new { x.SourceId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_association_mix_post1", - columns: x => new { x.DestinationId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_media", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - MediaId = table.Column(type: "int", nullable: false), - PostId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_media", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_media_mix_media", - columns: x => new { x.MediaId, x.Specificulture }, - principalTable: "mix_media", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_media_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "Vietnamese_CI_AS"), - ModuleId = table.Column(type: "int", nullable: false), - PostId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Image = table.Column(type: "nvarchar(250)", nullable: true, collation: "Vietnamese_CI_AS"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "Vietnamese_CI_AS"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "Vietnamese_CI_AS") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "Index_ExpiresAtTime", - table: "mix_cache", - column: "ExpiredDateTime"); - - migrationBuilder.CreateIndex( - name: "IX_mix_configuration_Specificulture", - table: "mix_configuration", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_Mix_Culture", - table: "mix_culture", - column: "Specificulture", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_MixDatabaseId", - table: "mix_database_data", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_value_DataId", - table: "mix_database_data_value", - column: "DataId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_file_ThemeId", - table: "mix_file", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_language_Specificulture", - table: "mix_language", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_Specificulture", - table: "mix_module", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PostId_Specificulture", - table: "mix_module_data", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_ModuleId_Specificulture", - table: "mix_module_post", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_PostId_Specificulture", - table: "mix_module_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_Specificulture", - table: "mix_page", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_ModuleId_Specificulture", - table: "mix_page_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_PageId_Specificulture", - table: "mix_page_module", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PageId_Specificulture", - table: "mix_page_post", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PostId_Specificulture", - table: "mix_page_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "FK_mix_portal_page_navigation_mix_portal_page", - table: "mix_portal_page_navigation", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_navigation_ParentId", - table: "mix_portal_page_navigation", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_role_PageId", - table: "mix_portal_page_role", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_Specificulture", - table: "mix_post", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_DestinationId_Specificulture", - table: "mix_post_association", - columns: new[] { "DestinationId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_SourceId_Specificulture", - table: "mix_post_association", - columns: new[] { "SourceId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_MediaId_Specificulture", - table: "mix_post_media", - columns: new[] { "MediaId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_PostId_Specificulture", - table: "mix_post_media", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_ModuleId_Specificulture", - table: "mix_post_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_PostId_Specificulture", - table: "mix_post_module", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_template_file_TemplateId", - table: "mix_template", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_url_alias_Specificulture", - table: "mix_url_alias", - column: "Specificulture"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "mix_cache"); - - migrationBuilder.DropTable( - name: "mix_cms_user"); - - migrationBuilder.DropTable( - name: "mix_configuration"); - - migrationBuilder.DropTable( - name: "mix_database_column"); - - migrationBuilder.DropTable( - name: "mix_database_data"); - - migrationBuilder.DropTable( - name: "mix_database_data_association"); - - migrationBuilder.DropTable( - name: "mix_database_data_value"); - - migrationBuilder.DropTable( - name: "mix_file"); - - migrationBuilder.DropTable( - name: "mix_language"); - - migrationBuilder.DropTable( - name: "mix_module_data"); - - migrationBuilder.DropTable( - name: "mix_module_post"); - - migrationBuilder.DropTable( - name: "mix_page_module"); - - migrationBuilder.DropTable( - name: "mix_page_post"); - - migrationBuilder.DropTable( - name: "mix_portal_page_navigation"); - - migrationBuilder.DropTable( - name: "mix_portal_page_role"); - - migrationBuilder.DropTable( - name: "mix_post_association"); - - migrationBuilder.DropTable( - name: "mix_post_media"); - - migrationBuilder.DropTable( - name: "mix_post_module"); - - migrationBuilder.DropTable( - name: "mix_template"); - - migrationBuilder.DropTable( - name: "mix_url_alias"); - - migrationBuilder.DropTable( - name: "mix_database"); - - migrationBuilder.DropTable( - name: "mix_page"); - - migrationBuilder.DropTable( - name: "mix_portal_page"); - - migrationBuilder.DropTable( - name: "mix_media"); - - migrationBuilder.DropTable( - name: "mix_module"); - - migrationBuilder.DropTable( - name: "mix_post"); - - migrationBuilder.DropTable( - name: "mix_theme"); - - migrationBuilder.DropTable( - name: "mix_culture"); - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.Designer.cs b/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.Designer.cs deleted file mode 100644 index bc97c4927..000000000 --- a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.Designer.cs +++ /dev/null @@ -1,2484 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations -{ - [DbContext(typeof(MsSqlMixCmsContext))] - [Migration("20210216144629_RenameDatabase")] - partial class RenameDatabase - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("nvarchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("bit"); - - b.Property("IsMultiple") - .HasColumnType("bit"); - - b.Property("IsRequire") - .HasColumnType("bit"); - - b.Property("IsSelect") - .HasColumnType("bit"); - - b.Property("IsUnique") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("float"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.cs b/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.cs deleted file mode 100644 index d1861844c..000000000 --- a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/20210216144629_RenameDatabase.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using System; - -namespace Mix.Cms.Lib.Migrations -{ - public partial class RenameDatabase : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - Version.TryParse(MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION), out Version dbVersion); - var prevVersion = new Version("1.0.0"); - if (dbVersion == null || dbVersion.CompareTo(prevVersion) <= 0) - { - string schema = null; - - migrationBuilder.DropForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", schema); - - migrationBuilder.DropIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", schema); - - migrationBuilder.DropTable("mix_related_attribute_set"); - migrationBuilder.DropTable("mix_attribute_set_reference"); - - migrationBuilder.RenameTable("mix_related_post", schema, "mix_post_association"); - migrationBuilder.RenameTable("mix_attribute_set", schema, "mix_database"); - migrationBuilder.RenameTable("mix_related_attribute_data", schema, "mix_database_data_association"); - migrationBuilder.RenameTable("mix_attribute_set_value", schema, "mix_database_data_value"); - migrationBuilder.RenameTable("mix_attribute_set_data", schema, "mix_database_data"); - migrationBuilder.RenameTable("mix_attribute_field", schema, "mix_database_column"); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_column", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_column", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeFieldId", "mix_database_data_value", "MixDatabaseColumnId", schema); - migrationBuilder.RenameColumn("AttributeFieldName", "mix_database_data_value", "MixDatabaseColumnName", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_value", "MixDatabaseName", schema); - - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data_association", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_association", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data", "MixDatabaseName", schema); - - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - } - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - var dbVersion = MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION); - if (string.IsNullOrEmpty(dbVersion) || dbVersion == "1.0.0") - { - string schema = null; - - // mix_related_attribute_set and mix_attribute_set_reference not used, so we don't need to restore them. - - migrationBuilder.RenameTable("mix_post_association", schema, "mix_related_post"); - migrationBuilder.RenameTable("mix_database", schema, "mix_attribute_set"); - migrationBuilder.RenameTable("mix_database_data_association", schema, "mix_related_attribute_data"); - migrationBuilder.RenameTable("mix_database_data_value", schema, "mix_attribute_set_value"); - migrationBuilder.RenameTable("mix_database_data", schema, "mix_attribute_set_data"); - migrationBuilder.RenameTable("mix_database_column", schema, "mix_attribute_field"); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_column", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_column", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseColumnId", "mix_database_data_value", "AttributeFieldId", schema); - migrationBuilder.RenameColumn("MixDatabaseColumnName", "mix_database_data_value", "AttributeFieldName", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_value", "AttributeSetName", schema); - - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data_association", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_association", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data", "AttributeSetName", schema); - - migrationBuilder.CreateIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", "ReferenceId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", "DataId", schema); - - migrationBuilder.AddForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", "AttributeSetId", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", "Id", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", "Id", "mix_attribute_set", schema); - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.0"); - MixService.SaveSettings(); - } - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/MsSqlMixCmsContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/MsSqlMixCmsContextModelSnapshot.cs deleted file mode 100644 index a333fe00c..000000000 --- a/src/Mix.Cms.Lib/Migrations/MsSqlMixCms/MsSqlMixCmsContextModelSnapshot.cs +++ /dev/null @@ -1,2482 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations -{ - [DbContext(typeof(MsSqlMixCmsContext))] - partial class MsSqlMixCmsContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("nvarchar(150)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("bit"); - - b.Property("IsMultiple") - .HasColumnType("bit"); - - b.Property("IsRequire") - .HasColumnType("bit"); - - b.Property("IsSelect") - .HasColumnType("bit"); - - b.Property("IsUnique") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("float"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("nvarchar(max)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("ntext") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("nvarchar(400)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("nvarchar(250)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("Vietnamese_CI_AS") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("nvarchar(250)"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.Designer.cs deleted file mode 100644 index 2004ce7a4..000000000 --- a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.Designer.cs +++ /dev/null @@ -1,2509 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.MySqlMixCms -{ - [DbContext(typeof(MySqlMixCmsContext))] - [Migration("20201227053439_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 64) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit(1)"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IsEncrypt") - .HasColumnType("bit(1)"); - - b.Property("IsMultiple") - .HasColumnType("bit(1)"); - - b.Property("IsRequire") - .HasColumnType("bit(1)"); - - b.Property("IsSelect") - .HasColumnType("bit(1)"); - - b.Property("IsUnique") - .HasColumnType("bit(1)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit(1)"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("double"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.cs b/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.cs deleted file mode 100644 index d798c49eb..000000000 --- a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20201227053439_Init.cs +++ /dev/null @@ -1,1394 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Lib.Migrations.MySqlMixCms -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - migrationBuilder.CreateTable( - name: "mix_cache", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Value = table.Column(type: "text", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ExpiredDateTime = table.Column(type: "datetime", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cache", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_cms_user", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Address = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Avatar = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FirstName = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastName = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MiddleName = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PhoneNumber = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Username = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Email = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cms_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_culture", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Alias = table.Column(type: "varchar(150)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FullName = table.Column(type: "varchar(150)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LCID = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_culture", x => x.Id); - table.UniqueConstraint("AK_mix_culture_Specificulture", x => x.Specificulture); - }); - - migrationBuilder.CreateTable( - name: "mix_database", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EdmSubject = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EdmFrom = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EdmAutoSend = table.Column(type: "bit(1)", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_column", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Configurations = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), - Regex = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DefaultValue = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Options = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - IsRequire = table.Column(type: "bit(1)", nullable: false), - IsEncrypt = table.Column(type: "bit(1)", nullable: false), - IsMultiple = table.Column(type: "bit(1)", nullable: false), - IsSelect = table.Column(type: "bit(1)", nullable: false), - IsUnique = table.Column(type: "bit(1)", nullable: false), - ReferenceId = table.Column(type: "int", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_column", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_association", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ParentId = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ParentType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_value", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MixDatabaseColumnId = table.Column(type: "int", nullable: false), - MixDatabaseColumnName = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Regex = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - BooleanValue = table.Column(type: "bit(1)", nullable: true), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DateTimeValue = table.Column(type: "datetime", nullable: true), - DoubleValue = table.Column(type: "double", nullable: true), - IntegerValue = table.Column(type: "int", nullable: true), - StringValue = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EncryptValue = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EncryptKey = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EncryptType = table.Column(type: "int", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_media", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileProperties = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileSize = table.Column(type: "bigint", nullable: false), - FileType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Tags = table.Column(type: "varchar(400)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - TargetUrl = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - TextKeyword = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Url = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - TextDefault = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Level = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_theme", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PreviewUrl = table.Column(type: "varchar(450)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_theme", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_configuration", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Value = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Configuration_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_language", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Value = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - DefaultValue = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Language_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Description = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Fields = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Name = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Type = table.Column(type: "int", nullable: false), - PostType = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), - PageSize = table.Column(type: "int", nullable: true), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_page", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Content = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CssClass = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Excerpt = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Layout = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Level = table.Column(type: "int", nullable: true), - SeoDescription = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoTitle = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - StaticUrl = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Tags = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PostType = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), - Views = table.Column(type: "int", nullable: true), - PageSize = table.Column(type: "int", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Content = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PublishedDateTime = table.Column(type: "datetime", nullable: true), - Excerpt = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ExtraProperties = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Icon = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoDescription = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SeoTitle = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Tags = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Title = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Type = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Views = table.Column(type: "int", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_url_alias", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SourceId = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Type = table.Column(type: "int", nullable: false), - Description = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Alias = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Url_Alias_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MixDatabaseId = table.Column(type: "int", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_value", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_database_data_mix_database_MixDatabaseId", - column: x => x.MixDatabaseId, - principalTable: "mix_database", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_navigation", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - PageId = table.Column(type: "int", nullable: false), - ParentId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_navigation", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page1", - column: x => x.ParentId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_role", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - PageId = table.Column(type: "int", nullable: false), - RoleId = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", unicode: false, maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_role", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_role_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_file", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - StringContent = table.Column(type: "text", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ThemeId = table.Column(type: "int", nullable: true), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_file", x => x.Id); - table.ForeignKey( - name: "FK_mix_file_mix_template", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_template", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Content = table.Column(type: "text", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MobileContent = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Scripts = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SpaContent = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Styles = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ThemeId = table.Column(type: "int", nullable: false), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_template", x => x.Id); - table.ForeignKey( - name: "FK_mix_template_mix_theme", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ModuleId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Menu_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Page_Module_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ModuleId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: true), - PostId = table.Column(type: "int", nullable: true), - Fields = table.Column(type: "text", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Value = table.Column(type: "text", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Data_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_module_data_mix_page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_module_data_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PostId = table.Column(type: "int", nullable: false), - ModuleId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_post", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - PostId = table.Column(type: "int", nullable: false), - PageId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_association", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - SourceId = table.Column(type: "int", nullable: false), - DestinationId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(450)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_association_mix_post", - columns: x => new { x.SourceId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_association_mix_post1", - columns: x => new { x.DestinationId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_media", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - MediaId = table.Column(type: "int", nullable: false), - PostId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_media_mix_media", - columns: x => new { x.MediaId, x.Specificulture }, - principalTable: "mix_media", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_media_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_module", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - ModuleId = table.Column(type: "int", nullable: false), - PostId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - Position = table.Column(type: "int", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "int", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "utf8_unicode_ci") - .Annotation("MySql:CharSet", "utf8") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "Index_ExpiresAtTime", - table: "mix_cache", - column: "ExpiredDateTime"); - - migrationBuilder.CreateIndex( - name: "IX_mix_configuration_Specificulture", - table: "mix_configuration", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_Mix_Culture", - table: "mix_culture", - column: "Specificulture", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_column_MixDatabaseId", - table: "mix_database_column", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_column_ReferenceId", - table: "mix_database_column", - column: "ReferenceId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_MixDatabaseId", - table: "mix_database_data", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_value_DataId", - table: "mix_database_data_value", - column: "DataId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_file_ThemeId", - table: "mix_file", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_language_Specificulture", - table: "mix_language", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_Specificulture", - table: "mix_module", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PostId_Specificulture", - table: "mix_module_data", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_ModuleId_Specificulture", - table: "mix_module_post", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_PostId_Specificulture", - table: "mix_module_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_Specificulture", - table: "mix_page", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_ModuleId_Specificulture", - table: "mix_page_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_PageId_Specificulture", - table: "mix_page_module", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PageId_Specificulture", - table: "mix_page_post", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PostId_Specificulture", - table: "mix_page_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "FK_mix_portal_page_navigation_mix_portal_page", - table: "mix_portal_page_navigation", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_navigation_ParentId", - table: "mix_portal_page_navigation", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_role_PageId", - table: "mix_portal_page_role", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_Specificulture", - table: "mix_post", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_DestinationId_Specificulture", - table: "mix_post_association", - columns: new[] { "DestinationId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_SourceId_Specificulture", - table: "mix_post_association", - columns: new[] { "SourceId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_MediaId_Specificulture", - table: "mix_post_media", - columns: new[] { "MediaId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_PostId_Specificulture", - table: "mix_post_media", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_ModuleId_Specificulture", - table: "mix_post_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_PostId_Specificulture", - table: "mix_post_module", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_template_file_TemplateId", - table: "mix_template", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_url_alias_Specificulture", - table: "mix_url_alias", - column: "Specificulture"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "mix_cache"); - - migrationBuilder.DropTable( - name: "mix_cms_user"); - - migrationBuilder.DropTable( - name: "mix_configuration"); - - migrationBuilder.DropTable( - name: "mix_database_column"); - - migrationBuilder.DropTable( - name: "mix_database_data"); - - migrationBuilder.DropTable( - name: "mix_database_data_association"); - - migrationBuilder.DropTable( - name: "mix_database_data_value"); - - migrationBuilder.DropTable( - name: "mix_file"); - - migrationBuilder.DropTable( - name: "mix_language"); - - migrationBuilder.DropTable( - name: "mix_module_data"); - - migrationBuilder.DropTable( - name: "mix_module_post"); - - migrationBuilder.DropTable( - name: "mix_page_module"); - - migrationBuilder.DropTable( - name: "mix_page_post"); - - migrationBuilder.DropTable( - name: "mix_portal_page_navigation"); - - migrationBuilder.DropTable( - name: "mix_portal_page_role"); - - migrationBuilder.DropTable( - name: "mix_post_association"); - - migrationBuilder.DropTable( - name: "mix_post_media"); - - migrationBuilder.DropTable( - name: "mix_post_module"); - - migrationBuilder.DropTable( - name: "mix_template"); - - migrationBuilder.DropTable( - name: "mix_url_alias"); - - migrationBuilder.DropTable( - name: "mix_database"); - - migrationBuilder.DropTable( - name: "mix_page"); - - migrationBuilder.DropTable( - name: "mix_portal_page"); - - migrationBuilder.DropTable( - name: "mix_media"); - - migrationBuilder.DropTable( - name: "mix_module"); - - migrationBuilder.DropTable( - name: "mix_post"); - - migrationBuilder.DropTable( - name: "mix_theme"); - - migrationBuilder.DropTable( - name: "mix_culture"); - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.Designer.cs b/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.Designer.cs deleted file mode 100644 index a142fb37b..000000000 --- a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.Designer.cs +++ /dev/null @@ -1,2509 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.MySqlMixCms -{ - [DbContext(typeof(MySqlMixCmsContext))] - [Migration("20210216143114_RenameDatabase")] - partial class RenameDatabase - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 64) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit(1)"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IsEncrypt") - .HasColumnType("bit(1)"); - - b.Property("IsMultiple") - .HasColumnType("bit(1)"); - - b.Property("IsRequire") - .HasColumnType("bit(1)"); - - b.Property("IsSelect") - .HasColumnType("bit(1)"); - - b.Property("IsUnique") - .HasColumnType("bit(1)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit(1)"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("double"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.cs b/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.cs deleted file mode 100644 index a63d95fde..000000000 --- a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/20210216143114_RenameDatabase.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using System; - -namespace Mix.Cms.Lib.Migrations.MySqlMixCms -{ - public partial class RenameDatabase : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - Version.TryParse(MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION), out Version dbVersion); - var prevVersion = new Version("1.0.0"); - if (dbVersion == null || dbVersion.CompareTo(prevVersion) <= 0) - { - string schema = null; - - migrationBuilder.DropForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", schema); - - migrationBuilder.DropIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", schema); - - migrationBuilder.DropTable("mix_related_attribute_set"); - migrationBuilder.DropTable("mix_attribute_set_reference"); - - migrationBuilder.RenameTable("mix_related_post", schema, "mix_post_association"); - migrationBuilder.RenameTable("mix_attribute_set", schema, "mix_database"); - migrationBuilder.RenameTable("mix_related_attribute_data", schema, "mix_database_data_association"); - migrationBuilder.RenameTable("mix_attribute_set_value", schema, "mix_database_data_value"); - migrationBuilder.RenameTable("mix_attribute_set_data", schema, "mix_database_data"); - migrationBuilder.RenameTable("mix_attribute_field", schema, "mix_database_column"); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_column", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_column", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeFieldId", "mix_database_data_value", "MixDatabaseColumnId", schema); - migrationBuilder.RenameColumn("AttributeFieldName", "mix_database_data_value", "MixDatabaseColumnName", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_value", "MixDatabaseName", schema); - - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data_association", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_association", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data", "MixDatabaseName", schema); - - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - } - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - var dbVersion = MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION); - if (string.IsNullOrEmpty(dbVersion) || dbVersion == "1.0.0") - { - string schema = null; - - // mix_related_attribute_set and mix_attribute_set_reference not used, so we don't need to restore them. - - migrationBuilder.RenameTable("mix_post_association", schema, "mix_related_post"); - migrationBuilder.RenameTable("mix_database", schema, "mix_attribute_set"); - migrationBuilder.RenameTable("mix_database_data_association", schema, "mix_related_attribute_data"); - migrationBuilder.RenameTable("mix_database_data_value", schema, "mix_attribute_set_value"); - migrationBuilder.RenameTable("mix_database_data", schema, "mix_attribute_set_data"); - migrationBuilder.RenameTable("mix_database_column", schema, "mix_attribute_field"); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_column", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_column", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseColumnId", "mix_database_data_value", "AttributeFieldId", schema); - migrationBuilder.RenameColumn("MixDatabaseColumnName", "mix_database_data_value", "AttributeFieldName", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_value", "AttributeSetName", schema); - - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data_association", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_association", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data", "AttributeSetName", schema); - - migrationBuilder.CreateIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", "ReferenceId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", "DataId", schema); - - migrationBuilder.AddForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", "AttributeSetId", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", "Id", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", "Id", "mix_attribute_set", schema); - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.0"); - MixService.SaveSettings(); - } - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs deleted file mode 100644 index 4b1395c93..000000000 --- a/src/Mix.Cms.Lib/Migrations/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs +++ /dev/null @@ -1,2507 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.MySqlMixCms -{ - [DbContext(typeof(MySqlMixCmsContext))] - partial class MySqlMixCmsContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 64) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit(1)"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Configurations") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IsEncrypt") - .HasColumnType("bit(1)"); - - b.Property("IsMultiple") - .HasColumnType("bit(1)"); - - b.Property("IsRequire") - .HasColumnType("bit(1)"); - - b.Property("IsSelect") - .HasColumnType("bit(1)"); - - b.Property("IsUnique") - .HasColumnType("bit(1)"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("ReferenceId") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("int"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit(1)"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("double"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EncryptType") - .HasColumnType("int"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("IntegerValue") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("int"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageSize") - .HasColumnType("int"); - - b.Property("PostType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("PageId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("varchar(50) CHARACTER SET utf8mb4"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Views") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("DestinationId") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Position") - .HasColumnType("int"); - - b.Property("PostId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("ThemeId") - .HasColumnType("int"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("utf8_unicode_ci") - .HasCharSet("utf8"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.Designer.cs deleted file mode 100644 index fbdee95e7..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.Designer.cs +++ /dev/null @@ -1,479 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresSQLAccount -{ - [DbContext(typeof(PostgresSQLAccountContext))] - [Migration("20210122053253_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("ClaimType") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("ClaimValue") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ConcurrencyStamp") - .HasColumnType("varchar(400)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("NormalizedName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ClaimType") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("ClaimValue") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderKey") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderDisplayName") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("LoginProvider") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Value") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("Avatar") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("CountryId") - .HasColumnType("integer"); - - b.Property("Culture") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Dob") - .HasColumnType("timestamp without time zone") - .HasColumnName("DOB"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("FirstName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Gender") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsActived") - .HasColumnType("boolean"); - - b.Property("JoinDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("NickName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("NormalizedUserName") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("PasswordHash") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("PhoneNumber") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("RegisterType") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SecurityStamp") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Active") - .HasColumnType("boolean"); - - b.Property("AllowedOrigin") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ApplicationType") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("integer"); - - b.Property("Secret") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ClientId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("ExpiresUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IssuedUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Username") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Navigation("AspNetRoleClaims"); - - b.Navigation("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Navigation("AspNetUserClaimsApplicationUser"); - - b.Navigation("AspNetUserClaimsUser"); - - b.Navigation("AspNetUserLoginsApplicationUser"); - - b.Navigation("AspNetUserLoginsUser"); - - b.Navigation("AspNetUserRolesApplicationUser"); - - b.Navigation("AspNetUserRolesUser"); - - b.Navigation("AspNetUserTokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.cs b/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.cs deleted file mode 100644 index 32a2f29cb..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/20210122053253_Init.cs +++ /dev/null @@ -1,303 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Mix.Cms.Lib.Migrations.PostgresSQLAccount -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - ConcurrencyStamp = table.Column(type: "varchar(400)", nullable: true, collation: "und-x-icu"), - Name = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - NormalizedName = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - AccessFailedCount = table.Column(type: "integer", nullable: false), - Avatar = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - ConcurrencyStamp = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - CountryId = table.Column(type: "integer", nullable: false), - Culture = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - DOB = table.Column(type: "timestamp without time zone", nullable: true), - Email = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - EmailConfirmed = table.Column(type: "boolean", nullable: false), - FirstName = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Gender = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - IsActived = table.Column(type: "boolean", nullable: false), - JoinDate = table.Column(type: "timestamp without time zone", nullable: false), - LastModified = table.Column(type: "timestamp without time zone", nullable: false), - LastName = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - LockoutEnabled = table.Column(type: "boolean", nullable: false), - LockoutEnd = table.Column(type: "timestamp without time zone", nullable: true), - ModifiedBy = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - NickName = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - NormalizedEmail = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - NormalizedUserName = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - PasswordHash = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - PhoneNumber = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), - RegisterType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - SecurityStamp = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - TwoFactorEnabled = table.Column(type: "boolean", nullable: false), - UserName = table.Column(type: "character varying(250)", maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - Active = table.Column(type: "boolean", nullable: false), - AllowedOrigin = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - ApplicationType = table.Column(type: "integer", nullable: false), - Name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - RefreshTokenLifeTime = table.Column(type: "integer", nullable: false), - Secret = table.Column(type: "character varying(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "RefreshTokens", - columns: table => new - { - Id = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - ClientId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Email = table.Column(type: "character varying(250)", maxLength: 250, nullable: false), - Username = table.Column(type: "character varying(250)", maxLength: 250, nullable: true), - ExpiresUtc = table.Column(type: "timestamp without time zone", nullable: false), - IssuedUtc = table.Column(type: "timestamp without time zone", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RefreshTokens", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - ClaimType = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - ClaimValue = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - RoleId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - ApplicationUserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - ClaimType = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - ClaimValue = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - UserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - ProviderKey = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - ApplicationUserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - ProviderDisplayName = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - UserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins_1", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - RoleId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false), - ApplicationUserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - LoginProvider = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - Name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - Value = table.Column(type: "character varying(400)", maxLength: 400, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AspNetUserTokens_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_ApplicationUserId", - table: "AspNetUserClaims", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_ApplicationUserId", - table: "AspNetUserLogins", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_ApplicationUserId", - table: "AspNetUserRoles", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "RefreshTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/PostgresSQLAccountContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/PostgresSQLAccountContextModelSnapshot.cs deleted file mode 100644 index c6b3ae1bc..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresSQLAccount/PostgresSQLAccountContextModelSnapshot.cs +++ /dev/null @@ -1,477 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresSQLAccount -{ - [DbContext(typeof(PostgresSQLAccountContext))] - partial class PostgresSQLAccountContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("ClaimType") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("ClaimValue") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ConcurrencyStamp") - .HasColumnType("varchar(400)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("NormalizedName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ClaimType") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("ClaimValue") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderKey") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ProviderDisplayName") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("varchar(50)"); - - b.Property("ApplicationUserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("LoginProvider") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Value") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("Avatar") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("ConcurrencyStamp") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("CountryId") - .HasColumnType("integer"); - - b.Property("Culture") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Dob") - .HasColumnType("timestamp without time zone") - .HasColumnName("DOB"); - - b.Property("Email") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("FirstName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Gender") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("IsActived") - .HasColumnType("boolean"); - - b.Property("JoinDate") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("NickName") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("NormalizedUserName") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("PasswordHash") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("PhoneNumber") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("RegisterType") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("SecurityStamp") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Active") - .HasColumnType("boolean"); - - b.Property("AllowedOrigin") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ApplicationType") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("integer"); - - b.Property("Secret") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ClientId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.Property("ExpiresUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("IssuedUtc") - .HasColumnType("timestamp without time zone"); - - b.Property("Username") - .HasMaxLength(250) - .HasColumnType("character varying(250)"); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Navigation("AspNetRoleClaims"); - - b.Navigation("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Navigation("AspNetUserClaimsApplicationUser"); - - b.Navigation("AspNetUserClaimsUser"); - - b.Navigation("AspNetUserLoginsApplicationUser"); - - b.Navigation("AspNetUserLoginsUser"); - - b.Navigation("AspNetUserRolesApplicationUser"); - - b.Navigation("AspNetUserRolesUser"); - - b.Navigation("AspNetUserTokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.Designer.cs deleted file mode 100644 index 2eed36d4f..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.Designer.cs +++ /dev/null @@ -1,2518 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresqlMixCms -{ - [DbContext(typeof(PostgresqlMixCmsContext))] - [Migration("20210119170618_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiredDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("boolean"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Configurations") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IsEncrypt") - .HasColumnType("boolean"); - - b.Property("IsMultiple") - .HasColumnType("boolean"); - - b.Property("IsRequire") - .HasColumnType("boolean"); - - b.Property("IsSelect") - .HasColumnType("boolean"); - - b.Property("IsUnique") - .HasColumnType("boolean"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("ReferenceId") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("timestamp without time zone"); - - b.Property("DoubleValue") - .HasColumnType("double precision"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("integer"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("integer"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("integer"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("ParentId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("PublishedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("integer"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MediaId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_url_alias"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.cs b/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.cs deleted file mode 100644 index 5f3dd4dba..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210119170618_Init.cs +++ /dev/null @@ -1,1139 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresqlMixCms -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - migrationBuilder.CreateTable( - name: "mix_cache", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Value = table.Column(type: "text", nullable: false, collation: "und-x-icu"), - ExpiredDateTime = table.Column(type: "timestamp without time zone", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cache", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_cms_user", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Address = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Avatar = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - FirstName = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastName = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - MiddleName = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - PhoneNumber = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - Username = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Email = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cms_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_culture", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Alias = table.Column(type: "varchar(150)", nullable: true, collation: "und-x-icu"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - FullName = table.Column(type: "varchar(150)", nullable: true, collation: "und-x-icu"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LCID = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_culture", x => x.Id); - table.UniqueConstraint("AK_mix_culture_Specificulture", x => x.Specificulture); - }); - - migrationBuilder.CreateTable( - name: "mix_database", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Title = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - EdmSubject = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - EdmFrom = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - EdmAutoSend = table.Column(type: "boolean", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_column", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - MixDatabaseId = table.Column(type: "integer", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Configurations = table.Column(type: "text", nullable: true), - Regex = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - DefaultValue = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - Options = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - IsRequire = table.Column(type: "boolean", nullable: false), - IsEncrypt = table.Column(type: "boolean", nullable: false), - IsMultiple = table.Column(type: "boolean", nullable: false), - IsSelect = table.Column(type: "boolean", nullable: false), - IsUnique = table.Column(type: "boolean", nullable: false), - ReferenceId = table.Column(type: "integer", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_column", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_association", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - ParentId = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - ParentType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - MixDatabaseId = table.Column(type: "integer", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_association", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_value", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - MixDatabaseColumnId = table.Column(type: "integer", nullable: false), - MixDatabaseColumnName = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Regex = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - BooleanValue = table.Column(type: "boolean", nullable: true), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - DateTimeValue = table.Column(type: "timestamp without time zone", nullable: true), - DoubleValue = table.Column(type: "double precision", nullable: true), - IntegerValue = table.Column(type: "integer", nullable: true), - StringValue = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - EncryptValue = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - EncryptKey = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - EncryptType = table.Column(type: "integer", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_value", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_media", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Description = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FileProperties = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - FileSize = table.Column(type: "bigint", nullable: false), - FileType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Title = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Tags = table.Column(type: "varchar(400)", nullable: true, collation: "und-x-icu"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - TargetUrl = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PRIMARY", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - TextKeyword = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Url = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "und-x-icu"), - TextDefault = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Level = table.Column(type: "integer", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_theme", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - PreviewUrl = table.Column(type: "varchar(450)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_theme", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_configuration", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Value = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_configuration", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Configuration_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_language", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Value = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - DefaultValue = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_language", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Language_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_module", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Description = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Fields = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Name = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Type = table.Column(type: "integer", nullable: false), - PostType = table.Column(type: "text", nullable: true), - PageSize = table.Column(type: "integer", nullable: true), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_page", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Content = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - CssClass = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Excerpt = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Layout = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - Level = table.Column(type: "integer", nullable: true), - SeoDescription = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "und-x-icu"), - SeoTitle = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - StaticUrl = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Tags = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Title = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - PostType = table.Column(type: "text", nullable: true), - Views = table.Column(type: "integer", nullable: true), - PageSize = table.Column(type: "integer", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - Content = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - PublishedDateTime = table.Column(type: "timestamp without time zone", nullable: true), - Excerpt = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - ExtraProperties = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Icon = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - SeoDescription = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "und-x-icu"), - SeoTitle = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Tags = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Title = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Type = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - Views = table.Column(type: "integer", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_url_alias", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - SourceId = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Type = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Alias = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_url_alias", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Url_Alias_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - MixDatabaseId = table.Column(type: "integer", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_database_data_mix_database_MixDatabaseId", - column: x => x.MixDatabaseId, - principalTable: "mix_database", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_navigation", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - PageId = table.Column(type: "integer", nullable: false), - ParentId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_navigation", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page1", - column: x => x.ParentId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_role", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - PageId = table.Column(type: "integer", nullable: false), - RoleId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "character varying(50)", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "character varying(50)", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_role", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_role_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_file", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - StringContent = table.Column(type: "text", nullable: false, collation: "und-x-icu"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - ThemeId = table.Column(type: "integer", nullable: true), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_file", x => x.Id); - table.ForeignKey( - name: "FK_mix_file_mix_template", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_template", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Content = table.Column(type: "text", nullable: false, collation: "und-x-icu"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - MobileContent = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Scripts = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - SpaContent = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - Styles = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - ThemeId = table.Column(type: "integer", nullable: false), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_template", x => x.Id); - table.ForeignKey( - name: "FK_mix_template_mix_theme", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_module", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - ModuleId = table.Column(type: "integer", nullable: false), - PageId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Position = table.Column(type: "integer", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Menu_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Page_Module_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - ModuleId = table.Column(type: "integer", nullable: false), - PageId = table.Column(type: "integer", nullable: true), - PostId = table.Column(type: "integer", nullable: true), - Fields = table.Column(type: "text", nullable: false, collation: "und-x-icu"), - Value = table.Column(type: "text", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Data_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_module_data_mix_page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_module_data_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_post", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - PostId = table.Column(type: "integer", nullable: false), - ModuleId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_post", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - PostId = table.Column(type: "integer", nullable: false), - PageId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_association", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - SourceId = table.Column(type: "integer", nullable: false), - DestinationId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(450)", nullable: true, collation: "und-x-icu"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_association", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_association_mix_post", - columns: x => new { x.SourceId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_association_mix_post1", - columns: x => new { x.DestinationId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_media", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - MediaId = table.Column(type: "integer", nullable: false), - PostId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Position = table.Column(type: "integer", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_media", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_media_mix_media", - columns: x => new { x.MediaId, x.Specificulture }, - principalTable: "mix_media", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_media_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_module", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "und-x-icu"), - ModuleId = table.Column(type: "integer", nullable: false), - PostId = table.Column(type: "integer", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "und-x-icu"), - Position = table.Column(type: "integer", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - CreatedDateTime = table.Column(type: "timestamp without time zone", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "und-x-icu"), - LastModified = table.Column(type: "timestamp without time zone", nullable: true), - Priority = table.Column(type: "integer", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "und-x-icu") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "Index_ExpiresAtTime", - table: "mix_cache", - column: "ExpiredDateTime"); - - migrationBuilder.CreateIndex( - name: "IX_mix_configuration_Specificulture", - table: "mix_configuration", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_Mix_Culture", - table: "mix_culture", - column: "Specificulture", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_column_MixDatabaseId", - table: "mix_database_column", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_column_ReferenceId", - table: "mix_database_column", - column: "ReferenceId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_MixDatabaseId", - table: "mix_database_data", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_value_DataId", - table: "mix_database_data_value", - column: "DataId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_file_ThemeId", - table: "mix_file", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_language_Specificulture", - table: "mix_language", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_Specificulture", - table: "mix_module", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PostId_Specificulture", - table: "mix_module_data", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_ModuleId_Specificulture", - table: "mix_module_post", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_PostId_Specificulture", - table: "mix_module_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_Specificulture", - table: "mix_page", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_ModuleId_Specificulture", - table: "mix_page_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_PageId_Specificulture", - table: "mix_page_module", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PageId_Specificulture", - table: "mix_page_post", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PostId_Specificulture", - table: "mix_page_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "FK_mix_portal_page_navigation_mix_portal_page", - table: "mix_portal_page_navigation", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_navigation_ParentId", - table: "mix_portal_page_navigation", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_role_PageId", - table: "mix_portal_page_role", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_Specificulture", - table: "mix_post", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_DestinationId_Specificulture", - table: "mix_post_association", - columns: new[] { "DestinationId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_SourceId_Specificulture", - table: "mix_post_association", - columns: new[] { "SourceId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_MediaId_Specificulture", - table: "mix_post_media", - columns: new[] { "MediaId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_PostId_Specificulture", - table: "mix_post_media", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_ModuleId_Specificulture", - table: "mix_post_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_PostId_Specificulture", - table: "mix_post_module", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_template_file_TemplateId", - table: "mix_template", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_url_alias_Specificulture", - table: "mix_url_alias", - column: "Specificulture"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "mix_cache"); - - migrationBuilder.DropTable( - name: "mix_cms_user"); - - migrationBuilder.DropTable( - name: "mix_configuration"); - - migrationBuilder.DropTable( - name: "mix_database_column"); - - migrationBuilder.DropTable( - name: "mix_database_data"); - - migrationBuilder.DropTable( - name: "mix_database_data_association"); - - migrationBuilder.DropTable( - name: "mix_database_data_value"); - - migrationBuilder.DropTable( - name: "mix_file"); - - migrationBuilder.DropTable( - name: "mix_language"); - - migrationBuilder.DropTable( - name: "mix_module_data"); - - migrationBuilder.DropTable( - name: "mix_module_post"); - - migrationBuilder.DropTable( - name: "mix_page_module"); - - migrationBuilder.DropTable( - name: "mix_page_post"); - - migrationBuilder.DropTable( - name: "mix_portal_page_navigation"); - - migrationBuilder.DropTable( - name: "mix_portal_page_role"); - - migrationBuilder.DropTable( - name: "mix_post_association"); - - migrationBuilder.DropTable( - name: "mix_post_media"); - - migrationBuilder.DropTable( - name: "mix_post_module"); - - migrationBuilder.DropTable( - name: "mix_template"); - - migrationBuilder.DropTable( - name: "mix_url_alias"); - - migrationBuilder.DropTable( - name: "mix_database"); - - migrationBuilder.DropTable( - name: "mix_page"); - - migrationBuilder.DropTable( - name: "mix_portal_page"); - - migrationBuilder.DropTable( - name: "mix_media"); - - migrationBuilder.DropTable( - name: "mix_module"); - - migrationBuilder.DropTable( - name: "mix_post"); - - migrationBuilder.DropTable( - name: "mix_theme"); - - migrationBuilder.DropTable( - name: "mix_culture"); - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.Designer.cs b/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.Designer.cs deleted file mode 100644 index 93300921a..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.Designer.cs +++ /dev/null @@ -1,2518 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresqlMixCms -{ - [DbContext(typeof(PostgresqlMixCmsContext))] - [Migration("20210217103639_RenameDatabase")] - partial class RenameDatabase - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiredDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("boolean"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Configurations") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IsEncrypt") - .HasColumnType("boolean"); - - b.Property("IsMultiple") - .HasColumnType("boolean"); - - b.Property("IsRequire") - .HasColumnType("boolean"); - - b.Property("IsSelect") - .HasColumnType("boolean"); - - b.Property("IsUnique") - .HasColumnType("boolean"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("ReferenceId") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("timestamp without time zone"); - - b.Property("DoubleValue") - .HasColumnType("double precision"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("integer"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("integer"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("integer"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("ParentId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("PublishedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("integer"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MediaId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_url_alias"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.cs b/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.cs deleted file mode 100644 index 5dfffd83f..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/20210217103639_RenameDatabase.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using System; - -namespace Mix.Cms.Lib.Migrations.PostgresqlMixCms -{ - public partial class RenameDatabase : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - Version.TryParse(MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION), out Version dbVersion); - var prevVersion = new Version("1.0.0"); - if (dbVersion == null || dbVersion.CompareTo(prevVersion) <= 0) - { - string schema = null; - - migrationBuilder.DropForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", schema); - - migrationBuilder.DropIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", schema); - - migrationBuilder.DropTable("mix_related_attribute_set"); - migrationBuilder.DropTable("mix_attribute_set_reference"); - - migrationBuilder.RenameTable("mix_related_post", schema, "mix_post_association"); - migrationBuilder.RenameTable("mix_attribute_set", schema, "mix_database"); - migrationBuilder.RenameTable("mix_related_attribute_data", schema, "mix_database_data_association"); - migrationBuilder.RenameTable("mix_attribute_set_value", schema, "mix_database_data_value"); - migrationBuilder.RenameTable("mix_attribute_set_data", schema, "mix_database_data"); - migrationBuilder.RenameTable("mix_attribute_field", schema, "mix_database_column"); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_column", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_column", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeFieldId", "mix_database_data_value", "MixDatabaseColumnId", schema); - migrationBuilder.RenameColumn("AttributeFieldName", "mix_database_data_value", "MixDatabaseColumnName", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_value", "MixDatabaseName", schema); - - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data_association", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_association", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data", "MixDatabaseName", schema); - - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - } - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - var dbVersion = MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION); - if (string.IsNullOrEmpty(dbVersion) || dbVersion == "1.0.0") - { - string schema = null; - - // mix_related_attribute_set and mix_attribute_set_reference not used, so we don't need to restore them. - - migrationBuilder.RenameTable("mix_post_association", schema, "mix_related_post"); - migrationBuilder.RenameTable("mix_database", schema, "mix_attribute_set"); - migrationBuilder.RenameTable("mix_database_data_association", schema, "mix_related_attribute_data"); - migrationBuilder.RenameTable("mix_database_data_value", schema, "mix_attribute_set_value"); - migrationBuilder.RenameTable("mix_database_data", schema, "mix_attribute_set_data"); - migrationBuilder.RenameTable("mix_database_column", schema, "mix_attribute_field"); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_column", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_column", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseColumnId", "mix_database_data_value", "AttributeFieldId", schema); - migrationBuilder.RenameColumn("MixDatabaseColumnName", "mix_database_data_value", "AttributeFieldName", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_value", "AttributeSetName", schema); - - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data_association", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_association", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data", "AttributeSetName", schema); - - migrationBuilder.CreateIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", "ReferenceId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", "DataId", schema); - - migrationBuilder.AddForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", "AttributeSetId", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", "Id", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", "Id", "mix_attribute_set", schema); - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.0"); - MixService.SaveSettings(); - } - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs deleted file mode 100644 index efe52f46c..000000000 --- a/src/Mix.Cms.Lib/Migrations/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs +++ /dev/null @@ -1,2516 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Mix.Cms.Lib.Migrations.PostgresqlMixCms -{ - [DbContext(typeof(PostgresqlMixCmsContext))] - partial class PostgresqlMixCmsContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("ExpiredDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("boolean"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Configurations") - .HasColumnType("text"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IsEncrypt") - .HasColumnType("boolean"); - - b.Property("IsMultiple") - .HasColumnType("boolean"); - - b.Property("IsRequire") - .HasColumnType("boolean"); - - b.Property("IsSelect") - .HasColumnType("boolean"); - - b.Property("IsUnique") - .HasColumnType("boolean"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Options") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("ReferenceId") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("MixDatabaseId"); - - b.HasIndex("ReferenceId"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseId") - .HasColumnType("integer"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("boolean"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("timestamp without time zone"); - - b.Property("DoubleValue") - .HasColumnType("double precision"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("integer"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("integer"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("integer"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PRIMARY"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("integer"); - - b.Property("PostType") - .HasColumnType("text"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("Level") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("ParentId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.Property("PageId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("character varying(50)"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("PublishedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("integer"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MediaId") - .HasColumnType("integer"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("integer"); - - b.Property("Position") - .HasColumnType("integer"); - - b.Property("PostId") - .HasColumnType("integer"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("integer"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("integer"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("timestamp without time zone"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("integer"); - - b.Property("SourceId") - .HasColumnType("varchar(250)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("und-x-icu") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_url_alias"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/README.md b/src/Mix.Cms.Lib/Migrations/README.md deleted file mode 100644 index 3069d2aea..000000000 --- a/src/Mix.Cms.Lib/Migrations/README.md +++ /dev/null @@ -1,3 +0,0 @@ -1. Cannot apply defaultValue if using mysql db -2. Key not to long -3. must have maxLength for string column \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.Designer.cs deleted file mode 100644 index e64fd4db4..000000000 --- a/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.Designer.cs +++ /dev/null @@ -1,433 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; - -namespace Mix.Cms.Lib.Migrations.SQLAccount -{ - [DbContext(typeof(SQLAccountContext))] - [Migration("20200312035845_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.2") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RoleId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Name") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Value") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("CountryId") - .HasColumnType("int"); - - b.Property("Culture") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Dob") - .HasColumnName("DOB") - ; - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Gender") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsActived") - .HasColumnType("bit"); - - b.Property("JoinDate") - ; - - b.Property("LastModified") - ; - - b.Property("LastName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - ; - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NickName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RegisterType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("AllowedOrigin") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ApplicationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("int"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClientId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ExpiresUtc") - ; - - b.Property("IssuedUtc") - ; - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.cs b/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.cs deleted file mode 100644 index 618a51992..000000000 --- a/src/Mix.Cms.Lib/Migrations/SQLAccount/20200312035845_Init.cs +++ /dev/null @@ -1,305 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Mix.Cms.Lib.Migrations.SQLAccount -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - ConcurrencyStamp = table.Column(maxLength: 400, nullable: true), - Name = table.Column(maxLength: 250, nullable: true), - NormalizedName = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - AccessFailedCount = table.Column(nullable: false), - Avatar = table.Column(maxLength: 250, nullable: true), - ConcurrencyStamp = table.Column(maxLength: 250, nullable: true), - CountryId = table.Column(nullable: false), - Culture = table.Column(maxLength: 50, nullable: true), - DOB = table.Column(nullable: true), - Email = table.Column(maxLength: 250, nullable: true), - EmailConfirmed = table.Column(nullable: false), - FirstName = table.Column(maxLength: 50, nullable: true), - Gender = table.Column(maxLength: 50, nullable: true), - IsActived = table.Column(nullable: false), - JoinDate = table.Column(nullable: false), - LastModified = table.Column(nullable: false), - LastName = table.Column(maxLength: 50, nullable: true), - LockoutEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - ModifiedBy = table.Column(maxLength: 250, nullable: true), - NickName = table.Column(maxLength: 50, nullable: true), - NormalizedEmail = table.Column(maxLength: 250, nullable: true), - NormalizedUserName = table.Column(maxLength: 250, nullable: true), - PasswordHash = table.Column(maxLength: 250, nullable: true), - PhoneNumber = table.Column(maxLength: 50, nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - RegisterType = table.Column(maxLength: 50, nullable: true), - SecurityStamp = table.Column(maxLength: 50, nullable: true), - TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(maxLength: 250, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - Active = table.Column(nullable: false), - AllowedOrigin = table.Column(maxLength: 100, nullable: true), - ApplicationType = table.Column(nullable: false), - Name = table.Column(maxLength: 100, nullable: false), - RefreshTokenLifeTime = table.Column(nullable: false), - Secret = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "RefreshTokens", - columns: table => new - { - Id = table.Column(maxLength: 50, nullable: false), - ClientId = table.Column(maxLength: 50, nullable: true), - Email = table.Column(maxLength: 250, nullable: false), - Username = table.Column(maxLength: 250, nullable: true), - ExpiresUtc = table.Column(nullable: false), - IssuedUtc = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RefreshTokens", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ClaimType = table.Column(maxLength: 400, nullable: true), - ClaimValue = table.Column(maxLength: 400, nullable: true), - RoleId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true), - ClaimType = table.Column(maxLength: 400, nullable: true), - ClaimValue = table.Column(maxLength: 400, nullable: true), - UserId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(maxLength: 50, nullable: false), - ProviderKey = table.Column(maxLength: 50, nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true), - ProviderDisplayName = table.Column(maxLength: 400, nullable: true), - UserId = table.Column(maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins_1", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(maxLength: 50, nullable: false), - RoleId = table.Column(maxLength: 50, nullable: false), - ApplicationUserId = table.Column(maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_ApplicationUserId", - column: x => x.ApplicationUserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(maxLength: 50, nullable: false), - LoginProvider = table.Column(maxLength: 50, nullable: false), - Name = table.Column(maxLength: 50, nullable: false), - Value = table.Column(maxLength: 400, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AspNetUserTokens_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true, - filter: "([NormalizedName] IS NOT NULL)"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_ApplicationUserId", - table: "AspNetUserClaims", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_ApplicationUserId", - table: "AspNetUserLogins", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_ApplicationUserId", - table: "AspNetUserRoles", - column: "ApplicationUserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true, - filter: "([NormalizedUserName] IS NOT NULL)"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "RefreshTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Migrations/SQLAccount/MixCmsAccountContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/SQLAccount/MixCmsAccountContextModelSnapshot.cs deleted file mode 100644 index d716b95ed..000000000 --- a/src/Mix.Cms.Lib/Migrations/SQLAccount/MixCmsAccountContextModelSnapshot.cs +++ /dev/null @@ -1,431 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Account; - -namespace Mix.Cms.Lib.Migrations.MixCmsAccount -{ - [DbContext(typeof(SQLAccountContext))] - partial class SQLAccountContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.2") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoles", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("Name") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("([NormalizedName] IS NOT NULL)"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClaimType") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("LoginProvider", "ProviderKey") - .HasName("PK_AspNetUserLogins_1"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("RoleId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ApplicationUserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Name") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Value") - .HasColumnType("nvarchar(400)") - .HasMaxLength(400); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUsers", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("Avatar") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("CountryId") - .HasColumnType("int"); - - b.Property("Culture") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Dob") - .HasColumnName("DOB") - ; - - b.Property("Email") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Gender") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("IsActived") - .HasColumnType("bit"); - - b.Property("JoinDate") - ; - - b.Property("LastModified") - ; - - b.Property("LastName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - ; - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NickName") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RegisterType") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("([NormalizedUserName] IS NOT NULL)"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.Clients", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Active") - .HasColumnType("bit"); - - b.Property("AllowedOrigin") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("ApplicationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("RefreshTokenLifeTime") - .HasColumnType("int"); - - b.Property("Secret") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.RefreshTokens", b => - { - b.Property("Id") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("ClientId") - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("ExpiresUtc") - ; - - b.Property("IssuedUtc") - ; - - b.Property("Username") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("Id"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetRoleClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetRoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserClaims", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserClaimsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserClaimsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserLogins", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserLoginsApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserLoginsUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserRoles", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "ApplicationUser") - .WithMany("AspNetUserRolesApplicationUser") - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetRoles", "Role") - .WithMany("AspNetUserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserRolesUser") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Account.AspNetUserTokens", b => - { - b.HasOne("Mix.Cms.Lib.Models.Account.AspNetUsers", "User") - .WithMany("AspNetUserTokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.Designer.cs b/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.Designer.cs deleted file mode 100644 index 714967d5e..000000000 --- a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.Designer.cs +++ /dev/null @@ -1,2482 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.SqliteMixCms -{ - [DbContext(typeof(SqliteMixCmsContext))] - [Migration("20201227053439_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Configurations") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("INTEGER"); - - b.Property("IsMultiple") - .HasColumnType("INTEGER"); - - b.Property("IsRequire") - .HasColumnType("INTEGER"); - - b.Property("IsSelect") - .HasColumnType("INTEGER"); - - b.Property("IsUnique") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("ReferenceId") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("REAL"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("INTEGER"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("INTEGER"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("ParentId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("INTEGER"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.cs b/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.cs deleted file mode 100644 index cf8895012..000000000 --- a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20201227053439_Init.cs +++ /dev/null @@ -1,1121 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Lib.Migrations.SqliteMixCms -{ - public partial class Init : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - - migrationBuilder.CreateTable( - name: "mix_cache", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Value = table.Column(type: "text", nullable: false, collation: "NOCASE"), - ExpiredDateTime = table.Column(type: "datetime", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cache", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_cms_user", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Address = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Avatar = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - FirstName = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastName = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - MiddleName = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - PhoneNumber = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - Username = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Email = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_cms_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_culture", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Alias = table.Column(type: "varchar(150)", nullable: true, collation: "NOCASE"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - FullName = table.Column(type: "varchar(150)", nullable: true, collation: "NOCASE"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LCID = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_culture", x => x.Id); - table.UniqueConstraint("AK_mix_culture_Specificulture", x => x.Specificulture); - }); - - migrationBuilder.CreateTable( - name: "mix_database", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Title = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - EdmSubject = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - EdmFrom = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - EdmAutoSend = table.Column(type: "bit", nullable: true), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_column", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - MixDatabaseId = table.Column(type: "INTEGER", nullable: false), - MixDatabaseName = table.Column(type: "TEXT", maxLength: 250, nullable: true), - Configurations = table.Column(type: "TEXT", nullable: true), - Regex = table.Column(type: "TEXT", maxLength: 4000, nullable: true), - Title = table.Column(type: "TEXT", nullable: true), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - DefaultValue = table.Column(type: "ntext", nullable: true), - Name = table.Column(type: "TEXT", maxLength: 250, nullable: false), - Options = table.Column(type: "ntext", nullable: true), - IsRequire = table.Column(type: "INTEGER", nullable: false), - IsEncrypt = table.Column(type: "INTEGER", nullable: false), - IsMultiple = table.Column(type: "INTEGER", nullable: false), - IsSelect = table.Column(type: "INTEGER", nullable: false), - IsUnique = table.Column(type: "INTEGER", nullable: false), - ReferenceId = table.Column(type: "INTEGER", nullable: true), - ModifiedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_column", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_association", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - ParentId = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - ParentType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - MixDatabaseId = table.Column(type: "INTEGER", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_association", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data_value", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - MixDatabaseColumnId = table.Column(type: "INTEGER", nullable: false), - MixDatabaseColumnName = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Regex = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - BooleanValue = table.Column(type: "bit", nullable: true), - DataId = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - DateTimeValue = table.Column(type: "datetime", nullable: true), - DoubleValue = table.Column(type: "REAL", nullable: true), - IntegerValue = table.Column(type: "INTEGER", nullable: true), - StringValue = table.Column(type: "text", nullable: true, collation: "NOCASE"), - EncryptValue = table.Column(type: "text", nullable: true, collation: "NOCASE"), - EncryptKey = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - EncryptType = table.Column(type: "INTEGER", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data_value", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_media", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Description = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FileProperties = table.Column(type: "text", nullable: true, collation: "NOCASE"), - FileSize = table.Column(type: "INTEGER", nullable: false), - FileType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Title = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Tags = table.Column(type: "varchar(400)", nullable: true, collation: "NOCASE"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - TargetUrl = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_media", x => new { x.Id, x.Specificulture }); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - TextKeyword = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Url = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "NOCASE"), - TextDefault = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Level = table.Column(type: "INTEGER", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_theme", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Name = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - PreviewUrl = table.Column(type: "varchar(450)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_theme", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "mix_configuration", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Value = table.Column(type: "text", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_configuration", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Configuration_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_language", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Keyword = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Category = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - DataType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Value = table.Column(type: "text", nullable: true, collation: "NOCASE"), - DefaultValue = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_language", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Language_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_module", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Description = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Fields = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Name = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - FormTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - EdmTemplate = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Title = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Type = table.Column(type: "INTEGER", nullable: false), - PostType = table.Column(type: "TEXT", nullable: true), - PageSize = table.Column(type: "INTEGER", nullable: true), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_page", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Content = table.Column(type: "text", nullable: true, collation: "NOCASE"), - CssClass = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Excerpt = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Icon = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Layout = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - Level = table.Column(type: "INTEGER", nullable: true), - SeoDescription = table.Column(type: "text", nullable: true, collation: "NOCASE"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "NOCASE"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "NOCASE"), - SeoTitle = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - StaticUrl = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Tags = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Title = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Type = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - PostType = table.Column(type: "TEXT", nullable: true), - Views = table.Column(type: "INTEGER", nullable: true), - PageSize = table.Column(type: "INTEGER", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - Content = table.Column(type: "text", nullable: true, collation: "NOCASE"), - PublishedDateTime = table.Column(type: "datetime", nullable: true), - Excerpt = table.Column(type: "text", nullable: true, collation: "NOCASE"), - ExtraProperties = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Icon = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - SeoDescription = table.Column(type: "text", nullable: true, collation: "NOCASE"), - SeoKeywords = table.Column(type: "text", nullable: true, collation: "NOCASE"), - SeoName = table.Column(type: "varchar(500)", nullable: true, collation: "NOCASE"), - SeoTitle = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Source = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Tags = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Template = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Thumbnail = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Title = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Type = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - Views = table.Column(type: "INTEGER", nullable: true), - ExtraFields = table.Column(type: "text", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_url_alias", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - SourceId = table.Column(type: "TEXT", maxLength: 250, nullable: true), - Type = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "TEXT", maxLength: 4000, nullable: true), - Alias = table.Column(type: "TEXT", maxLength: 250, nullable: true), - CreatedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", unicode: false, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_url_alias", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Url_Alias_Mix_Culture", - column: x => x.Specificulture, - principalTable: "mix_culture", - principalColumn: "Specificulture", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_database_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - MixDatabaseId = table.Column(type: "INTEGER", nullable: false), - MixDatabaseName = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_database_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_database_data_mix_database_MixDatabaseId", - column: x => x.MixDatabaseId, - principalTable: "mix_database", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_navigation", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - PageId = table.Column(type: "INTEGER", nullable: false), - ParentId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_navigation", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_portal_page_navigation_mix_portal_page1", - column: x => x.ParentId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_portal_page_role", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - PageId = table.Column(type: "INTEGER", nullable: false), - RoleId = table.Column(type: "TEXT", maxLength: 50, nullable: true), - CreatedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: true), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "TEXT", unicode: false, maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_portal_page_role", x => x.Id); - table.ForeignKey( - name: "FK_mix_portal_page_role_mix_portal_page", - column: x => x.PageId, - principalTable: "mix_portal_page", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_file", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - StringContent = table.Column(type: "text", nullable: false, collation: "NOCASE"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - ThemeId = table.Column(type: "INTEGER", nullable: true), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_file", x => x.Id); - table.ForeignKey( - name: "FK_mix_file_mix_template", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_template", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Content = table.Column(type: "text", nullable: false, collation: "NOCASE"), - Extension = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - FileFolder = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FileName = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - FolderType = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - MobileContent = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Scripts = table.Column(type: "text", nullable: true, collation: "NOCASE"), - SpaContent = table.Column(type: "text", nullable: true, collation: "NOCASE"), - Styles = table.Column(type: "text", nullable: true, collation: "NOCASE"), - ThemeId = table.Column(type: "INTEGER", nullable: false), - ThemeName = table.Column(type: "varchar(250)", nullable: false, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_template", x => x.Id); - table.ForeignKey( - name: "FK_mix_template_mix_theme", - column: x => x.ThemeId, - principalTable: "mix_theme", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_module", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - ModuleId = table.Column(type: "INTEGER", nullable: false), - PageId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Position = table.Column(type: "INTEGER", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Menu_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Page_Module_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_data", - columns: table => new - { - Id = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE"), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - ModuleId = table.Column(type: "INTEGER", nullable: false), - PageId = table.Column(type: "INTEGER", nullable: true), - PostId = table.Column(type: "INTEGER", nullable: true), - Fields = table.Column(type: "text", nullable: false, collation: "NOCASE"), - Value = table.Column(type: "text", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_data", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Data_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_module_data_mix_page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_module_data_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_module_post", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - PostId = table.Column(type: "INTEGER", nullable: false), - ModuleId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_module_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Module", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Module_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_page_post", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - PostId = table.Column(type: "INTEGER", nullable: false), - PageId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_page_post", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Page", - columns: x => new { x.PageId, x.Specificulture }, - principalTable: "mix_page", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Mix_Page_Post_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_association", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - SourceId = table.Column(type: "INTEGER", nullable: false), - DestinationId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(450)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(450)", nullable: true, collation: "NOCASE"), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_association", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_association_mix_post", - columns: x => new { x.SourceId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_association_mix_post1", - columns: x => new { x.DestinationId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_media", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - MediaId = table.Column(type: "INTEGER", nullable: false), - PostId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Position = table.Column(type: "INTEGER", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_media", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_mix_post_media_mix_media", - columns: x => new { x.MediaId, x.Specificulture }, - principalTable: "mix_media", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_mix_post_media_mix_post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "mix_post_module", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false), - Specificulture = table.Column(type: "varchar(10)", nullable: false, collation: "NOCASE"), - ModuleId = table.Column(type: "INTEGER", nullable: false), - PostId = table.Column(type: "INTEGER", nullable: false), - Description = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Image = table.Column(type: "varchar(250)", nullable: true, collation: "NOCASE"), - Position = table.Column(type: "INTEGER", nullable: false), - CreatedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - CreatedDateTime = table.Column(type: "datetime", nullable: false), - ModifiedBy = table.Column(type: "varchar(50)", nullable: true, collation: "NOCASE"), - LastModified = table.Column(type: "datetime", nullable: true), - Priority = table.Column(type: "INTEGER", nullable: false), - Status = table.Column(type: "varchar(50)", nullable: false, collation: "NOCASE") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_post_module", x => new { x.Id, x.Specificulture }); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Module1", - columns: x => new { x.ModuleId, x.Specificulture }, - principalTable: "mix_module", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Mix_Post_Module_Mix_Post", - columns: x => new { x.PostId, x.Specificulture }, - principalTable: "mix_post", - principalColumns: new[] { "Id", "Specificulture" }, - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "Index_ExpiresAtTime", - table: "mix_cache", - column: "ExpiredDateTime"); - - migrationBuilder.CreateIndex( - name: "IX_mix_configuration_Specificulture", - table: "mix_configuration", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_Mix_Culture", - table: "mix_culture", - column: "Specificulture", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_MixDatabaseId", - table: "mix_database_data", - column: "MixDatabaseId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_database_data_value_DataId", - table: "mix_database_data_value", - column: "DataId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_file_ThemeId", - table: "mix_file", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_language_Specificulture", - table: "mix_language", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_Specificulture", - table: "mix_module", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_ModuleId_Specificulture", - table: "mix_module_data", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PageId_Specificulture", - table: "mix_module_data", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_data_PostId_Specificulture", - table: "mix_module_data", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_ModuleId_Specificulture", - table: "mix_module_post", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_module_post_PostId_Specificulture", - table: "mix_module_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_Specificulture", - table: "mix_page", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_ModuleId_Specificulture", - table: "mix_page_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_module_PageId_Specificulture", - table: "mix_page_module", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PageId_Specificulture", - table: "mix_page_post", - columns: new[] { "PageId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_page_post_PostId_Specificulture", - table: "mix_page_post", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "FK_mix_portal_page_navigation_mix_portal_page", - table: "mix_portal_page_navigation", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_navigation_ParentId", - table: "mix_portal_page_navigation", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_portal_page_role_PageId", - table: "mix_portal_page_role", - column: "PageId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_Specificulture", - table: "mix_post", - column: "Specificulture"); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_DestinationId_Specificulture", - table: "mix_post_association", - columns: new[] { "DestinationId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_association_SourceId_Specificulture", - table: "mix_post_association", - columns: new[] { "SourceId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_MediaId_Specificulture", - table: "mix_post_media", - columns: new[] { "MediaId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_media_PostId_Specificulture", - table: "mix_post_media", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_ModuleId_Specificulture", - table: "mix_post_module", - columns: new[] { "ModuleId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_post_module_PostId_Specificulture", - table: "mix_post_module", - columns: new[] { "PostId", "Specificulture" }); - - migrationBuilder.CreateIndex( - name: "IX_mix_template_file_TemplateId", - table: "mix_template", - column: "ThemeId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_url_alias_Specificulture", - table: "mix_url_alias", - column: "Specificulture"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "mix_cache"); - - migrationBuilder.DropTable( - name: "mix_cms_user"); - - migrationBuilder.DropTable( - name: "mix_configuration"); - - migrationBuilder.DropTable( - name: "mix_database_column"); - - migrationBuilder.DropTable( - name: "mix_database_data"); - - migrationBuilder.DropTable( - name: "mix_database_data_association"); - - migrationBuilder.DropTable( - name: "mix_database_data_value"); - - migrationBuilder.DropTable( - name: "mix_file"); - - migrationBuilder.DropTable( - name: "mix_language"); - - migrationBuilder.DropTable( - name: "mix_module_data"); - - migrationBuilder.DropTable( - name: "mix_module_post"); - - migrationBuilder.DropTable( - name: "mix_page_module"); - - migrationBuilder.DropTable( - name: "mix_page_post"); - - migrationBuilder.DropTable( - name: "mix_portal_page_navigation"); - - migrationBuilder.DropTable( - name: "mix_portal_page_role"); - - migrationBuilder.DropTable( - name: "mix_post_association"); - - migrationBuilder.DropTable( - name: "mix_post_media"); - - migrationBuilder.DropTable( - name: "mix_post_module"); - - migrationBuilder.DropTable( - name: "mix_template"); - - migrationBuilder.DropTable( - name: "mix_url_alias"); - - migrationBuilder.DropTable( - name: "mix_database"); - - migrationBuilder.DropTable( - name: "mix_page"); - - migrationBuilder.DropTable( - name: "mix_portal_page"); - - migrationBuilder.DropTable( - name: "mix_media"); - - migrationBuilder.DropTable( - name: "mix_module"); - - migrationBuilder.DropTable( - name: "mix_post"); - - migrationBuilder.DropTable( - name: "mix_theme"); - - migrationBuilder.DropTable( - name: "mix_culture"); - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.Designer.cs b/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.Designer.cs deleted file mode 100644 index 8a177d619..000000000 --- a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.Designer.cs +++ /dev/null @@ -1,2482 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.SqliteMixCms -{ - [DbContext(typeof(SqliteMixCmsContext))] - [Migration("20210217111513_RenameDatabase")] - partial class RenameDatabase - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Configurations") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("INTEGER"); - - b.Property("IsMultiple") - .HasColumnType("INTEGER"); - - b.Property("IsRequire") - .HasColumnType("INTEGER"); - - b.Property("IsSelect") - .HasColumnType("INTEGER"); - - b.Property("IsUnique") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("ReferenceId") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("REAL"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("INTEGER"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("INTEGER"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("ParentId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("INTEGER"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.cs b/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.cs deleted file mode 100644 index 06b985658..000000000 --- a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/20210217111513_RenameDatabase.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Lib.Migrations.SqliteMixCms -{ - public partial class RenameDatabase : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - Version.TryParse(MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION), out Version dbVersion); - var prevVersion = new Version("1.0.0"); - if (dbVersion == null || dbVersion.CompareTo(prevVersion) <= 0) - { - string schema = null; - - migrationBuilder.DropForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", schema); - migrationBuilder.DropForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", schema); - - migrationBuilder.DropIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", schema); - migrationBuilder.DropIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", schema); - - migrationBuilder.DropTable("mix_related_attribute_set"); - migrationBuilder.DropTable("mix_attribute_set_reference"); - - migrationBuilder.RenameTable("mix_related_post", schema, "mix_post_association"); - migrationBuilder.RenameTable("mix_attribute_set", schema, "mix_database"); - migrationBuilder.RenameTable("mix_related_attribute_data", schema, "mix_database_data_association"); - migrationBuilder.RenameTable("mix_attribute_set_value", schema, "mix_database_data_value"); - migrationBuilder.RenameTable("mix_attribute_set_data", schema, "mix_database_data"); - migrationBuilder.RenameTable("mix_attribute_field", schema, "mix_database_column"); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_column", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_column", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeFieldId", "mix_database_data_value", "MixDatabaseColumnId", schema); - migrationBuilder.RenameColumn("AttributeFieldName", "mix_database_data_value", "MixDatabaseColumnName", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_value", "MixDatabaseName", schema); - - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data_association", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data_association", "MixDatabaseName", schema); - - migrationBuilder.RenameColumn("AttributeSetId", "mix_database_data", "MixDatabaseId", schema); - migrationBuilder.RenameColumn("AttributeSetName", "mix_database_data", "MixDatabaseName", schema); - - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.1"); - MixService.SaveSettings(); - } - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - var dbVersion = MixService.GetConfig(MixConfigurations.CONST_MIXCORE_VERSION); - if (string.IsNullOrEmpty(dbVersion) || dbVersion == "1.0.0") - { - string schema = null; - - // mix_related_attribute_set and mix_attribute_set_reference not used, so we don't need to restore them. - - migrationBuilder.RenameTable("mix_post_association", schema, "mix_related_post"); - migrationBuilder.RenameTable("mix_database", schema, "mix_attribute_set"); - migrationBuilder.RenameTable("mix_database_data_association", schema, "mix_related_attribute_data"); - migrationBuilder.RenameTable("mix_database_data_value", schema, "mix_attribute_set_value"); - migrationBuilder.RenameTable("mix_database_data", schema, "mix_attribute_set_data"); - migrationBuilder.RenameTable("mix_database_column", schema, "mix_attribute_field"); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_column", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_column", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseColumnId", "mix_database_data_value", "AttributeFieldId", schema); - migrationBuilder.RenameColumn("MixDatabaseColumnName", "mix_database_data_value", "AttributeFieldName", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_value", "AttributeSetName", schema); - - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data_association", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data_association", "AttributeSetName", schema); - - migrationBuilder.RenameColumn("MixDatabaseId", "mix_database_data", "AttributeSetId", schema); - migrationBuilder.RenameColumn("MixDatabaseName", "mix_database_data", "AttributeSetName", schema); - - migrationBuilder.CreateIndex("IX_mix_attribute_field_AttributeSetId", "mix_attribute_field", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_field_ReferenceId", "mix_attribute_field", "ReferenceId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_data_AttributeSetId", "mix_attribute_set_data", "AttributeSetId", schema); - migrationBuilder.CreateIndex("IX_mix_attribute_set_value_DataId", "mix_attribute_set_value", "DataId", schema); - - migrationBuilder.AddForeignKey("FK_mix_attribute_set_data_mix_attribute_set", "mix_attribute_set_data", "AttributeSetId", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set", "mix_attribute_field", "Id", "mix_attribute_set", schema); - migrationBuilder.AddForeignKey("FK_mix_attribute_field_mix_attribute_set1", "mix_attribute_field", "Id", "mix_attribute_set", schema); - - MixService.SetConfig(MixConfigurations.CONST_MIXCORE_VERSION, "1.0.0"); - MixService.SaveSettings(); - } - } - } -} diff --git a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs b/src/Mix.Cms.Lib/Migrations/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs deleted file mode 100644 index 8fa442f3a..000000000 --- a/src/Mix.Cms.Lib/Migrations/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs +++ /dev/null @@ -1,2480 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Migrations.SqliteMixCms -{ - [DbContext(typeof(SqliteMixCmsContext))] - partial class SqliteMixCmsContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCache", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("ExpiredDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ExpiredDateTime") - .HasDatabaseName("Index_ExpiresAtTime"); - - b.ToTable("mix_cache"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCmsUser", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Address") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Avatar") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Email") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FirstName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("LastName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MiddleName") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PhoneNumber") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Username") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_cms_user"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_configuration"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_configuration"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Alias") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FullName") - .HasColumnType("varchar(150)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Lcid") - .HasColumnType("varchar(50)") - .HasColumnName("LCID") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .IsRequired() - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("Specificulture") - .IsUnique() - .HasDatabaseName("IX_Mix_Culture"); - - b.ToTable("mix_culture"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabase", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmAutoSend") - .HasColumnType("bit"); - - b.Property("EdmFrom") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmSubject") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_database"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseColumn", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Configurations") - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("ntext"); - - b.Property("IsEncrypt") - .HasColumnType("INTEGER"); - - b.Property("IsMultiple") - .HasColumnType("INTEGER"); - - b.Property("IsRequire") - .HasColumnType("INTEGER"); - - b.Property("IsSelect") - .HasColumnType("INTEGER"); - - b.Property("IsUnique") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Options") - .HasColumnType("ntext"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("ReferenceId") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("mix_database_column"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data"); - - b.HasIndex("MixDatabaseId"); - - b.ToTable("mix_database_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataAssociation", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ParentType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_association"); - - b.ToTable("mix_database_data_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseDataValue", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("BooleanValue") - .HasColumnType("bit"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataId") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DateTimeValue") - .HasColumnType("datetime"); - - b.Property("DoubleValue") - .HasColumnType("REAL"); - - b.Property("EncryptKey") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EncryptType") - .HasColumnType("INTEGER"); - - b.Property("EncryptValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("IntegerValue") - .HasColumnType("INTEGER"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MixDatabaseColumnId") - .HasColumnType("INTEGER"); - - b.Property("MixDatabaseColumnName") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("MixDatabaseName") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Regex") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringValue") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_database_data_value"); - - b.HasIndex("DataId"); - - b.ToTable("mix_database_data_value"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StringContent") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId"); - - b.ToTable("mix_file"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Category") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("DataType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DefaultValue") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_language"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_language"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileSize") - .HasColumnType("INTEGER"); - - b.Property("FileType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("varchar(400)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TargetUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_media"); - - b.ToTable("mix_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("EdmTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Fields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FormTemplate") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.Property("Id") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Fields") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Value") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_data"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.HasIndex("ModuleId", "PageId", "Specificulture"); - - b.ToTable("mix_module_data"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_module_post"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_module_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("CssClass") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Layout") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageSize") - .HasColumnType("INTEGER"); - - b.Property("PostType") - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("StaticUrl") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PageId", "Specificulture"); - - b.ToTable("mix_page_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_page_post"); - - b.HasIndex("PageId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_page_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextDefault") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("TextKeyword") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Url") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_portal_page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("ParentId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("PageId") - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - b.HasIndex("ParentId"); - - b.ToTable("mix_portal_page_navigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("PageId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.HasKey("Id") - .HasName("PK_mix_portal_page_role"); - - b.HasIndex("PageId"); - - b.ToTable("mix_portal_page_role"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Content") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Excerpt") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraFields") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Icon") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("PublishedDateTime") - .HasColumnType("datetime"); - - b.Property("SeoDescription") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoKeywords") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoName") - .HasColumnType("varchar(500)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SeoTitle") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Source") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Tags") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Template") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Type") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Views") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_post"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("DestinationId") - .HasColumnType("INTEGER"); - - b.Property("Image") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_association"); - - b.HasIndex("DestinationId", "Specificulture"); - - b.HasIndex("SourceId", "Specificulture"); - - b.ToTable("mix_post_association"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MediaId") - .HasColumnType("INTEGER"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_media"); - - b.HasIndex("MediaId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_media"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModuleId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("PostId") - .HasColumnType("INTEGER"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id", "Specificulture") - .HasName("PK_mix_post_module"); - - b.HasIndex("ModuleId", "Specificulture"); - - b.HasIndex("PostId", "Specificulture"); - - b.ToTable("mix_post_module"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Extension") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileFolder") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("FolderType") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("MobileContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Scripts") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("SpaContent") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Styles") - .HasColumnType("text") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("ThemeId") - .HasColumnType("INTEGER"); - - b.Property("ThemeName") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.HasIndex("ThemeId") - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - b.ToTable("mix_template"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("CreatedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Image") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("PreviewUrl") - .HasColumnType("varchar(450)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("Status") - .IsRequired() - .HasColumnType("varchar(50)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Thumbnail") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Title") - .HasColumnType("varchar(250)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.HasKey("Id"); - - b.ToTable("mix_theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.Property("Id") - .HasColumnType("INTEGER"); - - b.Property("Specificulture") - .HasColumnType("varchar(10)") - .UseCollation("NOCASE") - .HasAnnotation("MySql:CharSet", "utf8"); - - b.Property("Alias") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("CreatedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("CreatedDateTime") - .HasColumnType("datetime"); - - b.Property("Description") - .HasMaxLength(4000) - .HasColumnType("TEXT"); - - b.Property("LastModified") - .HasColumnType("datetime"); - - b.Property("ModifiedBy") - .HasMaxLength(50) - .IsUnicode(false) - .HasColumnType("TEXT"); - - b.Property("Priority") - .HasColumnType("INTEGER"); - - b.Property("SourceId") - .HasMaxLength(250) - .HasColumnType("TEXT"); - - b.Property("Status") - .IsRequired() - .IsUnicode(false) - .HasColumnType("varchar(50)"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id", "Specificulture"); - - b.HasIndex("Specificulture"); - - b.ToTable("mix_url_alias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixConfiguration", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixConfiguration") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Configuration_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixDatabaseData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixDatabase", "MixDatabase") - .WithMany() - .HasForeignKey("MixDatabaseId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MixDatabase"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixFile", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixFile") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_file_mix_template"); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixLanguage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixLanguage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Language_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixModule") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Module_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModuleData", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModuleData") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Data_Mix_Module") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixModuleData") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_page"); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModuleData") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_module_data_mix_post"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModulePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixModulePost") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Module") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixModulePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Module_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPage") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Page_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPageModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPageModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPageModule") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Module_Mix_Page") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPagePost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPage", "MixPage") - .WithMany("MixPagePost") - .HasForeignKey("PageId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPagePost") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Page_Post_Mix_Post") - .IsRequired(); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageNavigation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageNavigationPage") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Parent") - .WithMany("MixPortalPageNavigationParent") - .HasForeignKey("ParentId") - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1") - .IsRequired(); - - b.Navigation("Page"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPageRole", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPortalPage", "Page") - .WithMany("MixPortalPageRole") - .HasForeignKey("PageId") - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Page"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixPost") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Post_Mix_Culture") - .HasPrincipalKey("Specificulture") - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostAssociation", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixRelatedPostMixPost") - .HasForeignKey("DestinationId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post1") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "S") - .WithMany("MixRelatedPostS") - .HasForeignKey("SourceId", "Specificulture") - .HasConstraintName("FK_mix_post_association_mix_post") - .IsRequired(); - - b.Navigation("MixPost"); - - b.Navigation("S"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostMedia", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixMedia", "MixMedia") - .WithMany("MixPostMedia") - .HasForeignKey("MediaId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_media") - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostMedia") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_mix_post_media_mix_post") - .IsRequired(); - - b.Navigation("MixMedia"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPostModule", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixModule", "MixModule") - .WithMany("MixPostModule") - .HasForeignKey("ModuleId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Mix.Cms.Lib.Models.Cms.MixPost", "MixPost") - .WithMany("MixPostModule") - .HasForeignKey("PostId", "Specificulture") - .HasConstraintName("FK_Mix_Post_Module_Mix_Post") - .IsRequired(); - - b.Navigation("MixModule"); - - b.Navigation("MixPost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTemplate", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixTheme", "Theme") - .WithMany("MixTemplate") - .HasForeignKey("ThemeId") - .HasConstraintName("FK_mix_template_mix_theme") - .IsRequired(); - - b.Navigation("Theme"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixUrlAlias", b => - { - b.HasOne("Mix.Cms.Lib.Models.Cms.MixCulture", "SpecificultureNavigation") - .WithMany("MixUrlAlias") - .HasForeignKey("Specificulture") - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture") - .HasPrincipalKey("Specificulture") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SpecificultureNavigation"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixCulture", b => - { - b.Navigation("MixConfiguration"); - - b.Navigation("MixLanguage"); - - b.Navigation("MixModule"); - - b.Navigation("MixPage"); - - b.Navigation("MixPost"); - - b.Navigation("MixUrlAlias"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixMedia", b => - { - b.Navigation("MixPostMedia"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixModule", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPostModule"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPage", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixPageModule"); - - b.Navigation("MixPagePost"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPortalPage", b => - { - b.Navigation("MixPortalPageNavigationPage"); - - b.Navigation("MixPortalPageNavigationParent"); - - b.Navigation("MixPortalPageRole"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixPost", b => - { - b.Navigation("MixModuleData"); - - b.Navigation("MixModulePost"); - - b.Navigation("MixPagePost"); - - b.Navigation("MixPostMedia"); - - b.Navigation("MixPostModule"); - - b.Navigation("MixRelatedPostMixPost"); - - b.Navigation("MixRelatedPostS"); - }); - - modelBuilder.Entity("Mix.Cms.Lib.Models.Cms.MixTheme", b => - { - b.Navigation("MixFile"); - - b.Navigation("MixTemplate"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Mix.Cms.Lib/Mix.Cms.Lib.csproj b/src/Mix.Cms.Lib/Mix.Cms.Lib.csproj deleted file mode 100644 index cff09cda8..000000000 --- a/src/Mix.Cms.Lib/Mix.Cms.Lib.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net5.0 - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Mix.Cms.Lib/Models/Account/AspNetRoleClaims.cs b/src/Mix.Cms.Lib/Models/Account/AspNetRoleClaims.cs deleted file mode 100644 index 713e7c2fe..000000000 --- a/src/Mix.Cms.Lib/Models/Account/AspNetRoleClaims.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Mix.Cms.Lib.Models.Account -{ - public partial class AspNetRoleClaims - { - public int Id { get; set; } - public string ClaimType { get; set; } - public string ClaimValue { get; set; } - public string RoleId { get; set; } - - public virtual AspNetRoles Role { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/AspNetUserClaims.cs b/src/Mix.Cms.Lib/Models/Account/AspNetUserClaims.cs deleted file mode 100644 index e28e90cad..000000000 --- a/src/Mix.Cms.Lib/Models/Account/AspNetUserClaims.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Mix.Cms.Lib.Models.Account -{ - public partial class AspNetUserClaims - { - public int Id { get; set; } - public string ApplicationUserId { get; set; } - public string ClaimType { get; set; } - public string ClaimValue { get; set; } - public string UserId { get; set; } - - public virtual AspNetUsers ApplicationUser { get; set; } - public virtual AspNetUsers User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/AspNetUserLogins.cs b/src/Mix.Cms.Lib/Models/Account/AspNetUserLogins.cs deleted file mode 100644 index 2553193e4..000000000 --- a/src/Mix.Cms.Lib/Models/Account/AspNetUserLogins.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Mix.Cms.Lib.Models.Account -{ - public partial class AspNetUserLogins - { - public string LoginProvider { get; set; } - public string ProviderKey { get; set; } - public string ApplicationUserId { get; set; } - public string ProviderDisplayName { get; set; } - public string UserId { get; set; } - - public virtual AspNetUsers ApplicationUser { get; set; } - public virtual AspNetUsers User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/AspNetUserRoles.cs b/src/Mix.Cms.Lib/Models/Account/AspNetUserRoles.cs deleted file mode 100644 index 4e3a72970..000000000 --- a/src/Mix.Cms.Lib/Models/Account/AspNetUserRoles.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Mix.Cms.Lib.Models.Account -{ - public partial class AspNetUserRoles - { - public string UserId { get; set; } - public string RoleId { get; set; } - public string ApplicationUserId { get; set; } - - public virtual AspNetUsers ApplicationUser { get; set; } - public virtual AspNetRoles Role { get; set; } - public virtual AspNetUsers User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/AspNetUserTokens.cs b/src/Mix.Cms.Lib/Models/Account/AspNetUserTokens.cs deleted file mode 100644 index d8e18a78a..000000000 --- a/src/Mix.Cms.Lib/Models/Account/AspNetUserTokens.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Mix.Cms.Lib.Models.Account -{ - public partial class AspNetUserTokens - { - public string UserId { get; set; } - public string LoginProvider { get; set; } - public string Name { get; set; } - public string Value { get; set; } - - public virtual AspNetUsers User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/RefreshTokens.cs b/src/Mix.Cms.Lib/Models/Account/RefreshTokens.cs deleted file mode 100644 index 9fff6f217..000000000 --- a/src/Mix.Cms.Lib/Models/Account/RefreshTokens.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Mix.Cms.Lib.Models.Account -{ - public partial class RefreshTokens - { - public string Id { get; set; } - public string ClientId { get; set; } - public string Email { get; set; } - public string Username { get; set; } - public DateTime ExpiresUtc { get; set; } - public DateTime IssuedUtc { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/_MixCmsAccountContext.cs b/src/Mix.Cms.Lib/Models/Account/_MixCmsAccountContext.cs deleted file mode 100644 index 75e599eca..000000000 --- a/src/Mix.Cms.Lib/Models/Account/_MixCmsAccountContext.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Services; -using Mix.Identity.Data; -using MySqlConnector; - -namespace Mix.Cms.Lib.Models.Account -{ - public partial class MixCmsAccountContext : DbContext - { - public virtual DbSet AspNetRoleClaims { get; set; } - public virtual DbSet AspNetRoles { get; set; } - public virtual DbSet AspNetUserClaims { get; set; } - public virtual DbSet AspNetUserLogins { get; set; } - public virtual DbSet AspNetUserRoles { get; set; } - public virtual DbSet AspNetUsers { get; set; } - public virtual DbSet AspNetUserTokens { get; set; } - public virtual DbSet Clients { get; set; } - public virtual DbSet RefreshTokens { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The options. - public MixCmsAccountContext(DbContextOptions options) - : base(options) - { - } - - public MixCmsAccountContext() - { - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - string cnn = MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION); - if (!string.IsNullOrEmpty(cnn)) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - optionsBuilder.UseSqlServer(cnn); - break; - - case MixDatabaseProvider.MySQL: - optionsBuilder.UseMySql(cnn, ServerVersion.AutoDetect(cnn)); - break; - - case MixDatabaseProvider.SQLITE: - optionsBuilder.UseSqlite(cnn); - break; - - case MixDatabaseProvider.PostgreSQL: - optionsBuilder.UseNpgsql(cnn); - break; - - default: - break; - } - } - } - - //Ref https://github.com/dotnet/efcore/issues/10169 - public override void Dispose() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - SqlConnection.ClearPool((SqlConnection)Database.GetDbConnection()); - break; - - case MixDatabaseProvider.MySQL: - MySqlConnection.ClearPool((MySqlConnection)Database.GetDbConnection()); - break; - } - base.Dispose(); - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.PostgreSQL: - modelBuilder.ApplyPostgresIddentityConfigurations(); - break; - - case MixDatabaseProvider.MSSQL: - case MixDatabaseProvider.MySQL: - case MixDatabaseProvider.SQLITE: - default: - modelBuilder.ApplyIddentityConfigurations(); - break; - } - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/_MixDbContext.cs b/src/Mix.Cms.Lib/Models/Account/_MixDbContext.cs deleted file mode 100644 index 8f1275dc5..000000000 --- a/src/Mix.Cms.Lib/Models/Account/_MixDbContext.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Mix.Identity.Entities; -using Mix.Identity.Models; -using MySqlConnector; - -namespace Mix.Cms.Lib.Models.Account -{ - public class MixDbContext : IdentityDbContext - { - /// - /// Initializes a new instance of the class. - /// - /// The options. - public MixDbContext(DbContextOptions options) - : base(options) - { - } - - /// - /// Initializes a new instance of the class. - /// - public MixDbContext() - { - } - - public DbSet Clients { get; set; } - public DbSet RefreshTokens { get; set; } - - /// - /// Called when [model creating]. - /// - /// The builder. - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - // Customize the ASP.NET Identity model and override the defaults if needed. - // For example, you can rename the ASP.NET Identity table names and more. - // Add your customizations after calling base.OnModelCreating(builder); - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - string cnn = MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION); - if (!string.IsNullOrEmpty(cnn)) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - optionsBuilder.UseSqlServer(cnn); - break; - - case MixDatabaseProvider.MySQL: - optionsBuilder.UseMySql(cnn, ServerVersion.AutoDetect(cnn)); - break; - - case MixDatabaseProvider.SQLITE: - optionsBuilder.UseSqlite(cnn); - break; - - case MixDatabaseProvider.PostgreSQL: - optionsBuilder.UseNpgsql(cnn); - break; - - default: - break; - } - } - } - - //Ref https://github.com/dotnet/efcore/issues/10169 - public override void Dispose() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - SqlConnection.ClearPool((SqlConnection)Database.GetDbConnection()); - break; - - case MixDatabaseProvider.MySQL: - MySqlConnection.ClearPool((MySqlConnection)Database.GetDbConnection()); - break; - } - base.Dispose(); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/_PostgresSQLAccountContext.cs b/src/Mix.Cms.Lib/Models/Account/_PostgresSQLAccountContext.cs deleted file mode 100644 index f497f6574..000000000 --- a/src/Mix.Cms.Lib/Models/Account/_PostgresSQLAccountContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; -using Mix.Identity.Data; - -namespace Mix.Cms.Lib.Models.Account -{ - public partial class PostgresSQLAccountContext : MixCmsAccountContext - { - /// - /// Initializes a new instance of the class. - /// - /// The options. - public PostgresSQLAccountContext(DbContextOptions options) - : base(options) - { - } - - public PostgresSQLAccountContext() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyPostgresIddentityConfigurations(); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Account/_SQLAccountContext.cs b/src/Mix.Cms.Lib/Models/Account/_SQLAccountContext.cs deleted file mode 100644 index a4409d1bf..000000000 --- a/src/Mix.Cms.Lib/Models/Account/_SQLAccountContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; -using Mix.Identity.Data; - -namespace Mix.Cms.Lib.Models.Account -{ - public partial class SQLAccountContext : MixCmsAccountContext - { - /// - /// Initializes a new instance of the class. - /// - /// The options. - public SQLAccountContext(DbContextOptions options) - : base(options) - { - } - - public SQLAccountContext() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyIddentityConfigurations(); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixCache.cs b/src/Mix.Cms.Lib/Models/Cms/MixCache.cs deleted file mode 100644 index ebfcba93e..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixCache.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixCache - { - public string Id { get; set; } - public string Value { get; set; } - public DateTime? ExpiredDateTime { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixCmsUser.cs b/src/Mix.Cms.Lib/Models/Cms/MixCmsUser.cs deleted file mode 100644 index 15275d5e2..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixCmsUser.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixCmsUser - { - public string Id { get; set; } - public string Address { get; set; } - public string Avatar { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string MiddleName { get; set; } - public string PhoneNumber { get; set; } - public string Username { get; set; } - public string Email { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixUserStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixConfiguration.cs b/src/Mix.Cms.Lib/Models/Cms/MixConfiguration.cs deleted file mode 100644 index 214f0cb1f..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixConfiguration.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixConfiguration - { - public int Id { get; set; } - public string Specificulture { get; set; } - public string Keyword { get; set; } - public string Category { get; set; } - public MixDataType DataType { get; set; } - public string Description { get; set; } - public string Value { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixCulture.cs b/src/Mix.Cms.Lib/Models/Cms/MixCulture.cs deleted file mode 100644 index f33295a87..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixCulture.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixCulture - { - public MixCulture() - { - MixConfiguration = new HashSet(); - MixLanguage = new HashSet(); - MixModule = new HashSet(); - MixPage = new HashSet(); - MixPost = new HashSet(); - MixUrlAlias = new HashSet(); - } - - public int Id { get; set; } - public string Alias { get; set; } - public string Description { get; set; } - public string FullName { get; set; } - public string Icon { get; set; } - public string Lcid { get; set; } - public string Specificulture { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual ICollection MixConfiguration { get; set; } - public virtual ICollection MixLanguage { get; set; } - public virtual ICollection MixModule { get; set; } - public virtual ICollection MixPage { get; set; } - public virtual ICollection MixPost { get; set; } - public virtual ICollection MixUrlAlias { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixDatabase.cs b/src/Mix.Cms.Lib/Models/Cms/MixDatabase.cs deleted file mode 100644 index 9fedc8f5a..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixDatabase.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixDatabase - { - public MixDatabase() - { - } - - public int Id { get; set; } - public MixDatabaseType Type { get; set; } - public string Title { get; set; } - public string Name { get; set; } - public string Description { get; set; } - public string FormTemplate { get; set; } - public string EdmTemplate { get; set; } - public string EdmSubject { get; set; } - public string EdmFrom { get; set; } - public bool? EdmAutoSend { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseColumn.cs b/src/Mix.Cms.Lib/Models/Cms/MixDatabaseColumn.cs deleted file mode 100644 index dc1614e56..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseColumn.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixDatabaseColumn - { - public int Id { get; set; } - public int MixDatabaseId { get; set; } - public string MixDatabaseName { get; set; } - public string Configurations { get; set; } - public string Regex { get; set; } - public string Title { get; set; } - public MixDataType DataType { get; set; } - public string DefaultValue { get; set; } - public string Name { get; set; } - public string Options { get; set; } - public bool IsRequire { get; set; } - public bool IsEncrypt { get; set; } - public bool IsMultiple { get; set; } - public bool IsSelect { get; set; } - public bool IsUnique { get; set; } - public int? ReferenceId { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseData.cs b/src/Mix.Cms.Lib/Models/Cms/MixDatabaseData.cs deleted file mode 100644 index 4dd1896ad..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseData.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixDatabaseData - { - public string Id { get; set; } - public string Specificulture { get; set; } - public int MixDatabaseId { get; set; } - public string MixDatabaseName { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixDatabase MixDatabase { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataAssociation.cs b/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataAssociation.cs deleted file mode 100644 index c196e9847..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataAssociation.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixDatabaseDataAssociation - { - public string Id { get; set; } - public string Specificulture { get; set; } - public string DataId { get; set; } - public string ParentId { get; set; } - public MixDatabaseParentType ParentType { get; set; } - public int MixDatabaseId { get; set; } - public string MixDatabaseName { get; set; } - public string Description { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataValue.cs b/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataValue.cs deleted file mode 100644 index 8084b683d..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixDatabaseDataValue.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixDatabaseDataValue - { - public string Id { get; set; } - public string Specificulture { get; set; } - public int MixDatabaseColumnId { get; set; } - public string MixDatabaseColumnName { get; set; } - public string MixDatabaseName { get; set; } - public string Regex { get; set; } - public MixDataType DataType { get; set; } - public bool? BooleanValue { get; set; } - public string DataId { get; set; } - public DateTime? DateTimeValue { get; set; } - public double? DoubleValue { get; set; } - public int? IntegerValue { get; set; } - public string StringValue { get; set; } - public string EncryptValue { get; set; } - public string EncryptKey { get; set; } - public int EncryptType { get; set; } - public string ModifiedBy { get; set; } - public string CreatedBy { get; set; } - public DateTime? LastModified { get; set; } - public DateTime CreatedDateTime { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixFile.cs b/src/Mix.Cms.Lib/Models/Cms/MixFile.cs deleted file mode 100644 index aa9138573..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixFile.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixFile - { - public int Id { get; set; } - public string StringContent { get; set; } - public string Extension { get; set; } - public string FileFolder { get; set; } - public string FileName { get; set; } - public string FolderType { get; set; } - public int? ThemeId { get; set; } - public string ThemeName { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixTheme Theme { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixLanguage.cs b/src/Mix.Cms.Lib/Models/Cms/MixLanguage.cs deleted file mode 100644 index 66d5e5925..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixLanguage.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixLanguage - { - public int Id { get; set; } - public string Specificulture { get; set; } - public string Keyword { get; set; } - public string Category { get; set; } - public MixDataType DataType { get; set; } - public string Description { get; set; } - public string Value { get; set; } - public string DefaultValue { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMedia.cs b/src/Mix.Cms.Lib/Models/Cms/MixMedia.cs deleted file mode 100644 index 6bdc8785a..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMedia.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMedia - { - public MixMedia() - { - MixPostMedia = new HashSet(); - } - - public int Id { get; set; } - public string Specificulture { get; set; } - public string Description { get; set; } - public string Extension { get; set; } - public string FileFolder { get; set; } - public string FileName { get; set; } - public string FileProperties { get; set; } - public long FileSize { get; set; } - public string FileType { get; set; } - public string Title { get; set; } - public string Tags { get; set; } - public string Source { get; set; } - public string TargetUrl { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual ICollection MixPostMedia { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerHubRoom.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerHubRoom.cs deleted file mode 100644 index 882d6eb6e..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerHubRoom.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerHubRoom - { - public MixMessengerHubRoom() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavRoomUser = new HashSet(); - } - - public Guid Id { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public string Description { get; set; } - public string HostId { get; set; } - public bool IsOpen { get; set; } - public DateTime? LastModified { get; set; } - public string Name { get; set; } - public int? TeamId { get; set; } - public string Title { get; set; } - - public virtual ICollection MixMessengerMessage { get; set; } - public virtual ICollection MixMessengerNavRoomUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerMessage.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerMessage.cs deleted file mode 100644 index 0187ed2be..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerMessage - { - public Guid Id { get; set; } - public string Content { get; set; } - public DateTime CreatedDate { get; set; } - public Guid? RoomId { get; set; } - public int? TeamId { get; set; } - public string UserId { get; set; } - - public virtual MixMessengerHubRoom Room { get; set; } - public virtual MixMessengerTeam Team { get; set; } - public virtual MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavRoomUser.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavRoomUser.cs deleted file mode 100644 index 93bcfb587..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavRoomUser.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerNavRoomUser - { - public Guid RoomId { get; set; } - public string UserId { get; set; } - public DateTime JoinedDate { get; set; } - - public virtual MixMessengerHubRoom Room { get; set; } - public virtual MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavTeamUser.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavTeamUser.cs deleted file mode 100644 index 77c33a498..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerNavTeamUser.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerNavTeamUser - { - public int TeamId { get; set; } - public string UserId { get; set; } - public DateTime JoinedDate { get; set; } - public DateTime? LastModified { get; set; } - public int Status { get; set; } - - public virtual MixMessengerTeam Team { get; set; } - public virtual MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerTeam.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerTeam.cs deleted file mode 100644 index 89e6c1ea7..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerTeam.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerTeam - { - public MixMessengerTeam() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavTeamUser = new HashSet(); - } - - public int Id { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public string HostId { get; set; } - public bool? IsOpen { get; set; } - public string Name { get; set; } - public int Type { get; set; } - - public virtual ICollection MixMessengerMessage { get; set; } - public virtual ICollection MixMessengerNavTeamUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerUser.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerUser.cs deleted file mode 100644 index 06612ffd3..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerUser.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerUser - { - public MixMessengerUser() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavRoomUser = new HashSet(); - MixMessengerNavTeamUser = new HashSet(); - } - - public string Id { get; set; } - public string FacebookId { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public DateTime? LastModified { get; set; } - public string Name { get; set; } - public int Status { get; set; } - - public virtual ICollection MixMessengerMessage { get; set; } - public virtual ICollection MixMessengerNavRoomUser { get; set; } - public virtual ICollection MixMessengerNavTeamUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixMessengerUserDevice.cs b/src/Mix.Cms.Lib/Models/Cms/MixMessengerUserDevice.cs deleted file mode 100644 index 53867fb81..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixMessengerUserDevice.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixMessengerUserDevice - { - public string UserId { get; set; } - public string ConnectionId { get; set; } - public string DeviceId { get; set; } - public int Status { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixModule.cs b/src/Mix.Cms.Lib/Models/Cms/MixModule.cs deleted file mode 100644 index 6e71d2b6e..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixModule.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixModule - { - public MixModule() - { - MixModuleData = new HashSet(); - MixModulePost = new HashSet(); - MixPageModule = new HashSet(); - MixPostModule = new HashSet(); - } - - public int Id { get; set; } - public string Specificulture { get; set; } - public string Description { get; set; } - public string Fields { get; set; } - public string Thumbnail { get; set; } - public string Image { get; set; } - public string Name { get; set; } - public string Template { get; set; } - public string FormTemplate { get; set; } - public string EdmTemplate { get; set; } - public string Title { get; set; } - public int Type { get; set; } - public string PostType { get; set; } - public int? PageSize { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - public virtual ICollection MixModuleData { get; set; } - public virtual ICollection MixModulePost { get; set; } - public virtual ICollection MixPageModule { get; set; } - public virtual ICollection MixPostModule { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixModuleData.cs b/src/Mix.Cms.Lib/Models/Cms/MixModuleData.cs deleted file mode 100644 index 93c3806fb..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixModuleData.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixModuleData - { - public string Id { get; set; } - public string Specificulture { get; set; } - public int ModuleId { get; set; } - public int? PageId { get; set; } - public int? PostId { get; set; } - public string Fields { get; set; } - public string Value { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixModule MixModule { get; set; } - public virtual MixPage MixPage { get; set; } - public virtual MixPost MixPost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixModulePost.cs b/src/Mix.Cms.Lib/Models/Cms/MixModulePost.cs deleted file mode 100644 index c043027a2..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixModulePost.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixModulePost - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int PostId { get; set; } - public int ModuleId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixModule MixModule { get; set; } - public virtual MixPost MixPost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPage.cs b/src/Mix.Cms.Lib/Models/Cms/MixPage.cs deleted file mode 100644 index 141aa5204..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPage.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPage - { - public MixPage() - { - MixModuleData = new HashSet(); - MixPageModule = new HashSet(); - MixPagePost = new HashSet(); - } - - public int Id { get; set; } - public string Specificulture { get; set; } - public string Content { get; set; } - public string CssClass { get; set; } - public string Excerpt { get; set; } - public string Icon { get; set; } - public string Image { get; set; } - public string Layout { get; set; } - public int? Level { get; set; } - public string SeoDescription { get; set; } - public string SeoKeywords { get; set; } - public string SeoName { get; set; } - public string SeoTitle { get; set; } - public string StaticUrl { get; set; } - public string Tags { get; set; } - public string Template { get; set; } - public string Title { get; set; } - public MixPageType Type { get; set; } - public string PostType { get; set; } - public int? Views { get; set; } - public int? PageSize { get; set; } - public string ExtraFields { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - public virtual ICollection MixModuleData { get; set; } - public virtual ICollection MixPageModule { get; set; } - public virtual ICollection MixPagePost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPageModule.cs b/src/Mix.Cms.Lib/Models/Cms/MixPageModule.cs deleted file mode 100644 index 5d5a7f5a1..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPageModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPageModule - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int ModuleId { get; set; } - public int PageId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public int Position { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixModule MixModule { get; set; } - public virtual MixPage MixPage { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPagePost.cs b/src/Mix.Cms.Lib/Models/Cms/MixPagePost.cs deleted file mode 100644 index 14e9db766..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPagePost.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPagePost - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int PostId { get; set; } - public int PageId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixPage MixPage { get; set; } - public virtual MixPost MixPost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPortalPage.cs b/src/Mix.Cms.Lib/Models/Cms/MixPortalPage.cs deleted file mode 100644 index e03f412fc..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPortalPage.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPortalPage - { - public MixPortalPage() - { - MixPortalPageNavigationPage = new HashSet(); - MixPortalPageNavigationParent = new HashSet(); - MixPortalPageRole = new HashSet(); - } - - public int Id { get; set; } - public string Icon { get; set; } - public string TextKeyword { get; set; } - public string Url { get; set; } - public string Description { get; set; } - public string TextDefault { get; set; } - public int Level { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual ICollection MixPortalPageNavigationPage { get; set; } - public virtual ICollection MixPortalPageNavigationParent { get; set; } - public virtual ICollection MixPortalPageRole { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPortalPageNavigation.cs b/src/Mix.Cms.Lib/Models/Cms/MixPortalPageNavigation.cs deleted file mode 100644 index fb202755f..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPortalPageNavigation.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPortalPageNavigation - { - public int Id { get; set; } - public int PageId { get; set; } - public int ParentId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixPortalPage Page { get; set; } - public virtual MixPortalPage Parent { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPortalPageRole.cs b/src/Mix.Cms.Lib/Models/Cms/MixPortalPageRole.cs deleted file mode 100644 index 35b068bf8..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPortalPageRole.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPortalPageRole - { - public int Id { get; set; } - public int PageId { get; set; } - public string RoleId { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixPortalPage Page { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPost.cs b/src/Mix.Cms.Lib/Models/Cms/MixPost.cs deleted file mode 100644 index f6ddd0c36..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPost.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPost - { - public MixPost() - { - MixModuleData = new HashSet(); - MixModulePost = new HashSet(); - MixPagePost = new HashSet(); - MixPostMedia = new HashSet(); - MixPostModule = new HashSet(); - MixRelatedPostMixPost = new HashSet(); - MixRelatedPostS = new HashSet(); - } - - public int Id { get; set; } - public string Specificulture { get; set; } - public string Content { get; set; } - public DateTime? PublishedDateTime { get; set; } - public string Excerpt { get; set; } - public string ExtraProperties { get; set; } - public string Icon { get; set; } - public string Image { get; set; } - public string SeoDescription { get; set; } - public string SeoKeywords { get; set; } - public string SeoName { get; set; } - public string SeoTitle { get; set; } - public string Source { get; set; } - public string Tags { get; set; } - public string Template { get; set; } - public string Thumbnail { get; set; } - public string Title { get; set; } - public string Type { get; set; } - public int? Views { get; set; } - public string ExtraFields { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - public virtual ICollection MixModuleData { get; set; } - public virtual ICollection MixModulePost { get; set; } - public virtual ICollection MixPagePost { get; set; } - public virtual ICollection MixPostMedia { get; set; } - public virtual ICollection MixPostModule { get; set; } - public virtual ICollection MixRelatedPostMixPost { get; set; } - public virtual ICollection MixRelatedPostS { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPostAssociation.cs b/src/Mix.Cms.Lib/Models/Cms/MixPostAssociation.cs deleted file mode 100644 index bb6964f67..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPostAssociation.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPostAssociation - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int SourceId { get; set; } - public int DestinationId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixPost MixPost { get; set; } - public virtual MixPost S { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPostMedia.cs b/src/Mix.Cms.Lib/Models/Cms/MixPostMedia.cs deleted file mode 100644 index 55592bdf9..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPostMedia.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPostMedia - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int MediaId { get; set; } - public int PostId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public int Position { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixMedia MixMedia { get; set; } - public virtual MixPost MixPost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixPostModule.cs b/src/Mix.Cms.Lib/Models/Cms/MixPostModule.cs deleted file mode 100644 index a9955cab3..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixPostModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixPostModule - { - public int Id { get; set; } - public string Specificulture { get; set; } - public int ModuleId { get; set; } - public int PostId { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public int Position { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixModule MixModule { get; set; } - public virtual MixPost MixPost { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixTemplate.cs b/src/Mix.Cms.Lib/Models/Cms/MixTemplate.cs deleted file mode 100644 index b49a3af83..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixTemplate.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixTemplate - { - public int Id { get; set; } - public string Content { get; set; } - public string Extension { get; set; } - public string FileFolder { get; set; } - public string FileName { get; set; } - public string FolderType { get; set; } - public string MobileContent { get; set; } - public string Scripts { get; set; } - public string SpaContent { get; set; } - public string Styles { get; set; } - public int ThemeId { get; set; } - public string ThemeName { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixTheme Theme { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixTheme.cs b/src/Mix.Cms.Lib/Models/Cms/MixTheme.cs deleted file mode 100644 index d94cf918a..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixTheme.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixTheme - { - public MixTheme() - { - MixFile = new HashSet(); - MixTemplate = new HashSet(); - } - - public int Id { get; set; } - public string Thumbnail { get; set; } - public string Image { get; set; } - public string Title { get; set; } - public string Name { get; set; } - public string PreviewUrl { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual ICollection MixFile { get; set; } - public virtual ICollection MixTemplate { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/MixUrlAlias.cs b/src/Mix.Cms.Lib/Models/Cms/MixUrlAlias.cs deleted file mode 100644 index b1604537f..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/MixUrlAlias.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixUrlAlias - { - public int Id { get; set; } - public string Specificulture { get; set; } - public string SourceId { get; set; } - public int Type { get; set; } - public string Description { get; set; } - public string Alias { get; set; } - public string CreatedBy { get; set; } - public DateTime CreatedDateTime { get; set; } - public string ModifiedBy { get; set; } - public DateTime? LastModified { get; set; } - public int Priority { get; set; } - public MixContentStatus Status { get; set; } - - public virtual MixCulture SpecificultureNavigation { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/_MixCmsContext.cs b/src/Mix.Cms.Lib/Models/Cms/_MixCmsContext.cs deleted file mode 100644 index faef4d357..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/_MixCmsContext.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Services; -using MySqlConnector; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MixCmsContext : DbContext - { - public virtual DbSet MixDatabaseColumn { get; set; } - public virtual DbSet MixDatabase { get; set; } - public virtual DbSet MixDatabaseData { get; set; } - public virtual DbSet MixDatabaseDataAssociation { get; set; } - public virtual DbSet MixDatabaseDataValue { get; set; } - public virtual DbSet MixCache { get; set; } - public virtual DbSet MixCmsUser { get; set; } - public virtual DbSet MixConfiguration { get; set; } - public virtual DbSet MixCulture { get; set; } - public virtual DbSet MixFile { get; set; } - public virtual DbSet MixLanguage { get; set; } - public virtual DbSet MixMedia { get; set; } - public virtual DbSet MixModule { get; set; } - public virtual DbSet MixModuleData { get; set; } - public virtual DbSet MixModulePost { get; set; } - public virtual DbSet MixPage { get; set; } - public virtual DbSet MixPageModule { get; set; } - public virtual DbSet MixPagePost { get; set; } - public virtual DbSet MixPortalPage { get; set; } - public virtual DbSet MixPortalPageNavigation { get; set; } - public virtual DbSet MixPortalPageRole { get; set; } - public virtual DbSet MixPost { get; set; } - public virtual DbSet MixPostMedia { get; set; } - public virtual DbSet MixPostModule { get; set; } - - public virtual DbSet MixRelatedPost { get; set; } - public virtual DbSet MixTemplate { get; set; } - public virtual DbSet MixTheme { get; set; } - public virtual DbSet MixUrlAlias { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The options. - public MixCmsContext(DbContextOptions options) - : base(options) - { - } - - public MixCmsContext() - { - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - //optionsBuilder.EnableSensitiveDataLogging(true); - //define the database to use - string cnn = MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION); - if (!string.IsNullOrEmpty(cnn)) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - optionsBuilder.UseSqlServer(cnn); - break; - - case MixDatabaseProvider.MySQL: - optionsBuilder.UseMySql(cnn, ServerVersion.AutoDetect(cnn)); - break; - - case MixDatabaseProvider.SQLITE: - optionsBuilder.UseSqlite(cnn); - break; - - case MixDatabaseProvider.PostgreSQL: - optionsBuilder.UseNpgsql(cnn); - break; - - default: - break; - } - } - } - - //Ref https://github.com/dotnet/efcore/issues/10169 - public override void Dispose() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - SqlConnection.ClearPool((SqlConnection)Database.GetDbConnection()); - break; - - case MixDatabaseProvider.MySQL: - MySqlConnection.ClearPool((MySqlConnection)Database.GetDbConnection()); - break; - } - base.Dispose(); - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - string ns = string.Empty; - switch (provider) - { - case MixDatabaseProvider.MSSQL: - ns = "Mix.Cms.Lib.Models.EntityConfigurations.MSSQL"; - break; - - case MixDatabaseProvider.MySQL: - ns = "Mix.Cms.Lib.Models.EntityConfigurations.MySQL"; - break; - - case MixDatabaseProvider.SQLITE: - ns = "Mix.Cms.Lib.Models.EntityConfigurations.SQLITE"; - break; - - case MixDatabaseProvider.PostgreSQL: - ns = "Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL"; - break; - - default: - break; - } - modelBuilder.ApplyAllConfigurationsFromNamespace(this.GetType().Assembly, ns); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/_MsSqlMixCmsContext.cs b/src/Mix.Cms.Lib/Models/Cms/_MsSqlMixCmsContext.cs deleted file mode 100644 index e07329944..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/_MsSqlMixCmsContext.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MsSqlMixCmsContext : MixCmsContext - { - public MsSqlMixCmsContext() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyAllConfigurationsFromNamespace( - this.GetType().Assembly, - "Mix.Cms.Lib.Models.EntityConfigurations.MSSQL"); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/_MySqlMixCmsContext.cs b/src/Mix.Cms.Lib/Models/Cms/_MySqlMixCmsContext.cs deleted file mode 100644 index 494b47c0e..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/_MySqlMixCmsContext.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class MySqlMixCmsContext : MixCmsContext - { - /// - /// Initializes a new instance of the class. - /// - /// The options. - public MySqlMixCmsContext(DbContextOptions options) - : base(options) - { - } - - public MySqlMixCmsContext() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyAllConfigurationsFromNamespace( - this.GetType().Assembly, - "Mix.Cms.Lib.Models.EntityConfigurations.MySQL"); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/_PostgresqlMixCmsContext.cs b/src/Mix.Cms.Lib/Models/Cms/_PostgresqlMixCmsContext.cs deleted file mode 100644 index 3355bc8c9..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/_PostgresqlMixCmsContext.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class PostgresqlMixCmsContext : MixCmsContext - { - public PostgresqlMixCmsContext() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The options. - public PostgresqlMixCmsContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyAllConfigurationsFromNamespace( - this.GetType().Assembly, - "Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL"); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Cms/_SqliteMixCmsContext.cs b/src/Mix.Cms.Lib/Models/Cms/_SqliteMixCmsContext.cs deleted file mode 100644 index 4f9f90131..000000000 --- a/src/Mix.Cms.Lib/Models/Cms/_SqliteMixCmsContext.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib.Extensions; - -namespace Mix.Cms.Lib.Models.Cms -{ - public partial class SqliteMixCmsContext : MixCmsContext - { - public SqliteMixCmsContext() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyAllConfigurationsFromNamespace( - this.GetType().Assembly, - "Mix.Cms.Lib.Models.EntityConfigurations.SQLITE"); - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Common/MenuItem.cs b/src/Mix.Cms.Lib/Models/Common/MenuItem.cs deleted file mode 100644 index ff7a2295f..000000000 --- a/src/Mix.Cms.Lib/Models/Common/MenuItem.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Common -{ - public class MenuItem - { - [JsonIgnore] - [JsonProperty("obj")] - public JObject Obj { get; set; } - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("uri")] - public string Uri { get; set; } - - [JsonProperty("href")] - public string Href { - get { - var domain = MixService.GetConfig(MixAppSettingKeywords.Domain); - return Uri.Contains(domain) ? Uri : $"{domain}{Uri}"; - } - } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("type")] - public MixMenuItemType Type { get; set; } - - [JsonProperty("target")] - public string Target { get; set; } - - [JsonProperty("classes")] - public string Classes { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("target_id")] - public string TargetId { get; set; } - - [JsonProperty("isActive")] - public bool IsActive { get; set; } - - [JsonProperty("menu_items")] - public List MenuItems { get; set; } - - public T Property(string fieldName) - { - if (Obj != null) - { - var field = Obj.GetValue(fieldName); - if (field != null) - { - return field.Value(); - } - else - { - return default; - } - } - else - { - return default; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Common/MixNavigation.cs b/src/Mix.Cms.Lib/Models/Common/MixNavigation.cs deleted file mode 100644 index b1d15b1d8..000000000 --- a/src/Mix.Cms.Lib/Models/Common/MixNavigation.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Models.Common -{ - public class MixNavigation - { - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("menu_items")] - public List MenuItems { get; set; } = new List(); - - [JsonProperty("actived_menu_items")] - public List ActivedMenuItems { get; set; } = new List(); - - [JsonProperty("actived_menu_item")] - public MenuItem ActivedMenuItem { get; set; } - - public MixNavigation() - { - } - - public MixNavigation(JObject obj, string culture) - { - Id = obj["id"].Value(); - Specificulture = culture; - Title = obj["title"].Value(); - Name = obj["name"].Value(); - MenuItems = obj["menu_items"].ToObject>(); - MenuItems.ForEach(m => m.Specificulture = Specificulture); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCacheConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCacheConfiguration.cs deleted file mode 100644 index 7e797994f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCacheConfiguration.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixCacheConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cache"); - - entity.HasIndex(e => e.ExpiredDateTime) - .HasDatabaseName("Index_ExpiresAtTime"); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.ExpiredDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Value) - .IsRequired() - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCmsUserConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCmsUserConfiguration.cs deleted file mode 100644 index ab33e0940..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCmsUserConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixCmsUserConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cms_user"); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Address) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Avatar) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Email) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FirstName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.LastName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MiddleName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.PhoneNumber) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Username) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixConfigurationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixConfigurationConfiguration.cs deleted file mode 100644 index ff993a45a..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixConfigurationConfiguration.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixConfigurationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_configuration"); - - entity.ToTable("mix_configuration"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Category) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Value) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixConfiguration) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Configuration_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCultureConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCultureConfiguration.cs deleted file mode 100644 index 1b03f17dc..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixCultureConfiguration.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixCultureConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_culture"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture) - .HasDatabaseName("IX_Mix_Culture") - .IsUnique(); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FullName) - .HasColumnType("nvarchar(150)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Lcid) - .HasColumnName("LCID") - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseColumnConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseColumnConfiguration.cs deleted file mode 100644 index c4d643764..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseColumnConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixDatabaseColumnConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database_column"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MixDatabaseName).HasMaxLength(250); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue).HasColumnType("ntext"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.Options).HasColumnType("ntext"); - - entity.Property(e => e.Regex).HasMaxLength(4000); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseConfiguration.cs deleted file mode 100644 index abd658f1c..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseConfiguration.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixDatabaseConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.EdmAutoSend).HasColumnType("bit"); - - entity.Property(e => e.EdmFrom) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.EdmSubject) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Type) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataAssociationConfiguration.cs deleted file mode 100644 index 658c1be6a..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataAssociationConfiguration.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixDatabaseDataAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_association"); - - entity.ToTable("mix_database_data_association"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ParentId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ParentType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataConfiguration.cs deleted file mode 100644 index 5218bc047..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataConfiguration.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixDatabaseDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data"); - - entity.ToTable("mix_database_data"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataValueConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataValueConfiguration.cs deleted file mode 100644 index 0220985cd..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixDatabaseDataValueConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixDatabaseDataValueConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_value"); - - entity.ToTable("mix_database_data_value"); - - entity.HasIndex(e => e.DataId); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MixDatabaseColumnName) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.BooleanValue).HasColumnType("bit"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.DateTimeValue).HasColumnType("datetime"); - - entity.Property(e => e.EncryptKey) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.EncryptValue) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Regex) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.StringValue) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixFileConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixFileConfiguration.cs deleted file mode 100644 index d8aa1e7c2..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixFileConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixFileConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_file"); - - entity.HasIndex(e => e.ThemeId); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.StringContent) - .IsRequired() - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixFile) - .HasForeignKey(d => d.ThemeId) - .HasConstraintName("FK_mix_file_mix_template"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixLanguageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixLanguageConfiguration.cs deleted file mode 100644 index c24890af3..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixLanguageConfiguration.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixLanguageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_language"); - - entity.ToTable("mix_language"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Category) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Value) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixLanguage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Language_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixMediaConfiguration.cs deleted file mode 100644 index 618f0eab8..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixMediaConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_media"); - - entity.ToTable("mix_media"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileProperties) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Source) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Tags) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.TargetUrl) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleConfiguration.cs deleted file mode 100644 index 5581b117b..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module"); - - entity.ToTable("mix_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Fields) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Template) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixModule) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Module_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleDataConfiguration.cs deleted file mode 100644 index 20436d3a3..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModuleDataConfiguration.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixModuleDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_data"); - - entity.ToTable("mix_module_data"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.HasIndex(e => new { e.ModuleId, e.PageId, e.Specificulture }); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Fields) - .IsRequired() - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Value) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Module_Data_Mix_Module"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModulePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModulePostConfiguration.cs deleted file mode 100644 index 9bf3165b2..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixModulePostConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixModulePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_post"); - - entity.ToTable("mix_module_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Module"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageConfiguration.cs deleted file mode 100644 index da1dc034e..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageConfiguration.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page"); - - entity.ToTable("mix_page"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Content) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.CssClass) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Excerpt) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Layout) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.StaticUrl) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Tags) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Template) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Type) - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageModuleConfiguration.cs deleted file mode 100644 index 544fa25f4..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPageModuleConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPageModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_module"); - - entity.ToTable("mix_page_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Module_Mix_Page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPagePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPagePostConfiguration.cs deleted file mode 100644 index 62fea0442..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPagePostConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPagePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_post"); - - entity.ToTable("mix_page_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageConfiguration.cs deleted file mode 100644 index f0c606abb..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageConfiguration.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPortalPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.TextDefault) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.TextKeyword) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Url) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageNavigationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageNavigationConfiguration.cs deleted file mode 100644 index 696ffcf5b..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageNavigationConfiguration.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPortalPageNavigationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page_navigation"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.PageId) - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasIndex(e => e.ParentId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageNavigationPage) - .HasForeignKey(d => d.PageId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasOne(d => d.Parent) - .WithMany(p => p.MixPortalPageNavigationParent) - .HasForeignKey(d => d.ParentId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageRoleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageRoleConfiguration.cs deleted file mode 100644 index 3d1d40326..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPortalPageRoleConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPortalPageRoleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id }) - .HasName("PK_mix_portal_page_role"); - - entity.ToTable("mix_portal_page_role"); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasMaxLength(50) - .IsUnicode(false); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageRole) - .HasForeignKey(d => d.PageId) - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostAssociationConfiguration.cs deleted file mode 100644 index 701a88130..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostAssociationConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPostAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_association"); - - entity.ToTable("mix_post_association"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.DestinationId, e.Specificulture }); - - entity.HasIndex(e => new { e.SourceId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixRelatedPostMixPost) - .HasForeignKey(d => new { d.DestinationId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post1"); - - entity.HasOne(d => d.S) - .WithMany(p => p.MixRelatedPostS) - .HasForeignKey(d => new { d.SourceId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostConfiguration.cs deleted file mode 100644 index dc1b0b0f4..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostConfiguration.cs +++ /dev/null @@ -1,139 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post"); - - entity.ToTable("mix_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Content) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Excerpt) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ExtraProperties) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Icon) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.PublishedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Source) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Tags) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Template) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Type) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPost) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostMediaConfiguration.cs deleted file mode 100644 index 9e238a184..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostMediaConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPostMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_media"); - - entity.ToTable("mix_post_media"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.MediaId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixMedia) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.MediaId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_media"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostModuleConfiguration.cs deleted file mode 100644 index 685b157ac..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixPostModuleConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixPostModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_module"); - - entity.ToTable("mix_post_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Module_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixTemplateConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixTemplateConfiguration.cs deleted file mode 100644 index 1b575a47f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixTemplateConfiguration.cs +++ /dev/null @@ -1,105 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixTemplateConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_template"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.ThemeId) - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - entity.Property(e => e.Content) - .IsRequired() - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.MobileContent) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Scripts) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.SpaContent) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Styles) - .HasColumnType("ntext") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixTemplate) - .HasForeignKey(d => d.ThemeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_template_mix_theme"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixThemeConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixThemeConfiguration.cs deleted file mode 100644 index ff2dd3de4..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixThemeConfiguration.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixThemeConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_theme"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Image) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.PreviewUrl) - .HasColumnType("nvarchar(400)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Title) - .HasColumnType("nvarchar(250)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixUrlAliasConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixUrlAliasConfiguration.cs deleted file mode 100644 index 8e1c99db5..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MSSQL/MixUrlAliasConfiguration.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MSSQL -{ - public class MixUrlAliasConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }); - - entity.ToTable("mix_url_alias"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("Vietnamese_CI_AS"); - - entity.Property(e => e.Alias).HasMaxLength(250); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description).HasMaxLength(4000); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.SourceId).HasMaxLength(250); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .IsUnicode(false); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixUrlAlias) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCacheConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCacheConfiguration.cs deleted file mode 100644 index b8e7fedce..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCacheConfiguration.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixCacheConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cache"); - - entity.HasIndex(e => e.ExpiredDateTime) - .HasDatabaseName("Index_ExpiresAtTime"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.ExpiredDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Value) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCmsUserConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCmsUserConfiguration.cs deleted file mode 100644 index 3385ab215..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCmsUserConfiguration.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixCmsUserConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cms_user"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Address) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Avatar) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Email) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FirstName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.LastName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.MiddleName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.PhoneNumber) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Username) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixConfigurationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixConfigurationConfiguration.cs deleted file mode 100644 index 818d07bcd..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixConfigurationConfiguration.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixConfigurationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_configuration"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixConfiguration) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Configuration_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCultureConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCultureConfiguration.cs deleted file mode 100644 index d97f96e47..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixCultureConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixCultureConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_culture"); - - entity.HasIndex(e => e.Specificulture) - .HasDatabaseName("IX_Mix_Culture") - .IsUnique(); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FullName) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Lcid) - .HasColumnName("LCID") - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseColumnConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseColumnConfiguration.cs deleted file mode 100644 index 3fc8854ee..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseColumnConfiguration.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixDatabaseColumnConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database_column"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.HasIndex(e => e.ReferenceId); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.IsEncrypt).HasColumnType("bit(1)"); - - entity.Property(e => e.IsMultiple).HasColumnType("bit(1)"); - - entity.Property(e => e.IsRequire).HasColumnType("bit(1)"); - - entity.Property(e => e.IsSelect).HasColumnType("bit(1)"); - - entity.Property(e => e.IsUnique).HasColumnType("bit(1)"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Options) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Regex) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseConfiguration.cs deleted file mode 100644 index 6bdc95f17..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixDatabaseConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.EdmAutoSend).HasColumnType("bit(1)"); - - entity.Property(e => e.EdmFrom) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.EdmSubject) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Type) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataAssociationConfiguration.cs deleted file mode 100644 index 8ff4f4ba6..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataAssociationConfiguration.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixDatabaseDataAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_database_data_association"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ParentId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ParentType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataConfiguration.cs deleted file mode 100644 index 912872018..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixDatabaseDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_value"); - - entity.ToTable("mix_database_data"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataValueConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataValueConfiguration.cs deleted file mode 100644 index 7602c3b7f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixDatabaseDataValueConfiguration.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixDatabaseDataValueConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_database_data_value"); - - entity.HasIndex(e => e.DataId); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.MixDatabaseColumnName) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.BooleanValue).HasColumnType("bit(1)"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.DateTimeValue).HasColumnType("datetime"); - - entity.Property(e => e.EncryptKey) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.EncryptValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Regex) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.StringValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixFileConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixFileConfiguration.cs deleted file mode 100644 index 5c85fcad4..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixFileConfiguration.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixFileConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_file"); - - entity.HasIndex(e => e.ThemeId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.StringContent) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixFile) - .HasForeignKey(d => d.ThemeId) - .HasConstraintName("FK_mix_file_mix_template"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixLanguageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixLanguageConfiguration.cs deleted file mode 100644 index 4e3037354..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixLanguageConfiguration.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixLanguageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_language"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixLanguage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Language_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixMediaConfiguration.cs deleted file mode 100644 index 48dd04c7f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixMediaConfiguration.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_media"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Tags) - .HasColumnType("varchar(400)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.TargetUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleConfiguration.cs deleted file mode 100644 index da1b4da70..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleConfiguration.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_module"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Fields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixModule) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Module_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleDataConfiguration.cs deleted file mode 100644 index 8efbb398c..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModuleDataConfiguration.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixModuleDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_module_data"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.HasIndex(e => new { e.ModuleId, e.PageId, e.Specificulture }); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Fields) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Module_Data_Mix_Module"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModulePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModulePostConfiguration.cs deleted file mode 100644 index f7329405d..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixModulePostConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixModulePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_module_post"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Module"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageConfiguration.cs deleted file mode 100644 index 0ec3c19c7..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageConfiguration.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_page"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.CssClass) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Layout) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.StaticUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Type) - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageModuleConfiguration.cs deleted file mode 100644 index f65d7c50e..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPageModuleConfiguration.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPageModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_page_module"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Module_Mix_Page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPagePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPagePostConfiguration.cs deleted file mode 100644 index 293982e47..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPagePostConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPagePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_page_post"); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageConfiguration.cs deleted file mode 100644 index f03a2d5e2..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageConfiguration.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPortalPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.TextDefault) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.TextKeyword) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Url) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageNavigationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageNavigationConfiguration.cs deleted file mode 100644 index a2dba44db..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageNavigationConfiguration.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPortalPageNavigationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page_navigation"); - - entity.HasIndex(e => e.PageId) - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasIndex(e => e.ParentId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageNavigationPage) - .HasForeignKey(d => d.PageId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasOne(d => d.Parent) - .WithMany(p => p.MixPortalPageNavigationParent) - .HasForeignKey(d => d.ParentId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageRoleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageRoleConfiguration.cs deleted file mode 100644 index 02fc20606..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPortalPageRoleConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPortalPageRoleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id }) - .HasName("PK_mix_portal_page_role"); - - entity.ToTable("mix_portal_page_role"); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasMaxLength(50) - .IsUnicode(false); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageRole) - .HasForeignKey(d => d.PageId) - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostAssociationConfiguration.cs deleted file mode 100644 index edb1b6619..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostAssociationConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPostAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_post_association"); - - entity.HasIndex(e => new { e.DestinationId, e.Specificulture }); - - entity.HasIndex(e => new { e.SourceId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixRelatedPostMixPost) - .HasForeignKey(d => new { d.DestinationId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post1"); - - entity.HasOne(d => d.S) - .WithMany(p => p.MixRelatedPostS) - .HasForeignKey(d => new { d.SourceId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostConfiguration.cs deleted file mode 100644 index dc923cef2..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostConfiguration.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_post"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ExtraProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Icon) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.PublishedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Type) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPost) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostMediaConfiguration.cs deleted file mode 100644 index 994ba3b52..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostMediaConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPostMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_post_media"); - - entity.HasIndex(e => new { e.MediaId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixMedia) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.MediaId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_media"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostModuleConfiguration.cs deleted file mode 100644 index d84564649..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixPostModuleConfiguration.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixPostModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_post_module"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Module_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixTemplateConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixTemplateConfiguration.cs deleted file mode 100644 index 4e4f9f8ea..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixTemplateConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixTemplateConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_template"); - - entity.HasIndex(e => e.ThemeId) - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - entity.Property(e => e.Content) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.MobileContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Scripts) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SpaContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Styles) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixTemplate) - .HasForeignKey(d => d.ThemeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_template_mix_theme"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixThemeConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixThemeConfiguration.cs deleted file mode 100644 index b78d7c899..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixThemeConfiguration.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixThemeConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_theme"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.PreviewUrl) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixUrlAliasConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixUrlAliasConfiguration.cs deleted file mode 100644 index 68fddb7a5..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/MySQL/MixUrlAliasConfiguration.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.MySQL -{ - public class MixUrlAliasConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_url_alias"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.SourceId) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("utf8_unicode_ci"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixUrlAlias) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCacheConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCacheConfiguration.cs deleted file mode 100644 index af8972394..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCacheConfiguration.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixCacheConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cache"); - - entity.HasIndex(e => e.ExpiredDateTime) - .HasDatabaseName("Index_ExpiresAtTime"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ExpiredDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Value) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCmsUserConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCmsUserConfiguration.cs deleted file mode 100644 index bc4c06f32..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCmsUserConfiguration.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixCmsUserConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cms_user"); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Address) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Avatar) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Email) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FirstName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.MiddleName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.PhoneNumber) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Username) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixConfigurationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixConfigurationConfiguration.cs deleted file mode 100644 index 05524a3a6..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixConfigurationConfiguration.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixConfigurationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_configuration"); - - entity.ToTable("mix_configuration"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixConfiguration) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Configuration_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCultureConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCultureConfiguration.cs deleted file mode 100644 index edfa6979a..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixCultureConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixCultureConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_culture"); - - entity.HasIndex(e => e.Specificulture) - .HasDatabaseName("IX_Mix_Culture") - .IsUnique(); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FullName) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Lcid) - .HasColumnName("LCID") - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseColumnConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseColumnConfiguration.cs deleted file mode 100644 index 7db935e0e..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseColumnConfiguration.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixDatabaseColumnConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database_column"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.HasIndex(e => e.ReferenceId); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.IsEncrypt).HasColumnType("boolean"); - - entity.Property(e => e.IsMultiple).HasColumnType("boolean"); - - entity.Property(e => e.IsRequire).HasColumnType("boolean"); - - entity.Property(e => e.IsSelect).HasColumnType("boolean"); - - entity.Property(e => e.IsUnique).HasColumnType("boolean"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Options) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Regex) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseConfiguration.cs deleted file mode 100644 index 8f6975525..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixDatabaseConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.EdmAutoSend).HasColumnType("boolean"); - - entity.Property(e => e.EdmFrom) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.EdmSubject) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Type) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataAssociationConfiguration.cs deleted file mode 100644 index da47c3d4a..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataAssociationConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixDatabaseDataAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_association"); - - entity.ToTable("mix_database_data_association"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ParentId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ParentType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataConfiguration.cs deleted file mode 100644 index e6bac19cd..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixDatabaseDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data"); - - entity.ToTable("mix_database_data"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataValueConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataValueConfiguration.cs deleted file mode 100644 index 08a4049ac..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixDatabaseDataValueConfiguration.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixDatabaseDataValueConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_value"); - - entity.ToTable("mix_database_data_value"); - - entity.HasIndex(e => e.DataId); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.MixDatabaseColumnName) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.BooleanValue).HasColumnType("boolean"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.DateTimeValue).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.EncryptKey) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.EncryptValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Regex) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.StringValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixFileConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixFileConfiguration.cs deleted file mode 100644 index b74ce2898..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixFileConfiguration.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixFileConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_file"); - - entity.HasIndex(e => e.ThemeId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.StringContent) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixFile) - .HasForeignKey(d => d.ThemeId) - .HasConstraintName("FK_mix_file_mix_template"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixLanguageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixLanguageConfiguration.cs deleted file mode 100644 index f42ac46ae..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixLanguageConfiguration.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixLanguageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_language"); - - entity.ToTable("mix_language"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixLanguage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Language_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixMediaConfiguration.cs deleted file mode 100644 index 568de8597..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixMediaConfiguration.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PRIMARY"); - - entity.ToTable("mix_media"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Tags) - .HasColumnType("varchar(400)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.TargetUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleConfiguration.cs deleted file mode 100644 index 3462985fa..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleConfiguration.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module"); - - entity.ToTable("mix_module"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Fields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixModule) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Module_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleDataConfiguration.cs deleted file mode 100644 index 4c0d1ee9d..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModuleDataConfiguration.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixModuleDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_data"); - - entity.ToTable("mix_module_data"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.HasIndex(e => new { e.ModuleId, e.PageId, e.Specificulture }); - - entity.Property(e => e.Id) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Fields) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Module_Data_Mix_Module"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModulePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModulePostConfiguration.cs deleted file mode 100644 index 74ff42464..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixModulePostConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixModulePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_post"); - - entity.ToTable("mix_module_post"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Module"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageConfiguration.cs deleted file mode 100644 index 8ecb0d64c..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageConfiguration.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page"); - - entity.ToTable("mix_page"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.CssClass) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Layout) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.StaticUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Type) - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageModuleConfiguration.cs deleted file mode 100644 index d6b98b1ff..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPageModuleConfiguration.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPageModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_module"); - - entity.ToTable("mix_page_module"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Module_Mix_Page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPagePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPagePostConfiguration.cs deleted file mode 100644 index f68cbc9ca..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPagePostConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPagePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_post"); - - entity.ToTable("mix_page_post"); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageConfiguration.cs deleted file mode 100644 index d07b969fc..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageConfiguration.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPortalPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.TextDefault) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.TextKeyword) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Url) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageNavigationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageNavigationConfiguration.cs deleted file mode 100644 index 0be264a4b..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageNavigationConfiguration.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPortalPageNavigationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page_navigation"); - - entity.HasIndex(e => e.PageId) - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasIndex(e => e.ParentId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageNavigationPage) - .HasForeignKey(d => d.PageId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasOne(d => d.Parent) - .WithMany(p => p.MixPortalPageNavigationParent) - .HasForeignKey(d => d.ParentId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageRoleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageRoleConfiguration.cs deleted file mode 100644 index 464cae065..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPortalPageRoleConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPortalPageRoleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id }) - .HasName("PK_mix_portal_page_role"); - - entity.ToTable("mix_portal_page_role"); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasMaxLength(50) - .IsUnicode(false); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageRole) - .HasForeignKey(d => d.PageId) - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostAssociationConfiguration.cs deleted file mode 100644 index f47ab7a8f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostAssociationConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPostAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_association"); - - entity.ToTable("mix_post_association"); - - entity.HasIndex(e => new { e.DestinationId, e.Specificulture }); - - entity.HasIndex(e => new { e.SourceId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixRelatedPostMixPost) - .HasForeignKey(d => new { d.DestinationId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post1"); - - entity.HasOne(d => d.S) - .WithMany(p => p.MixRelatedPostS) - .HasForeignKey(d => new { d.SourceId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostConfiguration.cs deleted file mode 100644 index aecdde3ad..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostConfiguration.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post"); - - entity.ToTable("mix_post"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ExtraProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Icon) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.PublishedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Type) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPost) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostMediaConfiguration.cs deleted file mode 100644 index 06bb68e5d..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostMediaConfiguration.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPostMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_media"); - - entity.ToTable("mix_post_media"); - - entity.HasIndex(e => new { e.MediaId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixMedia) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.MediaId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_media"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostModuleConfiguration.cs deleted file mode 100644 index 2c29a58fd..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixPostModuleConfiguration.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixPostModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_module"); - - entity.ToTable("mix_post_module"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Module_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixTemplateConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixTemplateConfiguration.cs deleted file mode 100644 index b4c96d416..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixTemplateConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixTemplateConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_template"); - - entity.HasIndex(e => e.ThemeId) - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - entity.Property(e => e.Content) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.MobileContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Scripts) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SpaContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Styles) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixTemplate) - .HasForeignKey(d => d.ThemeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_template_mix_theme"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixThemeConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixThemeConfiguration.cs deleted file mode 100644 index 562660d44..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixThemeConfiguration.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixThemeConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_theme"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.PreviewUrl) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixUrlAliasConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixUrlAliasConfiguration.cs deleted file mode 100644 index db909fa8b..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/POSTGRESQL/MixUrlAliasConfiguration.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.POSTGRESQL -{ - public class MixUrlAliasConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_url_alias"); - - entity.ToTable("mix_url_alias"); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.LastModified).HasColumnType("timestamp without time zone"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.SourceId) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("und-x-icu"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixUrlAlias) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCacheConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCacheConfiguration.cs deleted file mode 100644 index 90e4155ac..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCacheConfiguration.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixCacheConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cache"); - - entity.HasIndex(e => e.ExpiredDateTime) - .HasDatabaseName("Index_ExpiresAtTime"); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.ExpiredDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Value) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCmsUserConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCmsUserConfiguration.cs deleted file mode 100644 index 9c7c9e546..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCmsUserConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixCmsUserConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_cms_user"); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Address) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Avatar) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Email) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FirstName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.LastName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MiddleName) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.PhoneNumber) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Username) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixConfigurationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixConfigurationConfiguration.cs deleted file mode 100644 index 319ceb007..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixConfigurationConfiguration.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixConfigurationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_configuration"); - - entity.ToTable("mix_configuration"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixConfiguration) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Configuration_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCultureConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCultureConfiguration.cs deleted file mode 100644 index 1a6a06912..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixCultureConfiguration.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixCultureConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_culture"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture) - .HasDatabaseName("IX_Mix_Culture") - .IsUnique(); - - entity.Property(e => e.Alias) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FullName) - .HasColumnType("varchar(150)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Lcid) - .HasColumnName("LCID") - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseColumnConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseColumnConfiguration.cs deleted file mode 100644 index 4e3b61bda..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseColumnConfiguration.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixDatabaseColumnConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database_column"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MixDatabaseName).HasMaxLength(250); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue).HasColumnType("ntext"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.Options).HasColumnType("ntext"); - - entity.Property(e => e.Regex).HasMaxLength(4000); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseConfiguration.cs deleted file mode 100644 index 3e134793d..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseConfiguration.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixDatabaseConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_database"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.EdmAutoSend).HasColumnType("bit"); - - entity.Property(e => e.EdmFrom) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.EdmSubject) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Type) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataAssociationConfiguration.cs deleted file mode 100644 index b134e759f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataAssociationConfiguration.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixDatabaseDataAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_association"); - - entity.ToTable("mix_database_data_association"); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ParentId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ParentType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataConfiguration.cs deleted file mode 100644 index 3fe661a9e..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataConfiguration.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixDatabaseDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data"); - - entity.ToTable("mix_database_data"); - - entity.HasIndex(e => e.MixDatabaseId); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataValueConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataValueConfiguration.cs deleted file mode 100644 index d27a5f8a4..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixDatabaseDataValueConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixDatabaseDataValueConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_database_data_value"); - - entity.ToTable("mix_database_data_value"); - - entity.HasIndex(e => e.DataId); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MixDatabaseColumnName) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.MixDatabaseName) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.BooleanValue).HasColumnType("bit"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DataId) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.DateTimeValue).HasColumnType("datetime"); - - entity.Property(e => e.EncryptKey) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.EncryptValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Regex) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Specificulture) - .IsRequired() - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.StringValue) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixFileConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixFileConfiguration.cs deleted file mode 100644 index 44a08989e..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixFileConfiguration.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixFileConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_file"); - - entity.HasIndex(e => e.ThemeId); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.StringContent) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixFile) - .HasForeignKey(d => d.ThemeId) - .HasConstraintName("FK_mix_file_mix_template"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixLanguageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixLanguageConfiguration.cs deleted file mode 100644 index 35a32c174..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixLanguageConfiguration.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixLanguageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_language"); - - entity.ToTable("mix_language"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Category) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.DefaultValue) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Keyword) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.DataType) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixLanguage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Language_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixMediaConfiguration.cs deleted file mode 100644 index f27f36871..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixMediaConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_media"); - - entity.ToTable("mix_media"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Tags) - .HasColumnType("varchar(400)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.TargetUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleConfiguration.cs deleted file mode 100644 index 5ba821ec9..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleConfiguration.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module"); - - entity.ToTable("mix_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.EdmTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Fields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FormTemplate) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixModule) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Module_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleDataConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleDataConfiguration.cs deleted file mode 100644 index b799785d5..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModuleDataConfiguration.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixModuleDataConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_data"); - - entity.ToTable("mix_module_data"); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.HasIndex(e => new { e.ModuleId, e.PageId, e.Specificulture }); - - entity.Property(e => e.Id) - .ValueGeneratedNever() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Fields) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Value) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Module_Data_Mix_Module"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModuleData) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .HasConstraintName("FK_mix_module_data_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModulePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModulePostConfiguration.cs deleted file mode 100644 index 1519f611f..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixModulePostConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixModulePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_module_post"); - - entity.ToTable("mix_module_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Module"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixModulePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Module_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageConfiguration.cs deleted file mode 100644 index ec851f046..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageConfiguration.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page"); - - entity.ToTable("mix_page"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.CssClass) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Layout) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.StaticUrl) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Type) - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPage) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageModuleConfiguration.cs deleted file mode 100644 index 11b02ab8a..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPageModuleConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPageModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_module"); - - entity.ToTable("mix_page_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Menu_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPageModule) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Module_Mix_Page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPagePostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPagePostConfiguration.cs deleted file mode 100644 index 00d60d0d0..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPagePostConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPagePostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_page_post"); - - entity.ToTable("mix_page_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.PageId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixPage) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PageId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Page"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPagePost) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Page_Post_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageConfiguration.cs deleted file mode 100644 index 7d28be208..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageConfiguration.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPortalPageConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Icon) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.TextDefault) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.TextKeyword) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Url) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageNavigationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageNavigationConfiguration.cs deleted file mode 100644 index d9a9d4520..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageNavigationConfiguration.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPortalPageNavigationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_portal_page_navigation"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.PageId) - .HasDatabaseName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasIndex(e => e.ParentId); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageNavigationPage) - .HasForeignKey(d => d.PageId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page"); - - entity.HasOne(d => d.Parent) - .WithMany(p => p.MixPortalPageNavigationParent) - .HasForeignKey(d => d.ParentId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_portal_page_navigation_mix_portal_page1"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageRoleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageRoleConfiguration.cs deleted file mode 100644 index 20f1e1bb8..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPortalPageRoleConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPortalPageRoleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id }) - .HasName("PK_mix_portal_page_role"); - - entity.ToTable("mix_portal_page_role"); - - entity.Property(e => e.RoleId).HasMaxLength(50); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasMaxLength(50) - .IsUnicode(false); - - entity.HasOne(d => d.Page) - .WithMany(p => p.MixPortalPageRole) - .HasForeignKey(d => d.PageId) - .HasConstraintName("FK_mix_portal_page_role_mix_portal_page"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostAssociationConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostAssociationConfiguration.cs deleted file mode 100644 index e0366646b..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostAssociationConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPostAssociationConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_association"); - - entity.ToTable("mix_post_association"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.DestinationId, e.Specificulture }); - - entity.HasIndex(e => new { e.SourceId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixRelatedPostMixPost) - .HasForeignKey(d => new { d.DestinationId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post1"); - - entity.HasOne(d => d.S) - .WithMany(p => p.MixRelatedPostS) - .HasForeignKey(d => new { d.SourceId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_association_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostConfiguration.cs deleted file mode 100644 index e606a5e82..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostConfiguration.cs +++ /dev/null @@ -1,139 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPostConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post"); - - entity.ToTable("mix_post"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.Specificulture); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Content) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Excerpt) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ExtraFields) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ExtraProperties) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Icon) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.PublishedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.SeoDescription) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoKeywords) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoName) - .HasColumnType("varchar(500)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SeoTitle) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Source) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Tags) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Template) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Type) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixPost) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostMediaConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostMediaConfiguration.cs deleted file mode 100644 index 9e2e13ff2..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostMediaConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPostMediaConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_media"); - - entity.ToTable("mix_post_media"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.MediaId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixMedia) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.MediaId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_media"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostMedia) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_post_media_mix_post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostModuleConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostModuleConfiguration.cs deleted file mode 100644 index 60e02e36d..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixPostModuleConfiguration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixPostModuleConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }) - .HasName("PK_mix_post_module"); - - entity.ToTable("mix_post_module"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => new { e.ModuleId, e.Specificulture }); - - entity.HasIndex(e => new { e.PostId, e.Specificulture }); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.MixModule) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.ModuleId, d.Specificulture }) - .HasConstraintName("FK_Mix_Post_Module_Mix_Module1"); - - entity.HasOne(d => d.MixPost) - .WithMany(p => p.MixPostModule) - .HasForeignKey(d => new { d.PostId, d.Specificulture }) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Mix_Post_Module_Mix_Post"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixTemplateConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixTemplateConfiguration.cs deleted file mode 100644 index d7bb0cb40..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixTemplateConfiguration.cs +++ /dev/null @@ -1,105 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixTemplateConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_template"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.HasIndex(e => e.ThemeId) - .HasDatabaseName("IX_mix_template_file_TemplateId"); - - entity.Property(e => e.Content) - .IsRequired() - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Extension) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileFolder) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FileName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.FolderType) - .IsRequired() - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.MobileContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Scripts) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.SpaContent) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Styles) - .HasColumnType("text") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.ThemeName) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.HasOne(d => d.Theme) - .WithMany(p => p.MixTemplate) - .HasForeignKey(d => d.ThemeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_mix_template_mix_theme"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixThemeConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixThemeConfiguration.cs deleted file mode 100644 index e6b848efb..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixThemeConfiguration.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixThemeConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.ToTable("mix_theme"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.CreatedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Image) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.PreviewUrl) - .HasColumnType("varchar(450)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Thumbnail) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Title) - .HasColumnType("varchar(250)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixUrlAliasConfiguration.cs b/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixUrlAliasConfiguration.cs deleted file mode 100644 index e6c68c7c5..000000000 --- a/src/Mix.Cms.Lib/Models/EntityConfigurations/SQLITE/MixUrlAliasConfiguration.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; - -namespace Mix.Cms.Lib.Models.EntityConfigurations.SQLITE -{ - public class MixUrlAliasConfiguration : IEntityTypeConfiguration - { - public void Configure(EntityTypeBuilder entity) - { - entity.HasKey(e => new { e.Id, e.Specificulture }); - - entity.ToTable("mix_url_alias"); - - entity.Property(e => e.Id) - .ValueGeneratedNever(); - - entity.Property(e => e.Specificulture) - .HasColumnType("varchar(10)") - .HasCharSet("utf8") - .HasCollation("NOCASE"); - - entity.Property(e => e.Alias).HasMaxLength(250); - - entity.Property(e => e.CreatedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); - - entity.Property(e => e.Description).HasMaxLength(4000); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.ModifiedBy) - .HasMaxLength(50) - .IsUnicode(false); - - entity.Property(e => e.SourceId).HasMaxLength(250); - - entity.Property(e => e.Status) - .IsRequired() - .HasConversion(new EnumToStringConverter()) - .HasColumnType("varchar(50)") - .IsUnicode(false); - - entity.HasOne(d => d.SpecificultureNavigation) - .WithMany(p => p.MixUrlAlias) - .HasPrincipalKey(p => p.Specificulture) - .HasForeignKey(d => d.Specificulture) - .HasConstraintName("FK_Mix_Url_Alias_Mix_Culture"); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerHubRoom.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerHubRoom.cs deleted file mode 100644 index 93644022d..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerHubRoom.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerHubRoom - { - public MixMessengerHubRoom() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavRoomUser = new HashSet(); - } - - public Guid Id { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public string Description { get; set; } - public string HostId { get; set; } - public bool IsOpen { get; set; } - public DateTime? LastModified { get; set; } - public string Name { get; set; } - public int? TeamId { get; set; } - public string Title { get; set; } - - public ICollection MixMessengerMessage { get; set; } - public ICollection MixMessengerNavRoomUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerMessage.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerMessage.cs deleted file mode 100644 index 2e9d80c3c..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerMessage - { - public Guid Id { get; set; } - public string Content { get; set; } - public DateTime CreatedDate { get; set; } - public Guid? RoomId { get; set; } - public int? TeamId { get; set; } - public string UserId { get; set; } - - public MixMessengerHubRoom Room { get; set; } - public MixMessengerTeam Team { get; set; } - public MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavRoomUser.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavRoomUser.cs deleted file mode 100644 index 8a22c1698..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavRoomUser.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerNavRoomUser - { - public Guid RoomId { get; set; } - public string UserId { get; set; } - public DateTime JoinedDate { get; set; } - - public MixMessengerHubRoom Room { get; set; } - public MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavTeamUser.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavTeamUser.cs deleted file mode 100644 index 81b0ea1b3..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerNavTeamUser.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Mix.Cms.Lib.Enums; -using System; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerNavTeamUser - { - public int TeamId { get; set; } - public string UserId { get; set; } - public DateTime JoinedDate { get; set; } - public DateTime? LastModified { get; set; } - public MixContentStatus Status { get; set; } - - public MixMessengerTeam Team { get; set; } - public MixMessengerUser User { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerTeam.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerTeam.cs deleted file mode 100644 index 5c1780b95..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerTeam.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerTeam - { - public MixMessengerTeam() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavTeamUser = new HashSet(); - } - - public int Id { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public string HostId { get; set; } - public bool? IsOpen { get; set; } - public string Name { get; set; } - public int Type { get; set; } - - public ICollection MixMessengerMessage { get; set; } - public ICollection MixMessengerNavTeamUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUser.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUser.cs deleted file mode 100644 index 208c8a275..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUser.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerUser - { - public MixMessengerUser() - { - MixMessengerMessage = new HashSet(); - MixMessengerNavRoomUser = new HashSet(); - MixMessengerNavTeamUser = new HashSet(); - } - - public string Id { get; set; } - public string FacebookId { get; set; } - public string Avatar { get; set; } - public DateTime CreatedDate { get; set; } - public DateTime? LastModified { get; set; } - public string Name { get; set; } - public string Status { get; set; } - - public ICollection MixMessengerMessage { get; set; } - public ICollection MixMessengerNavRoomUser { get; set; } - public ICollection MixMessengerNavTeamUser { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUserDevice.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUserDevice.cs deleted file mode 100644 index 941664a1f..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/MixMessengerUserDevice.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixMessengerUserDevice - { - public string UserId { get; set; } - public string ConnectionId { get; set; } - public string DeviceId { get; set; } - public int Status { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Models/Messenger/Data/_MixChatServiceContext.cs b/src/Mix.Cms.Lib/Models/Messenger/Data/_MixChatServiceContext.cs deleted file mode 100644 index 0a0fa2bd3..000000000 --- a/src/Mix.Cms.Lib/Models/Messenger/Data/_MixChatServiceContext.cs +++ /dev/null @@ -1,278 +0,0 @@ -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using MySqlConnector; - -namespace Mix.Cms.Messenger.Models.Data -{ - public partial class MixChatServiceContext : DbContext - { - public MixChatServiceContext() - { - } - - public MixChatServiceContext(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet MixMessengerHubRoom { get; set; } - public virtual DbSet MixMessengerMessage { get; set; } - public virtual DbSet MixMessengerNavRoomUser { get; set; } - public virtual DbSet MixMessengerNavTeamUser { get; set; } - public virtual DbSet MixMessengerTeam { get; set; } - public virtual DbSet MixMessengerUser { get; set; } - public virtual DbSet MixMessengerUserDevice { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured) - { - //define the database to use - //string cnn = "Data Source=mix-messenger.db"; - //optionsBuilder.UseSqlite(cnn); - ; - // IConfiguration configuration = new ConfigurationBuilder() - //.SetBasePath(System.IO.Directory.GetCurrentDirectory()) - //.AddJsonFile(Common.Utility.Const.CONST_FILE_APPSETTING) - //.Build(); - - // //optionsBuilder.UseSqlServer(cnn); - // string cnn = configuration.GetConnectionString("MixMessengerConnection"); - // if (string.IsNullOrEmpty(cnn)) - // { - // cnn = _cnn; - // } - // //define the database to use - // if (!string.IsNullOrEmpty(cnn)) - // { - // optionsBuilder.UseSqlServer(cnn); - // } - - string cnn = MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION); - if (!string.IsNullOrEmpty(cnn)) - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - optionsBuilder.UseSqlServer(cnn); - break; - - case MixDatabaseProvider.MySQL: - optionsBuilder.UseMySql(cnn, ServerVersion.AutoDetect(cnn)); - break; - - case MixDatabaseProvider.SQLITE: - optionsBuilder.UseSqlite(cnn); - break; - - case MixDatabaseProvider.PostgreSQL: - optionsBuilder.UseNpgsql(cnn); - break; - - default: - break; - } - } - } - } - - //Ref https://github.com/dotnet/efcore/issues/10169 - public override void Dispose() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - SqlConnection.ClearPool((SqlConnection)Database.GetDbConnection()); - break; - - case MixDatabaseProvider.MySQL: - MySqlConnection.ClearPool((MySqlConnection)Database.GetDbConnection()); - break; - } - base.Dispose(); - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.ToTable("mix_messenger_hub_room"); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.Avatar).HasMaxLength(250); - - entity.Property(e => e.CreatedDate).HasColumnType("datetime"); - - entity.Property(e => e.Description).HasColumnType("ntext"); - - entity.Property(e => e.HostId).HasMaxLength(128); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Title).HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.ToTable("mix_messenger_message"); - - entity.HasIndex(e => e.RoomId) - .HasDatabaseName("IX_messenger_message_RoomId"); - - entity.HasIndex(e => e.TeamId) - .HasDatabaseName("IX_messenger_message_TeamId"); - - entity.HasIndex(e => e.UserId) - .HasDatabaseName("IX_messenger_message_UserId"); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.Content).HasColumnType("ntext"); - - entity.Property(e => e.CreatedDate).HasColumnType("datetime"); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.HasOne(d => d.Room) - .WithMany(p => p.MixMessengerMessage) - .HasForeignKey(d => d.RoomId) - .HasConstraintName("FK_messenger_message_messenger_hub_room"); - - entity.HasOne(d => d.Team) - .WithMany(p => p.MixMessengerMessage) - .HasForeignKey(d => d.TeamId) - .HasConstraintName("FK_messenger_message_messenger_team"); - - entity.HasOne(d => d.User) - .WithMany(p => p.MixMessengerMessage) - .HasForeignKey(d => d.UserId) - .HasConstraintName("FK_messenger_message_messenger_user"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.RoomId, e.UserId }); - - entity.ToTable("mix_messenger_nav_room_user"); - - entity.HasIndex(e => e.UserId) - .HasDatabaseName("IX_messenger_nav_room_user_UserId"); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.JoinedDate).HasColumnType("datetime"); - - entity.HasOne(d => d.Room) - .WithMany(p => p.MixMessengerNavRoomUser) - .HasForeignKey(d => d.RoomId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_messenger_nav_room_user_messenger_hub_room"); - - entity.HasOne(d => d.User) - .WithMany(p => p.MixMessengerNavRoomUser) - .HasForeignKey(d => d.UserId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_messenger_nav_room_user_messenger_user"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.TeamId, e.UserId }); - - entity.ToTable("mix_messenger_nav_team_user"); - - entity.HasIndex(e => e.UserId) - .HasDatabaseName("IX_messenger_nav_team_user_UserId"); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.JoinedDate).HasColumnType("datetime"); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.HasOne(d => d.Team) - .WithMany(p => p.MixMessengerNavTeamUser) - .HasForeignKey(d => d.TeamId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_messenger_nav_team_user_messenger_team"); - - entity.HasOne(d => d.User) - .WithMany(p => p.MixMessengerNavTeamUser) - .HasForeignKey(d => d.UserId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_messenger_nav_team_user_messenger_user"); - }); - - modelBuilder.Entity(entity => - { - entity.ToTable("mix_messenger_team"); - - entity.Property(e => e.Id).ValueGeneratedNever(); - - entity.Property(e => e.Avatar).HasMaxLength(250); - - entity.Property(e => e.CreatedDate).HasColumnType("datetime"); - - entity.Property(e => e.HostId).HasMaxLength(128); - - entity.Property(e => e.IsOpen).HasDefaultValueSql("((1))"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(250); - }); - - modelBuilder.Entity(entity => - { - entity.ToTable("mix_messenger_user"); - - entity.Property(e => e.Id) - .HasMaxLength(50) - .ValueGeneratedNever(); - - entity.Property(e => e.Avatar).HasMaxLength(250); - - entity.Property(e => e.CreatedDate).HasColumnType("datetime"); - - entity.Property(e => e.FacebookId).HasMaxLength(50); - - entity.Property(e => e.LastModified).HasColumnType("datetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(250); - - entity.Property(e => e.Status).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.UserId, e.DeviceId }); - - entity.ToTable("mix_messenger_user_device"); - - entity.Property(e => e.UserId).HasMaxLength(50); - - entity.Property(e => e.DeviceId).HasMaxLength(50); - - entity.Property(e => e.ConnectionId) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.EndDate).HasColumnType("datetime"); - - entity.Property(e => e.StartDate).HasColumnType("datetime"); - }); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Properties/launchSettings.json b/src/Mix.Cms.Lib/Properties/launchSettings.json deleted file mode 100644 index 6ea134570..000000000 --- a/src/Mix.Cms.Lib/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "Mix.Cms.Lib": { - "commandName": "Project", - "sqlDebugging": true, - "nativeDebugging": true - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Readme.txt b/src/Mix.Cms.Lib/Readme.txt deleted file mode 100644 index ac9e26063..000000000 --- a/src/Mix.Cms.Lib/Readme.txt +++ /dev/null @@ -1,90 +0,0 @@ -Scaffold-DbContext [CONNECTION_STRING] Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\Cms -force -ex: [CONNECTION_STRING] = "Server=localhost;Database=mixcore_structure;UID=sa;Pwd=1234qwe@;MultipleActiveResultSets=true;" - -dotnet ef dbcontext scaffold "Host=localhost;Database=mixcore_structure;Username=my_user;Password=1234qwe@" Npgsql.EntityFrameworkCore.PostgreSQL -OutputDir Models\Cms\PostgreSQL -force -Scaffold-DbContext "Host=localhost;Database=mixcore_structure;Username=postgre;Password=1234qwe@" Npgsql.EntityFrameworkCore.PostgreSQL -OutputDir Models\Cms\PostgreSQL -Context PostgresqlMixCmsContext -f -ex: [CONNECTION_STRING] = "Host=my_host;Database=mixcore_structure;Username=my_user;Password=my_pw" - -Scaffold-DbContext [CONNECTION_STRING] Pomelo.EntityFrameworkCore.MySql -OutputDir [OUTPUT DIRECTORY] -Context [NAME OF CONTEXT CLASS] -f -ex: [CONNECTION_STRING] = "Server=localhost;port=3306;Database=mixcore_structure;User=root;Password=;" - -Add-Migration -Context MixCmsContext -Update-Database -Context MixCmsContext - -remove ntext type -remove default value - - -// Clean Init Database - - delete from test_123.dbo.mix_page_module - delete from test_123.dbo.mix_page - delete from test_123.dbo.mix_module_data - delete from test_123.dbo.mix_module - delete from test_123.dbo.mix_theme - delete from test_123.dbo.mix_template - delete from test_123.[dbo].[mix_database_data_association] - delete from test_123.dbo.mix_database_data - delete from test_123.dbo.mix_database_data_value - delete from test_123.dbo.mix_database_column - delete from test_123.dbo.mix_database_data - delete from test_123.dbo.mix_database - -UnitOfWorkHelper.InitTransaction(_context, _transaction, out TDbContext context, out IDbContextTransaction transaction, out bool isRoot); -try -{ - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); -} -catch (Exception ex) -{ - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); -} -finally -{ - if (isRoot) - { - //if current Context is Root - context.Database.CloseConnection();transaction.Dispose();context.Dispose(); - } -} - ---- Default ViewModel ----- - -[GeneratedController("api/v1/rest/{culture}/attribute-set-data/portal")] -public class DefaultViewModel - : ViewModelBase -{ - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - #endregion Models - - #region Views - - - #endregion Views - - #endregion Properties - - #region Contructors - - public DefaultViewModel() : base() - { - } - - public DefaultViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #endregion Overrides -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Repositories/CommonRepository.cs b/src/Mix.Cms.Lib/Repositories/CommonRepository.cs deleted file mode 100644 index d39bf06fb..000000000 --- a/src/Mix.Cms.Lib/Repositories/CommonRepository.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Domain.Core.Models; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.Repositories -{ - public class CommonRepository - { - private static volatile CommonRepository instance; - private static readonly object syncRoot = new Object(); - - private CommonRepository() - { - } - - public static CommonRepository Instance { - get { - if (instance == null) - { - lock (syncRoot) - { - if (instance == null) - instance = new CommonRepository(); - } - } - - return instance; - } - } - - public List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture - }); - } - } - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Repositories/TemplateRepository.cs b/src/Mix.Cms.Lib/Repositories/TemplateRepository.cs deleted file mode 100644 index 159b4fc89..000000000 --- a/src/Mix.Cms.Lib/Repositories/TemplateRepository.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.ViewModels; -using Mix.Common.Helper; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Mix.Cms.Lib.Repositories -{ - public class TemplateRepository - { - /// - /// The instance - /// - private static volatile TemplateRepository instance; - - /// - /// The synchronize root - /// - private static readonly object syncRoot = new Object(); - - /// - /// Gets the instance. - /// - /// - public static TemplateRepository Instance { - get { - if (instance == null) - { - lock (syncRoot) - { - if (instance == null) - instance = new TemplateRepository(); - } - } - return instance; - } - } - - /// - /// Prevents a default instance of the class from being created. - /// - private TemplateRepository() - { - } - - public TemplateViewModel GetTemplate(string templatePath, List templates, string templateFolder) - { - var result = templates.Find(v => !string.IsNullOrEmpty(templatePath) && v.Filename == templatePath.Replace(@"\", "/").Split('/')[1]); - return result ?? new TemplateViewModel() { FileFolder = templateFolder }; - } - - public TemplateViewModel GetTemplate(string name, string templateFolder) - { - DirectoryInfo d = new DirectoryInfo(templateFolder); - FileInfo[] Files = d.GetFiles(name); //Getting cshtml files - var file = Files.FirstOrDefault(); - TemplateViewModel result = null; - if (file != null) - { - using (StreamReader s = file.OpenText()) - { - result = new TemplateViewModel() - { - FileFolder = templateFolder, - Filename = file.Name, - Extension = file.Extension, - Content = s.ReadToEnd() - }; - } - } - return result ?? new TemplateViewModel() { FileFolder = templateFolder }; - } - - public bool DeleteTemplate(string name, string templateFolder) - { - string fullPath = $"{templateFolder}/{name + MixFileExtensions.CsHtml}"; - - if (File.Exists(fullPath)) - { - CommonHelper.RemoveFile(fullPath); - } - - return true; - } - - public List GetTemplates(string folder) - { - if (!Directory.Exists(folder)) - { - Directory.CreateDirectory(folder); - } - DirectoryInfo d = new DirectoryInfo(folder);//Assuming Test is your Folder - FileInfo[] Files = d.GetFiles(string.Format("*{0}", MixFileExtensions.CsHtml)); //Getting cshtml files - List result = new List(); - foreach (var file in Files) - { - using (StreamReader s = file.OpenText()) - { - result.Add(new TemplateViewModel() - { - FileFolder = folder, - Filename = file.Name, - Extension = MixFileExtensions.CsHtml, - Content = s.ReadToEnd() - }); - } - } - return result; - } - - public bool SaveTemplate(TemplateViewModel file) - { - try - { - if (!string.IsNullOrEmpty(file.Filename)) - { - if (!Directory.Exists(file.FileFolder)) - { - Directory.CreateDirectory(file.FileFolder); - } - string fileName = $"{file.FileFolder}/{file.Filename + file.Extension}"; - using (var writer = File.CreateText(fileName)) - { - writer.WriteLine(file.Content); - return true; - } - } - else - { - return false; - } - } - catch - { - return false; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Services/InitCmsService.cs b/src/Mix.Cms.Lib/Services/InitCmsService.cs deleted file mode 100644 index eb80a1877..000000000 --- a/src/Mix.Cms.Lib/Services/InitCmsService.cs +++ /dev/null @@ -1,312 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Services -{ - public class InitCmsService - { - public InitCmsService() - { - } - - /// - /// Step 1 - /// - Init Culture - /// - Init System pages - /// - /// - /// - /// - public static async Task> InitCms(string siteName, InitCulture culture) - { - RepositoryResponse result = new RepositoryResponse(); - MixCmsContext context = null; - MixCmsAccountContext accountContext = null; - try - { - if (!string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - context = MixService.GetDbContext(); - accountContext = MixService.GetAccountDbContext(); - await context.Database.MigrateAsync(); - await accountContext.Database.MigrateAsync(); - - var countCulture = context.MixCulture.Count(); - var pendingMigration = context.Database.GetPendingMigrations().Count(); - if (pendingMigration == 0) - { - return await InitSiteData(siteName, culture); - } - } - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - finally - { - context?.Dispose(); - accountContext?.Dispose(); - } - } - - public static async Task> InitSiteData(string siteName, InitCulture culture) - { - RepositoryResponse result = new RepositoryResponse(); - MixCmsContext context = null; - IDbContextTransaction transaction = null; - bool isSucceed = true; - try - { - if (!string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - context = MixService.GetDbContext(); - transaction = context.Database.BeginTransaction(); - - var countCulture = context.MixCulture.Count(); - - /** - * Init Selected Language as default - */ - isSucceed = InitCultures(culture, context, transaction); - - /** - * Init System Configurations - */ - if (isSucceed && context.MixConfiguration.Count() == 0) - { - var saveResult = await InitConfigurationsAsync(siteName, culture.Specificulture, context, transaction); - result.IsSucceed = saveResult.IsSucceed; - result.Errors = saveResult.Errors; - result.Exception = saveResult.Exception; - } - else - { - result.IsSucceed = false; - result.Errors.Add("Cannot init cultures"); - } - if (result.IsSucceed) - { - transaction.Commit(); - } - else - { - transaction.Rollback(); - } - } - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - transaction?.Rollback(); - result.IsSucceed = false; - result.Exception = ex; - return result; - } - finally - { - context?.Database.CloseConnection(); - context?.Dispose(); - } - } - - /// - /// Step 2 - /// - Init Configurations - /// - /// - /// - /// - /// - /// - public static async Task> InitConfigurationsAsync(string siteName, string specifiCulture, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - /* Init Configs */ - - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var getConfigs = MixFileRepository.Instance.GetFile( - MixConstants.CONST_FILE_CONFIGURATIONS, MixFolders.JsonDataFolder, true, "{}"); - var obj = JObject.Parse(getConfigs.Content); - var configurations = obj["data"].ToObject>(); - var cnfSiteName = configurations.Find(c => c.Keyword == MixAppSettingKeywords.SiteName); - cnfSiteName.Value = siteName; - if (!string.IsNullOrEmpty(cnfSiteName.Value)) - { - configurations.Find(c => c.Keyword == MixAppSettingKeywords.ThemeName).Value = Common.Helper.SeoHelper.GetSEOString(cnfSiteName.Value); - configurations.Find(c => c.Keyword == MixAppSettingKeywords.ThemeFolder).Value = Common.Helper.SeoHelper.GetSEOString(cnfSiteName.Value); - } - var result = await ViewModels.MixConfigurations.UpdateViewModel.ImportConfigurations(configurations, specifiCulture, context, transaction); - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - - return result; - } - - /// - /// Step 2 - /// - Init Configurations - /// - /// - /// - /// - /// - /// - public static async Task> InitMixDatabasesAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - /* Init Configs */ - - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var result = new RepositoryResponse() { IsSucceed = true }; - var getData = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_ATTRIBUTE_SETS, MixFolders.JsonDataFolder, true, "{}"); - var obj = JObject.Parse(getData.Content); - var data = obj["data"].ToObject>(); - foreach (var item in data) - { - if (result.IsSucceed) - { - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - - return result; - } - - /// - /// Step 3 - /// - Init Languages for translate - /// - /// - /// - /// - /// - public async Task> InitLanguagesAsync(string specificulture, List languages - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - /* Init Languages */ - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - - var result = await ViewModels.MixLanguages.UpdateViewModel.ImportLanguages(languages, specificulture, context, transaction); - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - - /// - /// Step 4 - /// - Init default theme - /// - /// - /// - /// - /// - public async Task> InitThemesAsync(string siteName - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var result = new RepositoryResponse() { IsSucceed = true }; - if (!context.MixTheme.Any()) - { - ViewModels.MixThemes.InitViewModel theme = new ViewModels.MixThemes.InitViewModel() - { - Id = 1, - Title = siteName, - Name = SeoHelper.GetSEOString(siteName), - CreatedDateTime = DateTime.UtcNow, - CreatedBy = "Admin", - Status = MixContentStatus.Published, - }; - theme.ExpandView(context, transaction); - var saveResult = await theme.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return new RepositoryResponse() { IsSucceed = result.IsSucceed }; - } - - protected static bool InitCultures(InitCulture culture, MixCmsContext context, IDbContextTransaction transaction) - { - bool isSucceed = true; - try - { - if (context.MixCulture.Count() == 0) - { - // EN-US - - var enCulture = new MixCulture() - { - Id = 1, - Specificulture = culture.Specificulture, - FullName = culture.FullName, - Description = culture.Description, - Icon = culture.Icon, - Alias = culture.Alias, - Status = MixContentStatus.Published, - CreatedDateTime = DateTime.UtcNow - }; - context.Entry(enCulture).State = EntityState.Added; - - context.SaveChanges(); - } - } - catch - { - isSucceed = false; - } - return isSucceed; - } - - protected static void InitPages(string culture, MixCmsContext context, IDbContextTransaction transaction) - { - /* Init Pages */ - var pages = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_PAGES, MixFolders.JsonDataFolder, true, "{}"); - var obj = JObject.Parse(pages.Content); - var arrPage = obj["data"].ToObject>(); - foreach (var page in arrPage) - { - page.Specificulture = culture; - page.SeoTitle = page.Title.ToLower(); - page.SeoName = SeoHelper.GetSEOString(page.Title); - page.SeoDescription = page.Title.ToLower(); - page.SeoKeywords = page.Title.ToLower(); - page.CreatedDateTime = DateTime.UtcNow; - page.CreatedBy = "SuperAdmin"; - context.Entry(page).State = EntityState.Added; - var alias = new MixUrlAlias() - { - Id = page.Id, - SourceId = page.Id.ToString(), - Type = (int)MixUrlAliasType.Page, - Specificulture = culture, - CreatedDateTime = DateTime.UtcNow, - Alias = page.Title.ToLower(), - Status = MixContentStatus.Published - }; - context.Entry(alias).State = EntityState.Added; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Services/MixService.cs b/src/Mix.Cms.Lib/Services/MixService.cs deleted file mode 100644 index 6397513ac..000000000 --- a/src/Mix.Cms.Lib/Services/MixService.cs +++ /dev/null @@ -1,530 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Mail; -using System.Threading; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.Services -{ - public class MixService - { - /// - /// The synchronize root - /// - private static readonly object syncRoot = new Object(); - - /// - /// The instance - /// - private static volatile MixService instance; - - private static volatile MixService defaultInstance; - - private List Cultures { get; set; } - private JObject MixConfigurations { get; set; } - private JObject GlobalSettings { get; set; } - private JObject ConnectionStrings { get; set; } - private JObject LocalSettings { get; set; } - private JObject Translator { get; set; } - private JObject Authentication { get; set; } - private JObject IpSecuritySettings { get; set; } - private JObject Smtp { get; set; } - private readonly FileSystemWatcher watcher = new FileSystemWatcher(); - - public MixService() - { - watcher.Path = System.IO.Directory.GetCurrentDirectory(); - watcher.Filter = ""; - watcher.Changed += new FileSystemEventHandler(OnChanged); - watcher.EnableRaisingEvents = true; - } - - public static MixService Instance { - get { - if (instance == null) - { - lock (syncRoot) - { - if (instance == null) - { - instance = new MixService(); - instance.LoadConfiggurations(); - } - } - } - - return instance; - } - } - - public static MixService DefaultInstance { - get { - if (defaultInstance == null) - { - lock (syncRoot) - { - if (defaultInstance == null) - { - defaultInstance = new MixService(); - defaultInstance.LoadDefaultConfiggurations(); - } - } - } - - return defaultInstance; - } - } - - private void LoadConfiggurations() - { - // Load configurations from appSettings.json - JObject jsonSettings = new JObject(); - var settings = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_APPSETTING, string.Empty, true); - - if (string.IsNullOrEmpty(settings.Content)) - { - settings = MixFileRepository.Instance.GetFile(MixConstants.CONST_DEFAULT_FILE_APPSETTING, string.Empty, true, "{}"); - } - - string content = string.IsNullOrWhiteSpace(settings.Content) ? "{}" : settings.Content; - jsonSettings = JObject.Parse(content); - - instance.ConnectionStrings = JObject.FromObject(jsonSettings["ConnectionStrings"]); - instance.MixConfigurations = jsonSettings["MixConfigurations"] != null ? JObject.FromObject(jsonSettings["MixConfigurations"]) : new JObject(); - instance.Authentication = JObject.FromObject(jsonSettings["Authentication"]); - instance.IpSecuritySettings = JObject.FromObject(jsonSettings["IpSecuritySettings"]); - instance.Translator = JObject.FromObject(jsonSettings["Translator"]); - instance.GlobalSettings = JObject.FromObject(jsonSettings["GlobalSettings"]); - instance.LocalSettings = JObject.FromObject(jsonSettings["LocalSettings"]); - instance.Smtp = JObject.FromObject(instance.GlobalSettings["Smtp"] ?? new JObject()); - CommonHelper.WebConfigInstance = jsonSettings; - } - - private void LoadDefaultConfiggurations() - { - // Load configurations from appSettings.json - JObject jsonSettings = new JObject(); - var settings = MixFileRepository.Instance.GetFile(MixConstants.CONST_DEFAULT_FILE_APPSETTING, string.Empty, true); - - string content = string.IsNullOrWhiteSpace(settings.Content) ? "{}" : settings.Content; - jsonSettings = JObject.Parse(content); - - defaultInstance.ConnectionStrings = JObject.FromObject(jsonSettings["ConnectionStrings"]); - defaultInstance.MixConfigurations = JObject.FromObject(jsonSettings["MixConfigurations"]); - defaultInstance.Authentication = JObject.FromObject(jsonSettings["Authentication"]); - defaultInstance.IpSecuritySettings = JObject.FromObject(jsonSettings["IpSecuritySettings"]); - defaultInstance.Translator = JObject.FromObject(jsonSettings["Translator"]); - defaultInstance.GlobalSettings = JObject.FromObject(jsonSettings["GlobalSettings"]); - defaultInstance.LocalSettings = JObject.FromObject(jsonSettings["LocalSettings"]); - defaultInstance.Smtp = JObject.FromObject(defaultInstance.GlobalSettings["Smtp"] ?? new JObject()); - } - - private void OnChanged(object sender, FileSystemEventArgs e) - { - Thread.Sleep(500); - Instance.LoadConfiggurations(); - } - - public static string GetConnectionString(string name) - { - // Enhance: Add Encrypt / Decrypt appconnection string - return Instance.ConnectionStrings?[name].Value(); - } - - public static void SetConnectionString(string name, string value) - { - // Enhance: Add Encrypt / Decrypt appconnection string - Instance.ConnectionStrings[name] = value; - } - - public bool CheckValidCulture(string specificulture) - { - if (Instance.Cultures == null) - { - var cultures = ViewModels.MixCultures.UpdateViewModel.Repository.GetModelList().Data; - Instance.Cultures = cultures?.Select(c => c.Specificulture).ToList() ?? new List(); - } - return Instance.Cultures.Any(c => c == specificulture); - } - - public static T GetAuthConfig(string name) - { - var result = Instance.Authentication[name]; - if (result == null) - { - result = DefaultInstance.Authentication[name]; - } - return result != null ? result.Value() : default; - } - - public static void SetAuthConfig(string name, T value) - { - Instance.Authentication[name] = value.ToString(); - } - - public static T GetIpConfig(string name) - { - var result = Instance.IpSecuritySettings[name]; - if (result == null) - { - result = DefaultInstance.IpSecuritySettings[name]; - } - return result != null ? result.Value() : default; - } - - public static void SetIpConfig(string name, T value) - { - Instance.IpSecuritySettings[name] = value.ToString(); - } - - public static T GetMixConfig(string name) - { - var result = Instance.MixConfigurations[name]; - if (result == null) - { - result = DefaultInstance.MixConfigurations[name]; - } - return result != null ? result.Value() : default; - } - - public static void SetMixConfig(string name, T value) - { - Instance.MixConfigurations[name] = value != null ? JToken.FromObject(value) : null; - } - - public static T GetConfig(string name) - { - var result = Instance.GlobalSettings[name]; - if (result == null) - { - result = DefaultInstance.GlobalSettings[name]; - } - return result != null ? result.Value() : default; - } - - public static T GetEnumConfig(string name) - { - Enum.TryParse(typeof(T), Instance.GlobalSettings[name]?.Value(), true, out object result); - return result != null ? (T)result : default; - } - - public static void SetConfig(string name, T value) - { - Instance.GlobalSettings[name] = value != null ? JToken.FromObject(value) : null; - } - - public static T GetConfig(string name, string culture) - { - JToken result = null; - if (!string.IsNullOrEmpty(culture) && Instance.LocalSettings[culture] != null) - { - result = Instance.LocalSettings[culture][name]; - } - return result != null ? result.Value() : default; - } - - public static void SetConfig(string name, string culture, T value) - { - Instance.LocalSettings[culture][name] = value.ToString(); - } - - public static T Translate(string name, string culture) - { - var result = Instance.Translator[culture][name]; - //if (result == null) - //{ - // result = DefaultInstance.Translator[culture][name]; - //} - return result != null ? result.Value() : default; - } - - public static string TranslateString(string name, string culture) - { - var result = Instance.Translator[culture][name]; - return result != null ? result.Value() : name; - } - - public static JObject GetTranslator(string culture) - { - return JObject.FromObject(Instance.Translator[culture] ?? new JObject()); - } - - public static JObject GetLocalSettings(string culture) - { - return JObject.FromObject(Instance.LocalSettings[culture] ?? new JObject()); - } - - public static JObject GetGlobalSetting() - { - return JObject.FromObject(Instance.GlobalSettings); - } - - public static bool SaveSettings() - { - var settings = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_APPSETTING, string.Empty, true, "{}"); - if (settings != null) - { - if (string.IsNullOrWhiteSpace(settings.Content)) - { - var defaultSettings = MixFileRepository.Instance.GetFile(MixConstants.CONST_DEFAULT_FILE_APPSETTING, string.Empty, true, "{}"); - settings = new FileViewModel() - { - Filename = "appsettings", - Extension = MixFileExtensions.Json, - Content = defaultSettings.Content - }; - return MixFileRepository.Instance.SaveFile(settings); - } - else - { - JObject jsonSettings = JObject.Parse(settings.Content); - - jsonSettings["ConnectionStrings"] = instance.ConnectionStrings; - jsonSettings["GlobalSettings"] = instance.GlobalSettings; - jsonSettings["GlobalSettings"]["LastUpdateConfiguration"] = DateTime.UtcNow; - jsonSettings["Translator"] = instance.Translator; - jsonSettings["LocalSettings"] = instance.LocalSettings; - jsonSettings["Authentication"] = instance.Authentication; - jsonSettings["IpSecuritySettings"] = instance.IpSecuritySettings; - jsonSettings["Smtp"] = instance.Smtp; - settings.Content = jsonSettings.ToString(); - return MixFileRepository.Instance.SaveFile(settings); - } - } - else - { - return false; - } - } - - public static bool SaveSettings(string content) - { - var settings = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_APPSETTING, string.Empty, true, "{}"); - - settings.Content = content; - return MixFileRepository.Instance.SaveFile(settings); - } - - public static void Reload() - { - Instance.LoadConfiggurations(); - } - - public static void LoadFromDatabase(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction - , out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - Instance.Translator = new JObject(); - Instance.Cultures = null; - var ListLanguage = context.MixLanguage.ToList(); - var cultures = context.MixCulture.ToList(); - foreach (var culture in cultures) - { - JObject arr = new JObject(); - foreach (var lang in ListLanguage.Where(l => l.Specificulture == culture.Specificulture).ToList()) - { - JProperty l = new JProperty(lang.Keyword, lang.Value ?? lang.DefaultValue); - arr.Add(l); - } - Instance.Translator.Add(new JProperty(culture.Specificulture, arr)); - } - - Instance.LocalSettings = new JObject(); - var listLocalSettings = context.MixConfiguration.ToList(); - foreach (var culture in cultures) - { - JObject arr = new JObject(); - foreach (var cnf in listLocalSettings.Where(l => l.Specificulture == culture.Specificulture).ToList()) - { - JProperty l = new JProperty(cnf.Keyword, cnf.Value); - arr.Add(l); - } - Instance.LocalSettings.Add(new JProperty(culture.Specificulture, arr)); - } - UnitOfWorkHelper.HandleTransaction(true, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static Task SendEdm(string culture, string template, JObject data, string subject, string from) - { - return Task.Run(() => - { - if (!string.IsNullOrEmpty(data["email"].Value())) - { - string to = data["email"].Value(); - var getEdm = ViewModels.MixTemplates.UpdateViewModel.GetTemplateByPath(template, culture); - if (getEdm.IsSucceed && !string.IsNullOrEmpty(getEdm.Data.Content)) - { - string body = getEdm.Data.Content; - foreach (var prop in data.Properties()) - { - body = body.Replace($"[[{prop.Name}]]", data[prop.Name].Value()); - } - MixService.SendMail(subject, body, to, from); - } - } - }); - } - - public static void SendMail(string subject, string message, string to, string from = null) - { - MailMessage mailMessage = new MailMessage - { - IsBodyHtml = true, - From = new MailAddress(from ?? instance.Smtp.Value("From")) - }; - mailMessage.To.Add(to); - mailMessage.Body = message; - mailMessage.Subject = subject; - try - { - SmtpClient client = new SmtpClient(instance.Smtp.Value("Server")) - { - UseDefaultCredentials = false, - Credentials = new NetworkCredential(instance.Smtp.Value("User"), instance.Smtp.Value("Password")), - Port = instance.Smtp.Value("Port"), - EnableSsl = instance.Smtp.Value("SSL") - }; - - client.Send(mailMessage); - } - catch - { - try - { - SmtpClient smtpClient = new SmtpClient - { - UseDefaultCredentials = true - }; - smtpClient.Send(mailMessage); - } - catch (Exception ex) - { - MixService.LogException(ex); - // ToDo: cannot send mail - } - } - } - - public static void LogException(Exception ex) - { - string fullPath = $"{Environment.CurrentDirectory}/logs/{DateTime.Now.ToString("dd-MM-yyyy")}"; - if (!string.IsNullOrEmpty(fullPath) && !Directory.Exists(fullPath)) - { - Directory.CreateDirectory(fullPath); - } - string filePath = $"{fullPath}/log_exceptions.json"; - - try - { - FileInfo file = new FileInfo(filePath); - string content = "[]"; - if (file.Exists) - { - using (StreamReader s = file.OpenText()) - { - content = s.ReadToEnd(); - } - File.Delete(filePath); - } - - JArray arrExceptions = JArray.Parse(content); - JObject jex = new JObject - { - new JProperty("CreatedDateTime", DateTime.UtcNow), - new JProperty("Details", JObject.FromObject(ex)) - }; - arrExceptions.Add(jex); - content = arrExceptions.ToString(); - - using (var writer = File.CreateText(filePath)) - { - writer.WriteLine(content); - } - } - catch - { - Console.Write($"Cannot write log file {filePath}"); - // File invalid - } - } - - public static string GetTemplateFolder(string culture) - { - return $"{MixFolders.SiteContentAssetsFolder}/{Instance.LocalSettings[culture][MixAppSettingKeywords.ThemeFolder]}"; - } - - public static string GetTemplateUploadFolder(string culture) - { - return $"{MixFolders.SiteContentAssetsFolder}/" + - $"{Instance.LocalSettings[culture][MixAppSettingKeywords.ThemeFolder]}/" + - $"uploads/" + - $"{DateTime.UtcNow.ToString(MixConstants.CONST_UPLOAD_FOLDER_DATE_FORMAT)}"; - } - - public static MixCmsContext GetDbContext() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - return new MsSqlMixCmsContext(); - - case MixDatabaseProvider.MySQL: - return new MySqlMixCmsContext(); - - case MixDatabaseProvider.SQLITE: - return new SqliteMixCmsContext(); - - case MixDatabaseProvider.PostgreSQL: - return new PostgresqlMixCmsContext(); - - default: - return null; - } - } - - public static MixCmsAccountContext GetAccountDbContext() - { - var provider = MixService.GetEnumConfig(MixConstants.CONST_SETTING_DATABASE_PROVIDER); - switch (provider) - { - case MixDatabaseProvider.MSSQL: - case MixDatabaseProvider.MySQL: - case MixDatabaseProvider.SQLITE: - return new SQLAccountContext(); - - case MixDatabaseProvider.PostgreSQL: - return new PostgresSQLAccountContext(); - - default: - return null; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/Services/SitemapService.cs b/src/Mix.Cms.Lib/Services/SitemapService.cs deleted file mode 100644 index de6ae3776..000000000 --- a/src/Mix.Cms.Lib/Services/SitemapService.cs +++ /dev/null @@ -1,169 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Models.Common; -using Mix.Cms.Lib.ViewModels; -using Mix.Cms.Lib.ViewModels.Common; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Mix.Cms.Lib.Services -{ - public class SitemapService - { - public static async Task> ParseSitemapAsync() - { - UnitOfWorkHelper.InitTransaction(null, null, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - XNamespace aw = "http://www.sitemaps.org/schemas/sitemap/0.9"; - var root = new XElement(aw + "urlset"); - - await ParseNavigationsAsync(root, context, transaction); - await ParsePostsDocAsync(root, context, transaction); - - string folder = $"wwwroot"; - MixFileRepository.Instance.CreateDirectoryIfNotExist(folder); - string filename = $"sitemap"; - string filePath = $"{folder}/{filename}{MixFileExtensions.Xml}"; - root.Save(filePath); - return new RepositoryResponse() - { - IsSucceed = true, - Data = new FileViewModel() - { - Extension = MixFileExtensions.Xml, - Filename = filename, - FileFolder = folder - } - }; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #region Post - - private static async Task ParsePostsDocAsync(XElement root, MixCmsContext context, IDbContextTransaction transaction) - { - var getPosts = await Lib.ViewModels.MixPosts.ReadListItemViewModel.Repository.GetModelListAsync(context, transaction); - var dicPosts = getPosts.Data - .GroupBy(m => m.Id) - .ToDictionary(g => g.Key, g => g.ToList()); - - foreach (var item in dicPosts) - { - var post = item.Value.First(); - var lstOther = new List(); - foreach (var menu in item.Value.Skip(1)) - { - lstOther.Add(new SitemapLanguage() - { - HrefLang = menu.Specificulture, - Href = menu.DetailsUrl - }); - } - - var sitemap = new SiteMap() - { - ChangeFreq = "monthly", - LastMod = DateTime.UtcNow, - Loc = post.DetailsUrl, - Priority = 0.3, - OtherLanguages = lstOther - }; - var el = sitemap.ParseXElement(); - - root.Add(el); - } - } - - #endregion Post - - #region Navigation - - private static async Task ParseNavigationsAsync(XElement root, MixCmsContext context, IDbContextTransaction transaction) - { - var getNavigations = await ViewModels.MixDatabaseDatas.ReadMvcViewModel.Repository.GetModelListByAsync( - m => m.MixDatabaseName == MixDatabaseNames.NAVIGATION, - context, transaction - ); - var navs = getNavigations.Data.Select(n => new MixNavigation(n.Obj, n.Specificulture)).ToList(); - List menuItems = new List(); - navs.ForEach(n => menuItems.AddRange(n.MenuItems)); - var subMenus = ParseMenuItems(menuItems, context, transaction); - menuItems.AddRange(subMenus); - ParseMenuItemsDoc(root, menuItems, context, transaction); - } - - private static List ParseMenuItems(List menuItems, MixCmsContext context, IDbContextTransaction transaction) - { - List subMenuItems = new List(); - - foreach (var item in menuItems) - { - if (item.MenuItems.Count > 0) - { - subMenuItems.AddRange(item.MenuItems.Where(m => !menuItems.Any(p => p.Href == m.Href))); - subMenuItems.ForEach(m => m.Specificulture = item.Specificulture); - } - } - if (subMenuItems.Count > 0) - { - subMenuItems.AddRange(ParseMenuItems(subMenuItems, context, transaction)); - } - return subMenuItems; - } - - private static void ParseMenuItemsDoc(XElement root, List menuItems, MixCmsContext context, IDbContextTransaction transaction) - { - var dicMenuItems = menuItems - .GroupBy(m => m.Id) - .ToDictionary(g => g.Key, g => g.ToList()); - - foreach (var item in dicMenuItems) - { - var page = item.Value.First(); - var lstOther = new List(); - foreach (var menu in item.Value.Skip(1)) - { - lstOther.Add(new SitemapLanguage() - { - HrefLang = menu.Specificulture, - Href = menu.Href - }); - } - - var sitemap = new SiteMap() - { - ChangeFreq = "monthly", - LastMod = DateTime.UtcNow, - Loc = page.Href, - Priority = 0.3, - OtherLanguages = lstOther - }; - var el = sitemap.ParseXElement(); - - root.Add(el); - } - } - - #endregion Navigation - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/IdentityModels.cs b/src/Mix.Cms.Lib/ViewModels/Account/IdentityModels.cs deleted file mode 100644 index 896c63313..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/IdentityModels.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class AccessTokenViewModel - { - [JsonProperty("access_token")] - public string Access_token { get; set; } - - [JsonProperty("token_type")] - public string Token_type { get; set; } - - [JsonProperty("refresh_token")] - public string Refresh_token { get; set; } - - [JsonProperty("expires_in")] - public int Expires_in { get; set; } - - [JsonProperty("client_id")] - public string Client_id { get; set; } - - [JsonProperty("issued")] - public DateTime Issued { get; set; } - - [JsonProperty("expires")] - public DateTime Expires { get; set; } - - [JsonProperty("deviceId")] - public string DeviceId { get; set; } - - [JsonProperty("info")] - public MixUserViewModel Info { get; set; } - - [JsonProperty("lastUpdateConfiguration")] - public DateTime? LastUpdateConfiguration { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixAccountHelper.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixAccountHelper.cs deleted file mode 100644 index 4aba44459..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixAccountHelper.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class MixAccountHelper - { - public static async Task LoadUserInfoAsync(string userName, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var culture = MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var getInfo = await MixDatabaseDatas.Helper.LoadAdditionalDataAsync(MixDatabaseParentType.User, userName, MixDatabaseNames.SYSTEM_USER_DATA - , culture, context, transaction); - return getInfo.Data; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction).Data; - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static List GetRoleNavs(string userId) - { - using (MixCmsAccountContext context = new MixCmsAccountContext()) - { - var query = context.AspNetRoles - .Include(cp => cp.AspNetUserRoles) - .ToList() - .Select(p => new NavUserRoleViewModel() - { - UserId = userId, - RoleId = p.Id, - Description = p.Name, - IsActived = context.AspNetUserRoles.Any(m => m.UserId == userId && m.RoleId == p.Id) - }) - .OrderBy(m => m.Priority) - .ToList(); - query.ForEach(m => m.ExpandView(context)); - return query; - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixRegisterViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixRegisterViewModel.cs deleted file mode 100644 index b9edd1b86..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixRegisterViewModel.cs +++ /dev/null @@ -1,172 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class MixRegisterViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("username")] - public string Username { get; set; } - - [JsonProperty("email")] - public string Email { get; set; } - - [JsonProperty("firstName")] - public string FirstName { get; set; } - - [JsonProperty("middleName")] - public string MiddleName { get; set; } - - [JsonProperty("lastName")] - public string LastName { get; set; } - - [JsonProperty("avatar")] - public string Avatar { get; set; } - - [JsonProperty("address")] - public string Address { get; set; } - - [JsonProperty("phoneNumber")] - public string PhoneNumber { get; set; } - - [JsonProperty("createdby")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixUserStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("password")] - public string Password { get; set; } - - [JsonProperty("confirmPassword")] - public string ConfirmPassword { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("userRoles")] - public List UserRoles { get; set; } - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("avatarUrl")] - public string AvatarUrl { - get { - if (Avatar != null && (Avatar.IndexOf("http") == -1 && Avatar[0] != '/')) - { - return $"{Domain}/{Avatar}"; - } - else - { - return Avatar; - } - } - } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } = new FileViewModel(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public MixRegisterViewModel() : base() - { - } - - public MixRegisterViewModel(MixCmsUser model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixCmsUser ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (MediaFile.FileStream != null) - { - MediaFile.FileFolder = MixCmsHelper.GetUploadFolder(); - var isSaved = MixFileRepository.Instance.SaveWebFile(MediaFile); - if (isSaved) - { - Avatar = MediaFile.FullPath; - } - else - { - IsValid = false; - } - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UserRoles = GetRoleNavs(); - } - - #endregion Overrides - - #region Expands - - public List GetRoleNavs() - { - using (MixCmsAccountContext context = new MixCmsAccountContext()) - { - var query = context.AspNetRoles - .Include(cp => cp.AspNetUserRoles) - .ToList() - .Select(p => new NavUserRoleViewModel() - { - UserId = Id, - RoleId = p.Id, - Description = p.Name, - IsActived = context.AspNetUserRoles.Any(m => m.UserId == Id && m.RoleId == p.Id) - }); - - return query.OrderBy(m => m.Priority).ToList(); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/ReadViewModel.cs deleted file mode 100644 index 0acb1ea94..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/ReadViewModel.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.Account.MixRoles -{ - public class ReadViewModel : ViewModelBase - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("concurrencyStamp")] - public string ConcurrencyStamp { get; set; } - - [Required] - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("normalizedName")] - public string NormalizedName { get; set; } - - #region Views - - [JsonProperty("permissions")] - public List Permissions { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(AspNetRoles model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override AspNetRoles ParseModel(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - } - return base.ParseModel(_context, _transaction); - } - - public override async Task> RemoveRelatedModelsAsync(ReadViewModel view, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await UserRoleViewModel.Repository.RemoveListModelAsync(false, ur => ur.RoleId == Id, _context, _transaction); - return new RepositoryResponse() - { - IsSucceed = result.IsSucceed, - Errors = result.Errors, - Exception = result.Exception - }; - } - - public override void ExpandView(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - //Permissions = MixPortalPages.ReadRolePermissionViewModel.Repository.GetModelListBy(p => p.Level == 0 - //&& (p.MixPortalPageRole.Any(r => r.RoleId == Id) || Name == "SuperAdmin") - //).Data; - //foreach (var item in Permissions) - //{ - // item.NavPermission = MixPortalPageRoles.ReadViewModel.Repository.GetSingleModel(n => n.PageId == item.Id && n.RoleId == Id).Data; - - // //foreach (var child in item.ChildPages) - // //{ - // // child.Page.NavPermission = MixPortalPageRoles.ReadViewModel.Repository.GetSingleModel(n => n.PageId == child.Page.Id && n.RoleId == Id).Data; - // //} - //} - } - - #endregion Overrides - - #region Expands - - private List GetPermission() - { - using (MixCmsContext context = new MixCmsContext()) - { - var transaction = context.Database.BeginTransaction(); - var query = context.MixPortalPage - .Include(cp => cp.MixPortalPageRole) - .Select(Category => - new MixPortalPageRoles.ReadViewModel( - new MixPortalPageRole() - { - RoleId = Id, - PageId = Category.Id, - }, context, transaction)); - - var result = query.ToList(); - - result.ForEach(nav => - { - nav.IsActived = context.MixPortalPageRole.Any( - m => m.PageId == nav.PageId && m.RoleId == Id); - }); - transaction.Commit(); - return result.OrderBy(m => m.Priority).ToList(); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/UpdateViewModel.cs deleted file mode 100644 index 612fe3702..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixRoles/UpdateViewModel.cs +++ /dev/null @@ -1,245 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.Account.MixRoles -{ - public class UpdateViewModel : ViewModelBase - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("concurrencyStamp")] - public string ConcurrencyStamp { get; set; } - - [Required] - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("normalizedName")] - public string NormalizedName { get; set; } - - #region Views - - [JsonProperty("permissions")] - public List Permissions { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(AspNetRoles model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override AspNetRoles ParseModel(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - } - return base.ParseModel(_context, _transaction); - } - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await UserRoleViewModel.Repository.RemoveListModelAsync(false, ur => ur.RoleId == Id, _context, _transaction); - return new RepositoryResponse() - { - IsSucceed = result.IsSucceed, - Errors = result.Errors, - Exception = result.Exception - }; - } - - public async Task LoadPermissions(MixCmsContext _context = null - , IDbContextTransaction _transaction = null) - { - var getPermissions = await MixPortalPages.UpdateRolePermissionViewModel.Repository.GetModelListByAsync( - p => p.Level == 0, _context, _transaction); - if (getPermissions.IsSucceed) - { - Permissions = getPermissions.Data; - foreach (var item in Permissions) - { - item.NavPermission = MixPortalPageRoles.ReadViewModel.Repository.GetSingleModel( - n => n.PageId == item.Id && n.RoleId == Id, _context, _transaction) - .Data; - if (item.NavPermission == null) - { - var nav = new MixPortalPageRole() - { - PageId = item.Id, - RoleId = Id, - Status = MixContentStatus.Published - }; - item.NavPermission = new MixPortalPageRoles.ReadViewModel(nav) { IsActived = false }; - } - else - { - item.NavPermission.IsActived = true; - } - - foreach (var child in item.ChildPages) - { - child.PortalPage.NavPermission = MixPortalPageRoles.ReadViewModel.Repository.GetSingleModel( - n => n.PageId == child.PortalPage.Id && n.RoleId == Id, _context, _transaction) - .Data; - if (child.PortalPage.NavPermission == null) - { - var nav = new MixPortalPageRole() - { - PageId = child.PortalPage.Id, - RoleId = Id, - Status = MixContentStatus.Published - }; - child.PortalPage.NavPermission = new MixPortalPageRoles.ReadViewModel(nav) { IsActived = false }; - } - else - { - child.PortalPage.NavPermission.IsActived = true; - } - } - } - } - } - - public async Task> SavePermissionsAsync(AspNetRoles parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - foreach (var item in Permissions) - { - if (result.IsSucceed) - { - result = await HandlePermission(item, context, transaction); - } - else - { - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - - #endregion Overrides - - #region Expands - - private List GetPermission() - { - using (MixCmsContext context = new MixCmsContext()) - { - var transaction = context.Database.BeginTransaction(); - var query = context.MixPortalPage - .Include(cp => cp.MixPortalPageRole) - .Select(Category => - new MixPortalPageRoles.ReadViewModel( - new MixPortalPageRole() - { - RoleId = Id, - PageId = Category.Id, - }, context, transaction)); - - var result = query.ToList(); - result.ForEach(nav => - { - nav.IsActived = context.MixPortalPageRole.Any( - m => m.PageId == nav.PageId && m.RoleId == Id); - }); - transaction.Commit(); - return result.OrderBy(m => m.Priority).ToList(); - } - } - - private async Task> HandlePermission(MixPortalPages.UpdateRolePermissionViewModel item, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - if (item.NavPermission.IsActived) - { - item.NavPermission.CreatedBy = item.CreatedBy; - var saveResult = await item.NavPermission.SaveModelAsync(false, context, transaction); - result.IsSucceed = saveResult.IsSucceed; - /* skip child nav - if (result.IsSucceed) - { - foreach (var child in item.ChildPages) - { - result = await HandlePermission(child.Page, context, transaction); - if (!result.IsSucceed) - { - break; - } - } - }*/ - - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.NavPermission.RemoveModelAsync(false, context, transaction); - /* skip child nav */ - result.IsSucceed = saveResult.IsSucceed; - if (result.IsSucceed) - { - foreach (var child in item.ChildPages) - { - child.PortalPage.NavPermission.IsActived = false; - result = await HandlePermission(child.PortalPage, context, transaction); - } - } - - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - - return result; - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixUserViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixUserViewModel.cs deleted file mode 100644 index 7f9c51692..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixUserViewModel.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Mix.Identity.Models; -using Mix.Identity.Models.AccountViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class MixUserViewModel - { - [JsonProperty("user")] - public ApplicationUser User { get; set; } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } = new FileViewModel(); - - [JsonProperty("userData")] - public MixDatabaseDatas.AdditionalViewModel UserData { get; set; } - - [JsonProperty("userRoles")] - public List UserRoles { get; set; } - - #region Change Password - - [JsonProperty("resetPassword")] - public ResetPasswordViewModel ResetPassword { get; set; } - - [JsonProperty("isChangePassword")] - public bool IsChangePassword { get; set; } - - [JsonProperty("changePassword")] - public ChangePasswordViewModel ChangePassword { get; set; } - - #endregion Change Password - - - - public MixUserViewModel(ApplicationUser user) - { - User = user; - } - - public async Task LoadUserDataAsync() - { - if (User != null) - { - UserData ??= await MixAccountHelper.LoadUserInfoAsync(User.UserName); - UserRoles = MixAccountHelper.GetRoleNavs(User.Id); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/MixUsers/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/MixUsers/UpdateViewModel.cs deleted file mode 100644 index 4fb1d0aff..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/MixUsers/UpdateViewModel.cs +++ /dev/null @@ -1,151 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.Account.MixUsers -{ - public class UpdateViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("username")] - public string Username { get; set; } - - [JsonProperty("email")] - public string Email { get; set; } - - [JsonProperty("firstName")] - public string FirstName { get; set; } - - [JsonProperty("middleName")] - public string MiddleName { get; set; } - - [JsonProperty("lastName")] - public string LastName { get; set; } - - [JsonProperty("avatar")] - public string Avatar { get; set; } - - [JsonProperty("address")] - public string Address { get; set; } - - [JsonProperty("phoneNumber")] - public string PhoneNumber { get; set; } - - [JsonProperty("createdby")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("status")] - public MixUserStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("password")] - public string Password { get; set; } - - [JsonProperty("confirmPassword")] - public string ConfirmPassword { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("userRoles")] - public List UserRoles { get; set; } - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("avatarUrl")] - public string AvatarUrl { - get { - if (Avatar != null && (Avatar.IndexOf("http") == -1 && Avatar[0] != '/')) - { - return $"{Domain}/{Avatar}"; - } - else - { - return Avatar; - } - } - } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } = new FileViewModel(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixCmsUser model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixCmsUser ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (MediaFile.FileStream != null) - { - MediaFile.FileFolder = MixCmsHelper.GetUploadFolder(Specificulture); - var isSaved = MixFileRepository.Instance.SaveWebFile(MediaFile); - if (isSaved) - { - Avatar = MediaFile.FullPath; - } - else - { - IsValid = false; - } - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UserRoles = MixAccountHelper.GetRoleNavs(Id); - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/NavUserRoleViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/NavUserRoleViewModel.cs deleted file mode 100644 index 18286b9a5..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/NavUserRoleViewModel.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Account; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class NavUserRoleViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("userId")] - public string UserId { get; set; } - - [JsonProperty("roleId")] - public string RoleId { get; set; } - - [JsonProperty("applicationUserId")] - public string ApplicationUserId { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("role")] - public RoleViewModel Role { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public NavUserRoleViewModel() : base() - { - } - - public NavUserRoleViewModel(AspNetUserRoles model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - Role = RoleViewModel.Repository.GetSingleModel(r => r.Id == RoleId, _context, _transaction).Data; - Description = Role?.Name; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/RefreshTokenViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/RefreshTokenViewModel.cs deleted file mode 100644 index eda8eae8c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/RefreshTokenViewModel.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Account; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class RefreshTokenViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("clientId")] - public string ClientId { get; set; } - - [JsonProperty("email")] - public string Email { get; set; } - - [JsonProperty("expiresUtc")] - public DateTime ExpiresUtc { get; set; } - - [JsonProperty("issuedUtc")] - public DateTime IssuedUtc { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public RefreshTokenViewModel() : base() - { - } - - public RefreshTokenViewModel(RefreshTokens model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/RoleViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/RoleViewModel.cs deleted file mode 100644 index 878287cf2..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/RoleViewModel.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Account; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class RoleViewModel - : ViewModelBase - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("concurrencyStamp")] - public string ConcurrencyStamp { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("normalizedName")] - public string NormalizedName { get; set; } - - #endregion Properties - - #region Contructors - - public RoleViewModel() : base() - { - } - - public RoleViewModel(AspNetRoles model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override AspNetRoles ParseModel(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - } - return base.ParseModel(_context, _transaction); - } - - public override async Task> RemoveRelatedModelsAsync(RoleViewModel view, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await UserRoleViewModel.Repository.RemoveListModelAsync(false, ur => ur.RoleId == Id, _context, _transaction); - return new RepositoryResponse() - { - IsSucceed = result.IsSucceed, - Errors = result.Errors, - Exception = result.Exception - }; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/UserInfoViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/UserInfoViewModel.cs deleted file mode 100644 index 031809dee..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/UserInfoViewModel.cs +++ /dev/null @@ -1,142 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Mix.Identity.Models.AccountViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class UserInfoViewModel - : ViewModelBase - { - #region Properties - - #region Models - - public string Id { get; set; } - public int AccessFailedCount { get; set; } - public string Avatar { get; set; } - public string ConcurrencyStamp { get; set; } - public int CountryId { get; set; } - public string Culture { get; set; } - public DateTime? Dob { get; set; } - public string Email { get; set; } - public ulong EmailConfirmed { get; set; } - public string FirstName { get; set; } - public string Gender { get; set; } - public ulong IsActived { get; set; } - public DateTime JoinDate { get; set; } - public DateTime LastModified { get; set; } - public string LastName { get; set; } - public ulong LockoutEnabled { get; set; } - public DateTime? LockoutEnd { get; set; } - public string ModifiedBy { get; set; } - public string NickName { get; set; } - public string NormalizedEmail { get; set; } - public string NormalizedUserName { get; set; } - public string PasswordHash { get; set; } - public string PhoneNumber { get; set; } - public ulong PhoneNumberConfirmed { get; set; } - public string RegisterType { get; set; } - public string SecurityStamp { get; set; } - public ulong TwoFactorEnabled { get; set; } - public string UserName { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("userRoles")] - public List UserRoles { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("avatarUrl")] - public string AvatarUrl { - get { - if (Avatar != null && (Avatar.IndexOf("http") == -1 && Avatar[0] != '/')) - { - return $"{Domain}/{Avatar}"; - } - else - { - return Avatar; - } - } - } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } = new FileViewModel(); - - [JsonProperty("resetPassword")] - public ResetPasswordViewModel ResetPassword { get; set; } - - [JsonProperty("isChangePassword")] - public bool IsChangePassword { get; set; } - - [JsonProperty("changePassword")] - public ChangePasswordViewModel ChangePassword { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UserInfoViewModel() : base() - { - } - - public UserInfoViewModel(AspNetUsers model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override AspNetUsers ParseModel(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - if (MediaFile.FileStream != null) - { - MediaFile.FileFolder = MixCmsHelper.GetUploadFolder(); - var isSaved = MixFileRepository.Instance.SaveWebFile(MediaFile); - if (isSaved) - { - Avatar = MediaFile.FullPath; - } - else - { - IsValid = false; - } - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - UserRoles ??= UserRoleViewModel.Repository.GetModelListBy( - m => m.UserId == Id, _context, _transaction).Data; - ResetPassword = new ResetPasswordViewModel(); - } - - #endregion Overrides - } - - public class ChangePasswordViewModel - { - public string CurrentPassword { get; set; } - public string NewPassword { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Account/UserRoleViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Account/UserRoleViewModel.cs deleted file mode 100644 index d6168820c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Account/UserRoleViewModel.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Account; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; - -namespace Mix.Cms.Lib.ViewModels.Account -{ - public class UserRoleViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("userId")] - public string UserId { get; set; } - - [JsonProperty("roleId")] - public string RoleId { get; set; } - - [JsonProperty("applicationUserId")] - public string ApplicationUserId { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("role")] - public RoleViewModel UserRole { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UserRoleViewModel() : base() - { - } - - public UserRoleViewModel(AspNetUserRoles model, MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsAccountContext _context = null, IDbContextTransaction _transaction = null) - { - UserRole = RoleViewModel.Repository.GetSingleModel(r => r.Id == RoleId, _context, _transaction).Data; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Common/SiteMap.cs b/src/Mix.Cms.Lib/ViewModels/Common/SiteMap.cs deleted file mode 100644 index 941da4867..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Common/SiteMap.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Xml.Linq; - -namespace Mix.Cms.Lib.ViewModels.Common -{ - public class SiteMap - { - public DateTime? LastMod { get; set; } - public string ChangeFreq { get; set; } - public double Priority { get; set; } - public string Loc { get; set; } - public List OtherLanguages { get; set; } - - public XElement ParseXElement() - { - XNamespace xhtml = "http://www.w3.org/1999/xhtml"; - XNamespace ns = @"http://www.sitemaps.org/schemas/sitemap/0.9"; - XNamespace xsi = @"http://www.w3.org/1999/xhtml"; - - var e = new XElement(ns + "url"); - e.Add(new XElement(ns + "lastmod", LastMod.HasValue ? LastMod.Value : DateTime.UtcNow)); - e.Add(new XElement(ns + "changefreq", ChangeFreq)); - e.Add(new XElement(ns + "priority", Priority)); - e.Add(new XElement(ns + "loc", Loc)); - foreach (var item in OtherLanguages) - { - e.Add(new XElement(xsi + "link", - new XAttribute(XNamespace.Xmlns + "xhtml", xsi.NamespaceName), - new XAttribute("rel", "alternate"), - new XAttribute("hreflang", item.HrefLang), - new XAttribute("href", item.Href) - )); - } - return e; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/CommonViewModels.cs b/src/Mix.Cms.Lib/ViewModels/CommonViewModels.cs deleted file mode 100644 index 899bb3139..000000000 --- a/src/Mix.Cms.Lib/ViewModels/CommonViewModels.cs +++ /dev/null @@ -1,351 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Xml.Linq; - -namespace Mix.Cms.Lib.ViewModels -{ - public class GlobalSettingsViewModel - { - [JsonProperty("domain")] - public string Domain { get; set; } - - [JsonProperty("lang")] - public string Lang { get; set; } - - [JsonProperty("langIcon")] - public string LangIcon { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("portalThemeSettings")] - public JObject PortalThemeSettings { get; set; } - - [JsonProperty("apiEncryptKey")] - public string ApiEncryptKey { get; set; } - - [JsonProperty("apiEncryptIV")] - public string ApiEncryptIV { get; set; } - - [JsonProperty("isEncryptApi")] - public bool IsEncryptApi { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("pageTypes")] - public List PageTypes { get; set; } - - [JsonProperty("moduleTypes")] - public List ModuleTypes { get; set; } - - [JsonProperty("mixDatabaseTypes")] - public List MixDatabaseTypes { get; set; } - - [JsonProperty("dataTypes")] - public List DataTypes { get; set; } - - [JsonProperty("statuses")] - public List Statuses { get; set; } - - [JsonProperty("lastUpdateConfiguration")] - public DateTime? LastUpdateConfiguration { get; set; } - } - - public class FilePageViewModel - { - [JsonProperty("files")] - public List Files { get; set; } - - [JsonProperty("directories")] - public List Directories { get; set; } - } - - public class InitCulture - { - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("fullName")] - public string FullName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("alias")] - public string Alias { get; set; } - } - - public class ExtraProperty - { - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - } - - //public class CryptoViewModel - //{ - // [JsonProperty("base64Key")] - // public string Base64Key { get; set; } - // [JsonProperty("base64IV")] - // public string Base64IV { get; set; } - // [JsonProperty("data")] - // public T Data { get; set; } - //} - public class DataValueViewModel - { - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } = MixDataType.Text; - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - } - - public class TemplateViewModel - { - public string FileFolder { get; set; } - - [Required] - public string Filename { get; set; } - - public string Extension { get; set; } - public string Content { get; set; } - public string Scripts { get; set; } - public string Styles { get; set; } - public string FileStream { get; set; } - } - - public class ModuleFieldViewModel - { - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("options")] - public JArray Options { get; set; } = new JArray(); - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("isUnique")] - public bool IsUnique { get; set; } - - [JsonProperty("isRequired")] - public bool IsRequired { get; set; } - - [JsonProperty("isDisplay")] - public bool IsDisplay { get; set; } - - [JsonProperty("isSelect")] - public bool IsSelect { get; set; } - - [JsonProperty("isGroupBy")] - public bool IsGroupBy { get; set; } - - [JsonProperty("width")] - public int Width { get; set; } - } - - public class ApiModuleDataValueViewModel - { - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("isUnique")] - public bool IsUnique { get; set; } - - [JsonProperty("isRequired")] - public bool IsRequired { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("isDisplay")] - public bool IsDisplay { get; set; } - - [JsonProperty("isSelect")] - public bool IsSelect { get; set; } - - [JsonProperty("isGroupBy")] - public bool IsGroupBy { get; set; } - - [JsonProperty("options")] - public JArray Options { get; set; } = new JArray(); - - public RepositoryResponse Validate(IConvertible id, string specificulture, JObject jItem, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where T : class - { - string val = jItem[Name]["value"].Value(); - var jVal = new JProperty(Name, jItem[Name]); - var result = new RepositoryResponse() { IsSucceed = true }; - if (IsUnique) - { - //string query = @"SELECT * FROM [Mix_module_data] WHERE JSON_VALUE([Value],'$.{0}.value') = '{1}'"; // AND Specificulture = '{2}' AND Id <> '{3}' - //var temp = string.Format(query, Name, val);//, specificulture, id?.ToString() - //int count = _context.MixModuleData.FromSql(query, Name, val).Count(d=>d.Specificulture == specificulture && d.Id != id.ToString());//, specificulture, id?.ToString() - //string query = $"SELECT * FROM Mix_module_data WHERE JSON_VALUE([Value],'$.{Name}.value') = '{val}' AND Specificulture = '{specificulture}' AND Id != '{id}'"; - //int count = _context.MixModuleData.FromSql(sql: new RawSqlString(query)).Count(); - var strId = id?.ToString(); - int count = _context.MixModuleData.Count(d => d.Specificulture == specificulture - && d.Value.Contains(jVal.ToString(Formatting.None)) && d.Id != strId); - if (count > 0) - { - result.IsSucceed = false; - result.Errors.Add($"{Title} is existed"); - } - } - if (IsRequired) - { - if (string.IsNullOrEmpty(val)) - { - result.IsSucceed = false; - result.Errors.Add($"{Title} is required"); - } - } - return result; - } - } - - public class MobileComponent - { - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("componentType")] - public string ComponentType { get; set; } - - [JsonProperty("styleName")] - public string StyleName { get; set; } - - [JsonProperty("dataType")] - public string DataType { get; set; } - - [JsonProperty("dataValue")] - public string DataValue { get; set; } - - [JsonProperty("dataSource")] - public List DataSource { get; set; } - - public MobileComponent(XElement element) - { - if (element != null) - { - StyleName = element.Attribute("class")?.Value; - - DataSource = new List(); - var subElements = element.Elements(); - if (subElements.Any()) - { - if (element.Attribute("data") != null) - { - ComponentType = "View"; - DataValue = element.Attribute("data")?.Value.Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", ""); - DataType = "object_array"; - } - else - { - ComponentType = "View"; - DataType = "component"; - } - foreach (var subElement in subElements) - { - if (subElement.Name != "br") - { - DataSource.Add(new MobileComponent(subElement)); - } - } - } - else - { - switch (element.Name.LocalName) - { - case "img": - ComponentType = "Image"; - DataType = "image_url"; - DataValue = element.Attribute("src")?.Value.Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", ""); - break; - - case "br": - break; - - default: - ComponentType = "Text"; - - string val = element.Value.Trim(); - if (val.Contains("{{") && val.Contains("}}")) - { - DataType = "object"; - } - else - { - DataType = "string"; - } - DataValue = element.Value.Trim().Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", ""); - break; - } - } - } - } - } - - public class ListAction - { - [JsonProperty("action")] - public string Action { get; set; } - - [JsonProperty("data")] - public List Data { get; set; } - } - - public class SitemapLanguage - { - public string HrefLang { get; set; } - public string Href { get; set; } - } - - public class FileInputModel - { - public IFormFile FileToUpload { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/DashboardViewModel.cs b/src/Mix.Cms.Lib/ViewModels/DashboardViewModel.cs deleted file mode 100644 index 12828632a..000000000 --- a/src/Mix.Cms.Lib/ViewModels/DashboardViewModel.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Mix.Cms.Lib.Models.Cms; -using Newtonsoft.Json; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels -{ - public class DashboardViewModel - { - [JsonProperty("totalPage")] - public int TotalPage { get; set; } - - [JsonProperty("totalPost")] - public int TotalPost { get; set; } - - [JsonProperty("totalProduct")] - public int TotalProduct { get; set; } - - [JsonProperty("totalModule")] - public int TotalModule { get; set; } - - [JsonProperty("totalUser")] - public int TotalUser { get; set; } - - public DashboardViewModel(string culture) - { - using (MixCmsContext context = new MixCmsContext()) - { - TotalPage = context.MixPage.Count(p => p.Specificulture == culture); - TotalPost = context.MixPost.Count(p => p.Specificulture == culture); - TotalUser = context.MixCmsUser.Count(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/Init/InitCmsViewModel.cs b/src/Mix.Cms.Lib/ViewModels/Init/InitCmsViewModel.cs deleted file mode 100644 index 844500a57..000000000 --- a/src/Mix.Cms.Lib/ViewModels/Init/InitCmsViewModel.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Mix.Cms.Lib.Enums; -using Newtonsoft.Json; - -namespace Mix.Cms.Lib.ViewModels.MixInit -{ - public class InitCmsViewModel - { - #region Properties - - [JsonProperty("connectionString")] - public string ConnectionString { - get { - switch (DatabaseProvider) - { - case MixDatabaseProvider.MSSQL: - { - string dbServer = !string.IsNullOrEmpty(DatabasePort) ? $"{DatabaseServer},{DatabasePort}" : DatabaseServer; - return IsUseLocal - ? LocalDbConnectionString - : $"Server={dbServer};Database={DatabaseName}" + - $";UID={DatabaseUser};Pwd={DatabasePassword};MultipleActiveResultSets=true;"; - } - case MixDatabaseProvider.MySQL: - return $"Server={DatabaseServer};port={DatabasePort};Database={DatabaseName}" + - $";User={DatabaseUser};Password={DatabasePassword};"; - case MixDatabaseProvider.PostgreSQL: - return $"Host={DatabaseServer};Port={DatabasePort};Database={DatabaseName};Username={DatabaseUser};Password={DatabasePassword}"; - case MixDatabaseProvider.SQLITE: - return SqliteDbConnectionString; - - default: - return string.Empty; - } - } - } - - [JsonProperty("databaseServer")] - public string DatabaseServer { get; set; } - - [JsonProperty("databasePort")] - public string DatabasePort { get; set; } - - [JsonProperty("databaseName")] - public string DatabaseName { get; set; } - - [JsonProperty("databaseUser")] - public string DatabaseUser { get; set; } - - [JsonProperty("databasePassword")] - public string DatabasePassword { get; set; } - - [JsonProperty("isUseLocal")] - public bool IsUseLocal { get; set; } - - [JsonProperty("localDbConnectionString")] - public string LocalDbConnectionString { get; set; } = - $"Server=(localdb)\\MSSQLLocalDB;Initial Catalog=mix-cms.db;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=True"; - - [JsonProperty("sqliteDbConnectionString")] - public string SqliteDbConnectionString { get; set; } = $"Data Source=mix-cms.db"; - - [JsonProperty("lang")] - public string Lang { get; set; } - - [JsonProperty("databaseProvider")] - public MixDatabaseProvider DatabaseProvider { get; set; } - - [JsonProperty("culture")] - public InitCulture Culture { get; set; } - - [JsonProperty("siteName")] - public string SiteName { get; set; } = "MixCore"; - - #endregion Properties - - public InitCmsViewModel() - { - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/DeleteViewModel.cs deleted file mode 100644 index 09dca316d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/DeleteViewModel.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class DeleteViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ImportViewModel.cs deleted file mode 100644 index 585b13cd0..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ImportViewModel.cs +++ /dev/null @@ -1,208 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class UpdateViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public System.Collections.Generic.List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixConfiguration ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - Value = Property.Value; - DataType = Property.DataType; - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = LoadCultures(Specificulture, _context, _transaction); - this.Cultures.ForEach(c => c.IsSupported = true); - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed && _context == null) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - #endregion Overrides - - #region Expand - - public static async Task> ImportConfigurations(List arrConfiguration, string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - foreach (var item in arrConfiguration) - { - var conf = new UpdateViewModel(item, context, transaction); - conf.CreatedDateTime = DateTime.UtcNow; - conf.Specificulture = destCulture; - var saveResult = await conf.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - result.Data = true; - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - context.Dispose(); - } - } - return result; - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixConfiguration.Any(p => p.Keyword == Keyword && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadMvcViewModel.cs deleted file mode 100644 index fc345d8c3..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadMvcViewModel.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.ComponentModel.DataAnnotations; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public System.Collections.Generic.List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() - : base() - { - } - - public ReadMvcViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadViewModel.cs deleted file mode 100644 index 7fa561430..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/ReadViewModel.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.ComponentModel.DataAnnotations; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public System.Collections.Generic.List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public ReadViewModel() - : base() - { - } - - public ReadViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/SystemConfigurationViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/SystemConfigurationViewModel.cs deleted file mode 100644 index 334188a4c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/SystemConfigurationViewModel.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class SystemConfigurationViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public System.Collections.Generic.List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public SystemConfigurationViewModel() - : base() - { - } - - public SystemConfigurationViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixConfiguration ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - } - - #endregion Overrides - - #region Expands - - public static async Task> ImportConfigurations(List arrConfiguration, string destCulture) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - - try - { - foreach (var item in arrConfiguration) - { - var lang = new SystemConfigurationViewModel(item, context, transaction); - lang.Specificulture = destCulture; - var saveResult = await lang.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, true, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - return result; - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixConfigurations/UpdateViewModel.cs deleted file mode 100644 index 4057ee442..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixConfigurations/UpdateViewModel.cs +++ /dev/null @@ -1,208 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixConfigurations -{ - public class ImportViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public System.Collections.Generic.List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixConfiguration model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixConfiguration ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - Value = Property.Value; - DataType = Property.DataType; - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = LoadCultures(Specificulture, _context, _transaction); - this.Cultures.ForEach(c => c.IsSupported = true); - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed && _context == null) - { - MixService.SetConfig("LastUpdateConfiguration", DateTime.UtcNow); - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - #endregion Overrides - - #region Expand - - public static async Task> ImportConfigurations(List arrConfiguration, string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - foreach (var item in arrConfiguration) - { - var conf = new ImportViewModel(item, context, transaction); - conf.CreatedDateTime = DateTime.UtcNow; - conf.Specificulture = destCulture; - var saveResult = await conf.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - result.Data = true; - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - context.Dispose(); - } - } - return result; - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixConfiguration.Any(p => p.Keyword == Keyword && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixCultures/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixCultures/ReadViewModel.cs deleted file mode 100644 index 41ed42974..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixCultures/ReadViewModel.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixCultures -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("alias")] - public string Alias { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fullName")] - public string FullName { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("lcid")] - public string Lcid { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("configurations")] - public List Configurations { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixCulture model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixCultures/SystemCultureViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixCultures/SystemCultureViewModel.cs deleted file mode 100644 index 0abd5e412..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixCultures/SystemCultureViewModel.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixConfigurations; -using Mix.Cms.Lib.ViewModels.MixLanguages; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixCultures -{ - public class SystemCultureViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("alias")] - public string Alias { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fullName")] - public string FullName { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("lcid")] - public string Lcid { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public SystemCultureViewModel() : base() - { - } - - public SystemCultureViewModel(MixCulture model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override async Task> RemoveRelatedModelsAsync(SystemCultureViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var configs = await SystemConfigurationViewModel.Repository.GetModelListByAsync(c => c.Specificulture == view.Specificulture, _context, _transaction); - if (configs.IsSucceed) - { - foreach (var item in configs.Data) - { - var removeResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = result.IsSucceed && removeResult.IsSucceed; - if (!result.IsSucceed) - { - result.Errors.AddRange(removeResult.Errors); - result.Exception = removeResult.Exception; - break; - } - } - } - if (result.IsSucceed) - { - var languages = await SystemLanguageViewModel.Repository.GetModelListByAsync(c => c.Specificulture == view.Specificulture, _context, _transaction); - if (languages.IsSucceed) - { - foreach (var item in languages.Data) - { - var removeResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = result.IsSucceed && removeResult.IsSucceed; - if (!result.IsSucceed) - { - result.Errors.AddRange(removeResult.Errors); - result.Exception = removeResult.Exception; - break; - } - } - } - } - - return result; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixCultures/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixCultures/UpdateViewModel.cs deleted file mode 100644 index e4c95702d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixCultures/UpdateViewModel.cs +++ /dev/null @@ -1,806 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixCultures -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("alias")] - public string Alias { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fullName")] - public string FullName { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("lcid")] - public string Lcid { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("configurations")] - public List Configurations { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixCulture model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixCulture ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getConfigurations = MixConfigurations.ReadMvcViewModel.Repository.GetModelListBy(c => c.Specificulture == Specificulture, _context, _transaction); - if (getConfigurations.IsSucceed) - { - Configurations = getConfigurations.Data; - } - } - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - public override async Task> SaveSubModelsAsync(MixCulture parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - // Clone Configurations - if (result.IsSucceed) - { - var cloneResult = await CloneConfigurationsAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - if (result.IsSucceed) - { - var cloneResult = await CloneLanguagesAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - if (result.IsSucceed) - { - var cloneResult = await CloneMediasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - if (result.IsSucceed) - { - var cloneResult = await CloneModulesAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone Pages - if (result.IsSucceed) - { - var cloneResult = await ClonePagesAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone Post from Default culture - if (result.IsSucceed) - { - var cloneResult = await ClonePostsAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - // Clone ModuleData from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneModuleDatasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - // Clone PageModules from Default culture - if (result.IsSucceed) - { - var cloneResult = await ClonePageModulesAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone PagePost from Default culture - if (result.IsSucceed) - { - var cloneResult = await ClonePagePostsAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone ModulePost from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneModulePostsAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone ModulePost from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneModuleDatasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - // Clone PostPost from Default culture - if (result.IsSucceed) - { - var cloneResult = await ClonePostPostsAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone PostMedia from Default culture - if (result.IsSucceed) - { - var cloneResult = await ClonePostMediasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone PostMedia from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneUrlAliasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - // Clone Attribute Value from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneMixDatabaseDataValuesAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - // Clone Attribute Data from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneAttributeDatasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - // Clone Related Data from Default culture - if (result.IsSucceed) - { - var cloneResult = await CloneRelatedAttributeDatasAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(cloneResult, ref result); - } - - return result; - } - - public async Task> CloneRelatedAttributeDatasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixDatabaseDataAssociation.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneAttributeDatasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixDatabaseData.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneMixDatabaseDataValuesAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixDatabaseDataValue.Any(m => m.DataId == p.DataId && m.Specificulture == Specificulture)) - { - p.Id = Guid.NewGuid().ToString(); - if (!string.IsNullOrEmpty(p.StringValue) && p.StringValue.Contains($"/{p.Specificulture}")) - { - p.StringValue = p.StringValue.Replace($"/{p.Specificulture}", $"/{Specificulture}"); - } - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneUrlAliasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixUrlAlias.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneModulesAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixModule.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneMediasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixMedia.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePostMediasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixPostMedia.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePostPostsAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixRelatedPost.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneModulePostsAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getModules = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getModules.IsSucceed) - { - foreach (var p in getModules.Data) - { - if (!context.MixModulePost.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePagePostsAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixPagePost.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePageModulesAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixPageModule.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePostsAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixPost.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneModuleDatasAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixModuleData.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneLanguagesAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixLanguage.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> CloneConfigurationsAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixConfiguration.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public async Task> ClonePagesAsync(MixCulture parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - var getPages = await DefaultModelRepository.Instance.GetModelListByAsync( - c => c.Specificulture == MixService.GetConfig(MixAppSettingKeywords.DefaultCulture), - context, transaction); - if (getPages.IsSucceed) - { - foreach (var p in getPages.Data) - { - if (!context.MixPage.Any(m => m.Id == p.Id && m.Specificulture == Specificulture)) - { - p.Specificulture = Specificulture; - p.CreatedDateTime = DateTime.UtcNow; - p.LastModified = DateTime.UtcNow; - context.Entry(p).State = EntityState.Added; - } - } - await context.SaveChangesAsync(); - } - } - catch (Exception ex) - { - result.IsSucceed = false; - result.Exception = ex; - result.Errors.Add(ex.Message); - } - return result; - } - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - var configs = await _context.MixConfiguration.Where(c => c.Specificulture == Specificulture).ToListAsync(); - configs.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var languages = await _context.MixLanguage.Where(l => l.Specificulture == Specificulture).ToListAsync(); - languages.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var PageModules = await _context.MixPageModule.Where(l => l.Specificulture == Specificulture).ToListAsync(); - PageModules.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var PagePosts = await _context.MixPagePost.Where(l => l.Specificulture == Specificulture).ToListAsync(); - PagePosts.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var ModulePosts = await _context.MixModulePost.Where(l => l.Specificulture == Specificulture).ToListAsync(); - ModulePosts.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var PostMedias = await _context.MixPostMedia.Where(l => l.Specificulture == Specificulture).ToListAsync(); - PostMedias.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var ModuleDatas = await _context.MixModuleData.Where(l => l.Specificulture == Specificulture).ToListAsync(); - ModuleDatas.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var PostPosts = await _context.MixRelatedPost.Where(l => l.Specificulture == Specificulture).ToListAsync(); - PostPosts.ForEach(l => _context.Entry(l).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var medias = await _context.MixMedia.Where(c => c.Specificulture == Specificulture).ToListAsync(); - medias.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var cates = await _context.MixPage.Where(c => c.Specificulture == Specificulture).ToListAsync(); - cates.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var modules = await _context.MixModule.Where(c => c.Specificulture == Specificulture).ToListAsync(); - modules.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var posts = await _context.MixPost.Where(c => c.Specificulture == Specificulture).ToListAsync(); - posts.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var aliases = await _context.MixUrlAlias.Where(c => c.Specificulture == Specificulture).ToListAsync(); - aliases.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var values = await _context.MixDatabaseDataValue.Where(c => c.Specificulture == Specificulture).ToListAsync(); - values.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var datas = await _context.MixDatabaseData.Where(c => c.Specificulture == Specificulture).ToListAsync(); - datas.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - var relateddatas = await _context.MixDatabaseDataAssociation.Where(c => c.Specificulture == Specificulture).ToListAsync(); - relateddatas.ForEach(c => _context.Entry(c).State = Microsoft.EntityFrameworkCore.EntityState.Deleted); - - result.IsSucceed = (await _context.SaveChangesAsync() > 0); - return result; - } - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - } - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/DeleteViewModel.cs deleted file mode 100644 index b358e47b0..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/DeleteViewModel.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseColumns -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("attributesetId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("referenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("dataType")] - public int DataType { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("isRequire")] - public bool IsRequire { get; set; } - - [JsonProperty("isEncrypt")] - public bool IsEncrypt { get; set; } - - [JsonProperty("isSelect")] - public bool IsSelect { get; set; } - - [JsonProperty("isUnique")] - public bool IsUnique { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixDatabaseColumn model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region overrides - - public override async Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var removeDataIds = _context.MixDatabaseDataValue.Where(m => m.MixDatabaseColumnId == Id).Select(m => m.DataId).ToList(); - var removeFieldValues = await MixDatabaseDataValues.DeleteViewModel.Repository.RemoveListModelAsync(false, f => f.MixDatabaseColumnId == Id - , _context, _transaction); - ViewModelHelper.HandleResult(removeFieldValues, ref result); - if (result.IsSucceed) - { - foreach (var item in removeDataIds) - { - _ = MixCacheService.RemoveCacheAsync(typeof(MixDatabaseData), item); - } - } - return result; - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/FieldConfigurations.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/FieldConfigurations.cs deleted file mode 100644 index 28c24efaf..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/FieldConfigurations.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseColumns -{ - public class FieldConfigurations - { - [JsonProperty("upload")] - public UploadConfigurations Upload { get; set; } = new UploadConfigurations(); - } - - public class UploadConfigurations - { - [JsonProperty("arrayAccepts")] - public JArray ArrayAccepts { get; set; } = new JArray(); - - [JsonProperty("accepts")] - public string Accepts { get => string.Join(",", ArrayAccepts.Select(m => m.Value("text")).ToArray()); } - - [JsonProperty("width")] - public int? Width { get; set; } - - [JsonProperty("height")] - public int? Height { get; set; } - - [JsonProperty("isCrop")] - public bool IsCrop { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/ReadViewModel.cs deleted file mode 100644 index 88807b270..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/ReadViewModel.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseColumns -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("attributesetId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("referenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("isRequire")] - public bool IsRequire { get; set; } - - [JsonProperty("isEncrypt")] - public bool IsEncrypt { get; set; } - - [JsonProperty("isSelect")] - public bool IsSelect { get; set; } - - [JsonProperty("isUnique")] - public bool IsUnique { get; set; } - - [JsonProperty("isMultiple")] - public bool IsMultiple { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixDatabaseColumn model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/UpdateViewModel.cs deleted file mode 100644 index d938487eb..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseColumns/UpdateViewModel.cs +++ /dev/null @@ -1,173 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseColumns -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("configurations")] - public string Configurations { get; set; } - - [JsonProperty("referenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("isRegex")] - public bool IsRegex { get { return !string.IsNullOrEmpty(Regex); } } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("strOptions")] - public string Options { get; set; } = "[]"; - - [JsonProperty("options")] - public JArray JOptions { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("isRequire")] - public bool IsRequire { get; set; } - - [JsonProperty("isEncrypt")] - public bool IsEncrypt { get; set; } - - [JsonProperty("isSelect")] - public bool IsSelect { get; set; } - - [JsonProperty("isUnique")] - public bool IsUnique { get; set; } - - [JsonProperty("isMultiple")] - public bool IsMultiple { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("fieldConfigurations")] - public FieldConfigurations FieldConfigurations { get; set; } = new FieldConfigurations(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixDatabaseColumn model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (MixDatabaseName != "sys_additional_field") - { - // Check if there is field name in the same attribute set - IsValid = !_context.MixDatabaseColumn.Any( - f => f.Id != Id && f.Name == Name && f.MixDatabaseId == MixDatabaseId); - if (!IsValid) - { - Errors.Add($"Field {Name} Existed"); - } - } - } - } - - public override MixDatabaseColumn ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - Options = JOptions?.ToString(); - Configurations = JObject.FromObject(FieldConfigurations).ToString(Formatting.None); - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (!string.IsNullOrEmpty(Options)) - { - JOptions = JArray.Parse(Options); - } - - FieldConfigurations = string.IsNullOrEmpty(Configurations) ? new FieldConfigurations() - : JObject.Parse(Configurations).ToObject(); - } - - public override Task RemoveCache(MixDatabaseColumn model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - using (_context ??= new MixCmsContext()) - { - var relatedDatabaseId = _context.MixDatabase.Where(m => m.Id == MixDatabaseId).Select(m => m.Id); - MixCacheService.RemoveCacheAsync(typeof(MixDatabase), relatedDatabaseId.ToString()); - return base.RemoveCache(model, _context, _transaction); - } - } - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/DeleteViewModel.cs deleted file mode 100644 index 8c59e52ff..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/DeleteViewModel.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - public string Id { get; set; } - public string Specificulture { get; set; } - public string DataId { get; set; } - public string ParentId { get; set; } - public MixDatabaseParentType ParentType { get; set; } - public int MixDatabaseId { get; set; } - public DateTime CreatedDateTime { get; set; } - public string Status { get; set; } - public string Description { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixDatabaseDataAssociation ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/FormViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/FormViewModel.cs deleted file mode 100644 index 47d1efd65..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/FormViewModel.cs +++ /dev/null @@ -1,164 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class FormViewModel - : ViewModelBase - { - public FormViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public FormViewModel() : base() - { - } - - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("attributeData")] - public MixDatabaseDatas.FormViewModel AttributeData { get; set; } - - #endregion Views - - #region overrides - - public override MixDatabaseDataAssociation ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Status = Status == default ? Enum.Parse(MixService.GetConfig( - MixAppSettingKeywords.DefaultContentStatus)) : Status; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getData = MixDatabaseDatas.FormViewModel.Repository.GetSingleModel(p => p.Id == DataId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getData.IsSucceed) - { - AttributeData = getData.Data; - } - MixDatabaseName = _context.MixDatabase.FirstOrDefault(m => m.Id == MixDatabaseId)?.Name; - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - if (AttributeData != null && string.IsNullOrEmpty(AttributeData.Id)) - { - var saveData = await AttributeData.SaveModelAsync(true, context, transaction); - if (!saveData.IsSucceed) - { - result.IsSucceed = false; - result.Errors = saveData.Errors; - result.Exception = saveData.Exception; - } - else - { - DataId = saveData.Data.Id; - } - } - else - { - DataId = AttributeData.Id; - } - if (result.IsSucceed) - { - result = await base.SaveModelAsync(true, context, transaction); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - context.Dispose(); - } - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/Helper.cs deleted file mode 100644 index 17dacaf55..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/Helper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class Helper - { - public static async Task>> RemoveRelatedDataAsync( - string parentId, MixDatabaseParentType parentType, string specificulture - , MixCmsContext context, IDbContextTransaction transaction) - { - var result = await MixDatabaseDataAssociations.DeleteViewModel.Repository.RemoveListModelAsync( - true - , a => a.ParentId == parentId && a.ParentType == parentType - && a.Specificulture == specificulture - , context, transaction); - - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ImportViewModel.cs deleted file mode 100644 index 68fe6e196..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ImportViewModel.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("isProcessed")] - public bool IsProcessed { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //var getPost = MixDatabaseDatas.ReadViewModel.Repository.GetSingleModel( - // m => m.Id == Id && m.Specificulture == Specificulture - // , _context: _context, _transaction: _transaction); - //if (getPost.IsSucceed) - //{ - // this.RelatedAttributeData = getPost.Data; - //} - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/NavigationViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/NavigationViewModel.cs deleted file mode 100644 index 94257c882..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/NavigationViewModel.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class NavigationViewModel - : ViewModelBase - { - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("parentName")] - public string ParentName { get; set; } - - [JsonProperty("data")] - public MixDatabaseDatas.NavigationViewModel Data { get; set; } - - #endregion Views - - public NavigationViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public NavigationViewModel() : base() - { - } - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getData = MixDatabaseDatas.NavigationViewModel.Repository.GetSingleModel(p => p.Id == DataId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getData.IsSucceed) - { - Data = getData.Data; - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadMvcViewModel.cs deleted file mode 100644 index 0c648fa62..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadMvcViewModel.cs +++ /dev/null @@ -1,107 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("data")] - public MixDatabaseDatas.ReadMvcViewModel Data { get; set; } - - #endregion Views - - public ReadMvcViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadMvcViewModel() : base() - { - } - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - // Should not get Data from cache (if Data == null) because of multilevel data, - // already handle cached data in attribute set data - var getData = MixDatabaseDatas.ReadMvcViewModel.Repository.GetFirstModel(p => p.Id == DataId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getData.IsSucceed) - { - Data = getData.Data; - } - else - { - Data = new MixDatabaseDatas.ReadMvcViewModel(); - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadViewModel.cs deleted file mode 100644 index 15da483ca..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/ReadViewModel.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - //[JsonProperty("isActived")] - //public bool IsActived { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //var getPost = MixDatabaseDatas.ReadViewModel.Repository.GetSingleModel( - // m => m.Id == Id && m.Specificulture == Specificulture - // , _context: _context, _transaction: _transaction); - //if (getPost.IsSucceed) - //{ - // this.RelatedAttributeData = getPost.Data; - //} - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/UpdateViewModel.cs deleted file mode 100644 index 2adf0ce50..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataAssociations/UpdateViewModel.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataAssociations -{ - public class UpdateViewModel - : ViewModelBase - { - public UpdateViewModel(MixDatabaseDataAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public UpdateViewModel() : base() - { - } - - #region Model - - /* - * Attribute Set Data Id - */ - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - /* - * Parent Id: PostId / PageId / Module Id / Data Id / Attr Set Id - */ - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("parentName")] - public string ParentName { get; set; } - - [JsonProperty("data")] - public MixDatabaseDatas.UpdateViewModel Data { get; set; } - - #endregion Views - - #region overrides - - public override MixDatabaseDataAssociation ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Status = Status == default ? Enum.Parse(MixService.GetConfig( - MixAppSettingKeywords.DefaultContentStatus)) : Status; - } - - var getData = MixDatabaseDatas.UpdateViewModel.Repository.GetSingleModel(p => p.Id == DataId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getData.IsSucceed) - { - Data = getData.Data; - } - MixDatabaseName = _context.MixDatabase.FirstOrDefault(m => m.Id == MixDatabaseId)?.Name; - } - - //public override List GenerateRelatedData(MixCmsContext context, IDbContextTransaction transaction) - //{ - // var tasks = new List(); - // tasks.Add(Task.Factory.StartNew(() => - // { - // Data.GenerateCache(Data.Model, Data); - // })); - // return tasks; - //} - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/DeleteViewModel.cs deleted file mode 100644 index 8963cea5c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/DeleteViewModel.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public int DataType { get; set; } - - [JsonProperty("status")] - public string Status { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - IsCache = false; - } - - public DeleteViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - IsCache = false; - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/Helper.cs deleted file mode 100644 index f6875c758..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/Helper.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public static class Helper - { - public static async Task>> FilterByOtherValueAsync( - string culture, string mixDatabaseName - , string filterType, Dictionary queries - , string responseName - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - Expression> valPredicate = m => m.MixDatabaseName == mixDatabaseName; - RepositoryResponse> result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new List() - }; - foreach (var fieldQuery in queries) - { - Expression> pre = GetValueFilter(filterType, fieldQuery.Key, fieldQuery.Value); - valPredicate = valPredicate.AndAlso(pre); - } - var query = context.MixDatabaseDataValue.Where(valPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - if (query != null) - { - Expression> predicate = - m => dataIds.Any(id => m.DataId == id) && - m.MixDatabaseColumnName == responseName; - result = await DefaultRepository.Instance.GetModelListByAsync( - predicate, context, transaction); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private static Expression> GetValueFilter(string filterType, string key, string value) - { - switch (filterType) - { - case "equal": - return m => m.MixDatabaseColumnName == key - && (EF.Functions.Like(m.StringValue, $"{value}")); - - case "contain": - return m => m.MixDatabaseColumnName == key && - (EF.Functions.Like(m.StringValue, $"%{value}%")); - } - return null; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ImportViewModel.cs deleted file mode 100644 index 0e871405f..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ImportViewModel.cs +++ /dev/null @@ -1,228 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Linq; -using System.Text.RegularExpressions; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("field")] - public Mix.Cms.Lib.ViewModels.MixDatabaseColumns.UpdateViewModel Field { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - //IsCache = false; - } - - public ImportViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - //IsCache = false; - } - - #endregion Contructors - - #region Overrides - - public override MixDatabaseDataValue ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - Priority = Field?.Priority ?? Priority; - DataType = Field?.DataType ?? DataType; - - MixDatabaseColumnName = Field?.Name; - MixDatabaseColumnId = Field?.Id ?? 0; - if (string.IsNullOrEmpty(StringValue) && !string.IsNullOrEmpty(Field?.DefaultValue)) - { - ParseDefaultValue(Field.DefaultValue); - } - return base.ParseModel(_context, _transaction); - } - - private void ParseDefaultValue(string defaultValue) - { - StringValue = defaultValue; - switch (DataType) - { - case MixDataType.DateTime: - break; - - case MixDataType.Date: - break; - - case MixDataType.Time: - break; - - case MixDataType.Double: - double.TryParse(defaultValue, out double doubleValue); - DoubleValue = DoubleValue; - break; - - case MixDataType.Boolean: - bool.TryParse(defaultValue, out bool boolValue); - BooleanValue = boolValue; - break; - - case MixDataType.Integer: - int.TryParse(defaultValue, out int intValue); - IntegerValue = intValue; - break; - } - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (MixDatabaseColumnId > 0) - { - Field = Lib.ViewModels.MixDatabaseColumns.UpdateViewModel.Repository.GetSingleModel(f => f.Id == MixDatabaseColumnId).Data; - if (Field != null && DataType == MixDataType.Reference) - { - MixDatabaseName = _context.MixDatabase.FirstOrDefault(m => m.Id == Field.ReferenceId)?.Name; - } - } - else // additional field for page / post / module => id = 0 - { - Field = new Lib.ViewModels.MixDatabaseColumns.UpdateViewModel() - { - DataType = DataType, - Id = MixDatabaseColumnId, - Title = MixDatabaseColumnName, - Name = MixDatabaseColumnName, - Priority = Priority - }; - } - } - - #endregion Overrides - - #region Expands - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid && Field != null) - { - if (Field.IsUnique) - { - var exist = _context.MixDatabaseDataValue.Any(d => d.Specificulture == Specificulture - && EF.Functions.Like(d.StringValue, StringValue) && d.Id != Id && d.DataId != DataId); - if (exist) - { - IsValid = false; - Errors.Add($"{Field.Title} = {StringValue} is existed"); - } - } - if (Field.IsRequire) - { - if (string.IsNullOrEmpty(StringValue)) - { - IsValid = false; - Errors.Add($"{Field.Title} is required"); - } - } - if (!string.IsNullOrEmpty(Field.Regex)) - { - System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(Field.Regex, RegexOptions.IgnoreCase); - Match m = r.Match(StringValue); - if (!m.Success) - { - IsValid = false; - Errors.Add($"{Field.Title} is invalid"); - } - } - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/NavigationViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/NavigationViewModel.cs deleted file mode 100644 index c75040a6d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/NavigationViewModel.cs +++ /dev/null @@ -1,170 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class NavigationViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("field")] - public MixDatabaseColumns.ReadViewModel Field { get; set; } - - [JsonProperty("dataNavs")] - public List DataNavs { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public NavigationViewModel() : base() - { - //IsCache = false; - //Repository.IsCache = false; - } - - public NavigationViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - //IsCache = false; - //Repository.IsCache = false; - } - - #endregion Contructors - - #region Override - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (DataType == MixDataType.Reference) - { - DataNavs = MixDatabaseDataAssociations.NavigationViewModel.Repository.GetModelListBy(d => - d.ParentId == DataId && d.ParentType == MixDatabaseParentType.Set && d.Specificulture == Specificulture - , _context, _transaction).Data?.OrderBy(m => m.Priority).ToList(); - } - Field = MixDatabaseColumns.ReadViewModel.Repository.GetSingleModel(f => f.Id == MixDatabaseColumnId, _context, _transaction).Data; - } - - public override MixDatabaseDataValue ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - Priority = Field.Priority; - DataType = Field.DataType; - - return base.ParseModel(_context, _transaction); - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (Field.IsUnique) - { - var exist = _context.MixDatabaseDataValue.Any(d => d.Specificulture == Specificulture - && EF.Functions.Like(d.StringValue, StringValue) && d.Id != Id && d.DataId != DataId); - if (exist) - { - IsValid = false; - Errors.Add($"{Field.Title} = {StringValue} is existed"); - } - } - if (Field.IsRequire) - { - if (string.IsNullOrEmpty(StringValue)) - { - IsValid = false; - Errors.Add($"{Field.Title} is required"); - } - } - } - } - - #endregion Override - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadMvcViewModel.cs deleted file mode 100644 index b63907cde..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadMvcViewModel.cs +++ /dev/null @@ -1,122 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - //[JsonProperty("dataNavs")] - //public List DataNavs { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - IsCache = false; - } - - public ReadMvcViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - IsCache = false; - } - - #endregion Contructors - - #region Override - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //if (DataType == MixDataType.Reference) - //{ - // DataNavs = MixRelatedAttributeDatas.ReadMvcViewModel.Repository.GetModelListBy(d => - // d.DataId == DataId && d.Specificulture == Specificulture, - // _context, _transaction).Data; - //} - } - - #endregion Override - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadViewModel.cs deleted file mode 100644 index a9ce55ba7..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/ReadViewModel.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("field")] - public MixDatabaseColumns.ReadViewModel Field { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - IsCache = false; - } - - public ReadViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - IsCache = false; - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/UpdateViewModel.cs deleted file mode 100644 index 6a7fc47cc..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDataValues/UpdateViewModel.cs +++ /dev/null @@ -1,243 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Linq; -using System.Text.RegularExpressions; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDataValues -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mixDatabaseColumnId")] - public int MixDatabaseColumnId { get; set; } - - [JsonProperty("regex")] - public string Regex { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("mixDatabaseColumnName")] - public string MixDatabaseColumnName { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("booleanValue")] - public bool? BooleanValue { get; set; } - - [JsonProperty("dataId")] - public string DataId { get; set; } - - [JsonProperty("dateTimeValue")] - public DateTime? DateTimeValue { get; set; } - - [JsonProperty("doubleValue")] - public double? DoubleValue { get; set; } - - [JsonProperty("integerValue")] - public int? IntegerValue { get; set; } - - [JsonProperty("stringValue")] - public string StringValue { get; set; } - - [JsonProperty("encryptValue")] - public string EncryptValue { get; set; } - - [JsonProperty("encryptKey")] - public string EncryptKey { get; set; } - - [JsonProperty("encryptType")] - public int EncryptType { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("field")] - public MixDatabaseColumns.UpdateViewModel Field { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - //IsCache = false; - } - - public UpdateViewModel(MixDatabaseDataValue model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - //IsCache = false; - } - - #endregion Contructors - - #region Overrides - - public override MixDatabaseDataValue ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - Priority = Field?.Priority ?? Priority; - DataType = Field?.DataType ?? DataType; - - MixDatabaseColumnName = Field?.Name; - MixDatabaseColumnId = Field?.Id ?? 0; - if (string.IsNullOrEmpty(StringValue) && !string.IsNullOrEmpty(Field?.DefaultValue)) - { - ParseDefaultValue(Field.DefaultValue); - } - return base.ParseModel(_context, _transaction); - } - - private void ParseDefaultValue(string defaultValue) - { - StringValue = defaultValue; - switch (DataType) - { - case MixDataType.DateTime: - break; - - case MixDataType.Date: - break; - - case MixDataType.Time: - break; - - case MixDataType.Double: - double.TryParse(defaultValue, out double doubleValue); - DoubleValue = DoubleValue; - break; - - case MixDataType.Boolean: - bool.TryParse(defaultValue, out bool boolValue); - BooleanValue = boolValue; - break; - - case MixDataType.Integer: - int.TryParse(defaultValue, out int intValue); - IntegerValue = intValue; - break; - } - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Status = Status == default ? Enum.Parse(MixService.GetConfig - (MixAppSettingKeywords.DefaultContentStatus)) : Status; - } - - if (MixDatabaseColumnId > 0) - { - Field ??= MixDatabaseColumns.UpdateViewModel.Repository.GetSingleModel( - f => f.Id == MixDatabaseColumnId - , _context, _transaction).Data; - if (Field != null && DataType == MixDataType.Reference) - { - MixDatabaseName = _context.MixDatabase.FirstOrDefault(m => m.Id == Field.ReferenceId)?.Name; - } - } - else // additional field for page / post / module => id = 0 - { - Field = new MixDatabaseColumns.UpdateViewModel() - { - DataType = DataType, - Title = MixDatabaseColumnName, - Name = MixDatabaseColumnName, - Priority = Priority - }; - } - - if (string.IsNullOrEmpty(Id) && Field != null) - { - ParseDefaultValue(Field.DefaultValue); - } - } - - #endregion Overrides - - #region Expands - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid && Field != null) - { - if (Field.IsUnique) - { - var exist = _context.MixDatabaseDataValue.Any(d => d.Specificulture == Specificulture - && d.MixDatabaseName == MixDatabaseName - && EF.Functions.Like(d.StringValue, StringValue) && d.Id != Id && d.DataId != DataId); - if (exist) - { - IsValid = false; - Errors.Add($"{Field.Title} = {StringValue} is existed"); - } - } - if (Field.IsRequire) - { - if (string.IsNullOrEmpty(StringValue)) - { - IsValid = false; - Errors.Add($"{Field.Title} is required"); - } - } - if (!string.IsNullOrEmpty(Field.Regex)) - { - System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(Field.Regex, RegexOptions.IgnoreCase); - Match m = r.Match(StringValue); - if (!m.Success) - { - IsValid = false; - Errors.Add($"{Field.Title} is invalid"); - } - } - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/AdditionalViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/AdditionalViewModel.cs deleted file mode 100644 index 863374ddb..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/AdditionalViewModel.cs +++ /dev/null @@ -1,471 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class AdditionalViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl - { - get => !string.IsNullOrEmpty(Id) && HasValue("seo_url") - ? $"/data/{Specificulture}/{MixDatabaseName}/{Property("seo_url")}" - : null; - } - - [JsonProperty("obj")] - public JObject Obj { get; set; } - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - [JsonIgnore] - public List Values { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonIgnore] - public List RefData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public AdditionalViewModel() : base() - { - } - - public AdditionalViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var database = MixDatabases.UpdateViewModel.Repository.GetSingleModel(m => m.Id == MixDatabaseId, _context, _transaction); - Fields = database.Data.Fields; - if (Obj == null) - { - var getValues = MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction); - var values = getValues.Data.Select(v => v.Model); - Fields.AddRange( - getValues.Data - .Where(v => !Fields.Any(f => f.Id == v.Field.Id)) - .Select(v => v.Field) - .ToList()); - var properties = values.Select(m => m.ToJProperty(_context, _transaction)); - Obj = new JObject( - new JProperty("id", Id), - properties - ); - } - } - - public override MixDatabaseData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Priority = Repository.Count(m => m.MixDatabaseName == MixDatabaseName && m.Specificulture == Specificulture, _context, _transaction).Data + 1; - } - - if (string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = _context.MixDatabase.First(m => m.Id == MixDatabaseId)?.Name; - } - if (MixDatabaseId == 0) - { - MixDatabaseId = _context.MixDatabase.First(m => m.Name == MixDatabaseName)?.Id ?? 0; - } - Values = Values ?? MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction).Data.OrderBy(a => a.Priority).ToList(); - Fields = Fields ?? MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - StringValue = field.DefaultValue, - Priority = field.Priority, - Field = field - }; - Values.Add(val); - } - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - if (Obj[val.MixDatabaseColumnName] != null) - { - if (val.Field.DataType == MixDataType.Reference) - { - var arr = Obj[val.MixDatabaseColumnName].Value(); - if (arr != null) - { - foreach (JObject objData in arr) - { - string id = objData["id"]?.Value(); - // if have id => update data, else add new - if (!string.IsNullOrEmpty(id)) - { - var getData = Repository.GetSingleModel(m => m.Id == id && m.Specificulture == Specificulture, _context, _transaction); - if (getData.IsSucceed) - { - getData.Data.Obj = objData["obj"].Value(); - RefData.Add(getData.Data); - } - } - else - { - RefData.Add(new AdditionalViewModel() - { - Specificulture = Specificulture, - MixDatabaseId = field.ReferenceId.Value, - Obj = objData["obj"].Value() - }); - } - } - } - } - else - { - val.ToModelValue(Obj[val.MixDatabaseColumnName], _context, _transaction); - } - } - else - { - Obj.Add(val.Model.ToJProperty(_context, _transaction)); - } - } - - return base.ParseModel(_context, _transaction); ; - } - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var result = await base.SaveModelAsync(isSaveSubModels, context, transaction); - if (result.IsSucceed && !string.IsNullOrEmpty(ParentId)) - { - var getNav = MixDatabaseDataAssociations.UpdateViewModel.Repository.CheckIsExists( - m => m.DataId == Id && m.ParentId == ParentId && m.ParentType == ParentType && m.Specificulture == Specificulture - , context, transaction); - if (!getNav) - { - var nav = new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = Id, - Specificulture = Specificulture, - MixDatabaseId = MixDatabaseId, - MixDatabaseName = MixDatabaseName, - ParentType = ParentType, - ParentId = ParentId, - Status = MixContentStatus.Published - }; - var saveResult = await nav.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - } - } - } - if (result.IsSucceed) - { - Model.CleanCache(context); - Obj = Helper.ParseData(Id, Specificulture, context, transaction); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - context.Dispose(); - } - } - } - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - if (result.IsSucceed) - { - RepositoryResponse saveFields = await SaveFields(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveFields, ref result); - } - - if (result.IsSucceed) - { - RepositoryResponse saveValues = await SaveValues(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveValues, ref result); - } - // Save Ref Data - if (result.IsSucceed) - { - RepositoryResponse saveRefData = await SaveRefDataAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveRefData, ref result); - } - - //// Save Related Data - //if (result.IsSucceed) - //{ - // RepositoryResponse saveRelated = await SaveRelatedDataAsync(parent, _context, _transaction); - // ViewModelHelper.HandleResult(saveRelated, ref result); - //} - - return result; - } - - private async Task> SaveFields(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var field in Fields) - { - if (result.IsSucceed) - { - if (field.MixDatabaseName == "sys_additional_field") - { - // Add field to additional_field set - var saveField = await field.SaveModelAsync(false, context, transaction); - var val = Values.FirstOrDefault(m => m.MixDatabaseColumnName == field.Name); - ViewModelHelper.HandleResult(saveField, ref result); - if (result.IsSucceed) - { - val.MixDatabaseColumnId = saveField.Data.Id; - val.MixDatabaseName = saveField.Data.MixDatabaseName; - } - } - } - else - { - break; - } - } - return result; - } - - private async Task> SaveValues(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Values) - { - if (result.IsSucceed) - { - if (Fields.Any(f => f.Id == item.MixDatabaseColumnId)) - { - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - item.Priority = item.Field.Priority; - item.Status = MixContentStatus.Published; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var delResult = await item.RemoveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(delResult, ref result); - } - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRefDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in RefData) - { - if (result.IsSucceed) - { - item.Specificulture = Specificulture; - item.ParentId = parent.Id; - item.ParentType = MixDatabaseParentType.Set; - item.Status = MixContentStatus.Published; - var saveRef = await item.SaveModelAsync(true, context, transaction); - if (saveRef.IsSucceed) - { - RelatedData.Add(new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = saveRef.Data.Id, - ParentId = Id, - ParentType = MixDatabaseParentType.Set, - MixDatabaseId = saveRef.Data.MixDatabaseId, - MixDatabaseName = saveRef.Data.MixDatabaseName, - CreatedDateTime = DateTime.UtcNow, - Specificulture = Specificulture - }); - } - ViewModelHelper.HandleResult(saveRef, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRelatedDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - foreach (var item in RelatedData) - { - if (result.IsSucceed) - { - // Current data is child data - if (string.IsNullOrEmpty(item.Id)) - { - item.MixDatabaseId = parent.MixDatabaseId; - item.MixDatabaseName = parent.MixDatabaseName; - item.Id = parent.Id; - } - // Current data is parent data - else if (string.IsNullOrEmpty(item.ParentId)) - { - item.ParentId = parent.Id; - } - item.Priority = MixDatabaseDataAssociations.UpdateViewModel.Repository.Count( - m => m.ParentId == Id && m.Specificulture == Specificulture, context, transaction).Data + 1; - item.Specificulture = Specificulture; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expands - - public static async Task> SaveObjectAsync(JObject data, string mixDatabaseName) - { - var vm = new FormViewModel() - { - Id = data["id"]?.Value(), - Specificulture = data["specificulture"]?.Value(), - MixDatabaseName = mixDatabaseName, - Obj = data - }; - return await vm.SaveModelAsync(); - } - - public bool HasValue(string fieldName) - { - return Obj.Value(fieldName) != null; - } - - public T Property(string fieldName) - { - if (Obj != null) - { - return Obj.Value(fieldName); - } - else - { - return default(T); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/DeleteViewModel.cs deleted file mode 100644 index 5c3146e89..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/DeleteViewModel.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override RepositoryResponse RemoveRelatedModels(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - // Remove values - var removeValues = MixDatabaseDataValues.DeleteViewModel.Repository.RemoveListModel(false, f => f.DataId == Id && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeValues, ref result); - - // remove related navs - if (result.IsSucceed) - { - var removeRelated = MixDatabaseDataAssociations.DeleteViewModel.Repository.RemoveListModel(true, d => (d.DataId == Id || d.ParentId == Id) && d.Specificulture == Specificulture); - ViewModelHelper.HandleResult(removeRelated, ref result); - } - - if (result.IsSucceed) - { - var removeChildFields = MixDatabaseDataValues.DeleteViewModel.Repository.RemoveListModel(false, f => (f.DataId == Id) && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeChildFields, ref result); - var removeChilds = MixDatabaseDatas.DeleteViewModel.Repository.RemoveListModel(false, f => (f.Id == Id) && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeChilds, ref result); - } - return result; - } - - public override async System.Threading.Tasks.Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - // Remove values - var removeFields = await MixDatabaseDataValues.DeleteViewModel.Repository.RemoveListModelAsync(false, f => f.DataId == Id && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeFields, ref result); - - // remove related navs - if (result.IsSucceed) - { - var removeRelated = await MixDatabaseDataAssociations.DeleteViewModel.Repository.RemoveListModelAsync - (true, d => (d.DataId == Id || d.ParentId == Id) && d.Specificulture == Specificulture - , _context, _transaction); - ViewModelHelper.HandleResult(removeRelated, ref result); - } - - if (result.IsSucceed) - { - var removeChildFields = await MixDatabaseDataValues.DeleteViewModel.Repository.RemoveListModelAsync( - false, f => (f.DataId == Id) && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeChildFields, ref result); - var removeChilds = await MixDatabaseDatas.DeleteViewModel.Repository.RemoveListModelAsync( - false, f => (f.Id == Id) && f.Specificulture == Specificulture, _context, _transaction); - ViewModelHelper.HandleResult(removeChilds, ref result); - } - return result; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ExportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ExportViewModel.cs deleted file mode 100644 index 875884add..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ExportViewModel.cs +++ /dev/null @@ -1,335 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class ExportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonIgnore] - public List Values { get; set; } - - [JsonIgnore] - public List Fields { get; set; } - - //[JsonIgnore] - public List RefData { get; set; } = new List(); - - [JsonProperty("data")] - public JObject Data { get; set; } - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public ExportViewModel() : base() - { - } - - public ExportViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getValues = MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction); - if (getValues.IsSucceed) - { - Values = getValues.Data.OrderBy(a => a.Priority).ToList(); - ParseData(); - } - } - - public override MixDatabaseData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Priority = Repository.Count(m => m.MixDatabaseName == MixDatabaseName && m.Specificulture == Specificulture, _context, _transaction).Data + 1; - } - Values = Values ?? MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction).Data.OrderBy(a => a.Priority).ToList(); - Fields = MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - if (string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = _context.MixDatabase.First(m => m.Id == MixDatabaseId)?.Name; - } - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - StringValue = field.DefaultValue, - Priority = field.Priority, - Field = field - }; - Values.Add(val); - } - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - if (Data[val.MixDatabaseColumnName] != null) - { - if (val.Field.DataType == MixDataType.Reference) - { - var arr = Data[val.MixDatabaseColumnName].Value(); - foreach (JObject objData in arr) - { - string id = objData["id"]?.Value(); - // if have id => update data, else add new - if (!string.IsNullOrEmpty(id)) - { - //var getData = Repository.GetSingleModel(m => m.Id == id && m.Specificulture == Specificulture, _context, _transaction); - //if (getData.IsSucceed) - //{ - // getData.Data.Data = objData; - // RefData.Add(getData.Data); - //} - } - else - { - RefData.Add(new UpdateViewModel() - { - Specificulture = Specificulture, - MixDatabaseId = field.ReferenceId.Value, - Data = objData - }); - } - } - } - else - { - ParseModelValue(Data[val.MixDatabaseColumnName], val); - } - } - else - { - Data.Add(ParseValue(val)); - } - } - - return base.ParseModel(_context, _transaction); ; - } - - #endregion Overrides - - #region Expands - - private JProperty ParseValue(MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.DataType) - { - case MixDataType.DateTime: - return new JProperty(item.MixDatabaseColumnName, item.DateTimeValue); - - case MixDataType.Date: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Time: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Double: - return (new JProperty(item.MixDatabaseColumnName, item.DoubleValue)); - - case MixDataType.Boolean: - return (new JProperty(item.MixDatabaseColumnName, item.BooleanValue)); - - case MixDataType.Integer: - return (new JProperty(item.MixDatabaseColumnName, item.IntegerValue)); - - case MixDataType.Reference: - //string url = $"/api/v1/odata/en-us/related-attribute-set-data/mobile/parent/set/{Id}/{item.Field.ReferenceId}"; - return (new JProperty(item.MixDatabaseColumnName, new JArray())); - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Upload: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - return (new JProperty(item.MixDatabaseColumnName, item.StringValue)); - } - } - - private void ParseModelValue(JToken property, MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.Field.DataType) - { - case MixDataType.DateTime: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Date: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Time: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Double: - item.DoubleValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Boolean: - item.BooleanValue = property.Value(); - item.StringValue = property.Value().ToLower(); - break; - - case MixDataType.Integer: - item.IntegerValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Reference: - item.StringValue = property.Value(); - break; - - case MixDataType.Upload: - string mediaData = property.Value(); - if (mediaData.IsBase64()) - { - Lib.ViewModels.MixMedias.UpdateViewModel media = new Lib.ViewModels.MixMedias.UpdateViewModel() - { - Specificulture = Specificulture, - Status = MixContentStatus.Published, - MediaFile = new FileViewModel() - { - FileStream = mediaData, - Extension = ".png", - Filename = Guid.NewGuid().ToString(), - FileFolder = "Attributes" - } - }; - var saveMedia = media.SaveModel(true); - if (saveMedia.IsSucceed) - { - item.StringValue = saveMedia.Data.FullPath; - } - } - else - { - item.StringValue = mediaData; - } - break; - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - item.StringValue = property.Value(); - break; - } - } - - private void ParseData() - { - Data = new JObject(); - foreach (var item in Values.OrderBy(v => v.Priority)) - { - item.MixDatabaseColumnName = item.Field.Name; - Data.Add(ParseValue(item)); - } - Data.Add(new JProperty("createdDateTime", CreatedDateTime)); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/FormViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/FormViewModel.cs deleted file mode 100644 index 7218f8127..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/FormViewModel.cs +++ /dev/null @@ -1,435 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class FormViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl - { - get => !string.IsNullOrEmpty(Id) && HasValue("seo_url") - ? $"/data/{Specificulture}/{MixDatabaseName}/{Property("seo_url")}" - : null; - } - - [JsonProperty("obj")] - public JObject Obj { get; set; } - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - [JsonIgnore] - public List Values { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonIgnore] - public List RefData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public FormViewModel() : base() - { - } - - public FormViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Obj == null) - { - Obj = Helper.ParseData(Id, Specificulture, _context, _transaction); - } - } - - public override MixDatabaseData ParseModel( - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Priority = Repository.Count(m => m.MixDatabaseName == MixDatabaseName && m.Specificulture == Specificulture, _context, _transaction).Data + 1; - } - - if (string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = _context.MixDatabase.First(m => m.Id == MixDatabaseId)?.Name; - } - if (MixDatabaseId == 0) - { - MixDatabaseId = _context.MixDatabase.First(m => m.Name == MixDatabaseName)?.Id ?? 0; - } - Values ??= MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture - , _context, _transaction) - .Data.OrderBy(a => a.Priority).ToList(); - Fields ??= MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId - , _context, _transaction).Data; - - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.UpdateViewModel() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - StringValue = field.DefaultValue, - Priority = field.Priority, - Field = field, - DataId = Id - }; - val.ExpandView(_context, _transaction); - Values.Add(val); - } - else - { - val.LastModified = DateTime.UtcNow; - } - val.Status = Status; - val.Specificulture = Specificulture; - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - if (Obj[val.MixDatabaseColumnName] != null) - { - if (val.Field.DataType == MixDataType.Reference) - { - var arr = Obj[val.MixDatabaseColumnName].Value(); - val.IntegerValue = val.Field.ReferenceId; - val.StringValue = val.Field.ReferenceId.ToString(); - if (arr != null) - { - foreach (JObject objData in arr) - { - string id = objData["id"]?.Value(); - // if have id => update data, else add new - if (!string.IsNullOrEmpty(id)) - { - var getData = Repository.GetSingleModel(m => m.Id == id && m.Specificulture == Specificulture, _context, _transaction); - if (getData.IsSucceed) - { - getData.Data.Obj = objData["obj"].Value(); - RefData.Add(getData.Data); - } - } - else - { - RefData.Add(new FormViewModel() - { - Specificulture = Specificulture, - MixDatabaseId = field.ReferenceId.Value, - Obj = objData["obj"].Value() - }); - } - } - } - } - else - { - val.ToModelValue(Obj[val.MixDatabaseColumnName], _context, _transaction); - } - } - } - - // Save Edm html - //var getAttrSet = Mix.Cms.Lib.ViewModels.MixDatabases.ReadViewModel.Repository.GetSingleModel(m => m.Name == MixDatabaseName, _context, _transaction); - //var getEdm = Lib.ViewModels.MixTemplates.UpdateViewModel.GetTemplateByPath(getAttrSet.Data.EdmTemplate, Specificulture, _context, _transaction); - //var edmField = Values.FirstOrDefault(f => f.MixDatabaseColumnName == "edm"); - //if (edmField != null && getEdm.IsSucceed && !string.IsNullOrEmpty(getEdm.Data.Content)) - //{ - // string body = getEdm.Data.Content; - // foreach (var prop in Obj.Properties()) - // { - // body = body.Replace($"[[{prop.Name}]]", Obj[prop.Name].Value()); - // } - // var edmFile = new FileViewModel() - // { - // Content = body, - // Extension = MixFileExtensions.Html, - // FileFolder = MixTemplateFolders.Edms, - // Filename = $"{getAttrSet.Data.EdmSubject}-{Id}" - // }; - // if (MixFileRepository.Instance.SaveWebFile(edmFile)) - // { - // Obj["edm"] = edmFile.WebPath; - // edmField.StringValue = edmFile.WebPath; - // } - //} - //End save edm - - return base.ParseModel(_context, _transaction); ; - } - - #region Async - - public override async Task> SaveModelAsync( - bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var result = await base.SaveModelAsync(isSaveSubModels, context, transaction); - if (result.IsSucceed && !string.IsNullOrEmpty(ParentId)) - { - var getNav = MixDatabaseDataAssociations.UpdateViewModel.Repository.CheckIsExists( - m => m.DataId == Id && m.ParentId == ParentId && m.ParentType == ParentType && m.Specificulture == Specificulture - , context, transaction); - if (!getNav) - { - var nav = new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = Id, - Specificulture = Specificulture, - MixDatabaseId = MixDatabaseId, - MixDatabaseName = MixDatabaseName, - ParentType = ParentType, - ParentId = ParentId, - Status = MixContentStatus.Published - }; - var saveResult = await nav.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - } - } - } - if (result.IsSucceed) - { - Model.CleanCache(context); - Obj = Helper.ParseData(Id, Specificulture, context, transaction); - } - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - } - } - - public override RepositoryResponse SaveModel(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.SaveModel(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - Obj = Helper.ParseData(Id, Specificulture, _context, _transaction); - } - return result; - } - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - if (result.IsSucceed) - { - RepositoryResponse saveValues = await SaveValues(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveValues, ref result); - } - // Save Ref Data - if (result.IsSucceed) - { - RepositoryResponse saveRefData = await SaveRefDataAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveRefData, ref result); - } - - //// Save Related Data - //if (result.IsSucceed) - //{ - // RepositoryResponse saveRelated = await SaveRelatedDataAsync(parent, _context, _transaction); - // ViewModelHelper.HandleResult(saveRelated, ref result); - //} - - return result; - } - - private async Task> SaveValues(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Values) - { - if (result.IsSucceed) - { - if (Fields.Any(f => f.Id == item.MixDatabaseColumnId)) - { - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - item.Priority = item.Field.Priority; - item.Status = MixContentStatus.Published; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var delResult = await item.RemoveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(delResult, ref result); - } - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRefDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in RefData) - { - if (result.IsSucceed) - { - item.Specificulture = Specificulture; - item.ParentId = parent.Id; - item.ParentType = MixDatabaseParentType.Set; - item.Status = MixContentStatus.Published; - var saveRef = await item.SaveModelAsync(true, context, transaction); - if (saveRef.IsSucceed) - { - RelatedData.Add(new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = saveRef.Data.Id, - ParentId = Id, - ParentType = MixDatabaseParentType.Set, - MixDatabaseId = saveRef.Data.MixDatabaseId, - MixDatabaseName = saveRef.Data.MixDatabaseName, - CreatedDateTime = DateTime.UtcNow, - Specificulture = Specificulture - }); - } - ViewModelHelper.HandleResult(saveRef, ref result); - } - else - { - break; - } - } - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expands - - public static async Task> SaveObjectAsync(JObject data, string mixDatabaseName) - { - var vm = new FormViewModel() - { - Id = data["id"]?.Value(), - Specificulture = data["specificulture"]?.Value(), - MixDatabaseName = mixDatabaseName, - Obj = data - }; - return await vm.SaveModelAsync(); - } - - public bool HasValue(string fieldName) - { - return Obj != null && Obj.Value(fieldName) != null; - } - - public T Property(string fieldName) - { - if (Obj != null) - { - return Obj.Value(fieldName); - } - else - { - return default; - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/Helper.cs deleted file mode 100644 index 232ebd71d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/Helper.cs +++ /dev/null @@ -1,685 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json.Linq; -using OfficeOpenXml; -using OfficeOpenXml.Table; -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public static class Helper - { - public static async Task> ImportData( - string culture, Lib.ViewModels.MixDatabases.ReadViewModel mixDatabase, IFormFile file) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(null, null, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - List data = LoadFileData(culture, mixDatabase, file); - - var fields = MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == mixDatabase.Id, context, transaction).Data; - foreach (var item in data) - { - if (result.IsSucceed) - { - var isCreateNew = string.IsNullOrEmpty(item.Id); - item.Fields = fields; - item.MixDatabaseName = mixDatabase.Name; - item.Status = MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus); - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task> GetAdditionalData( - MixDatabaseParentType parentType, string parentId, - HttpRequest request, string culture = null, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - // Additional Data is sub data of page / post / module only - culture = culture ?? MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - var databaseName = request.Query["databaseName"].ToString(); - - return await LoadAdditionalDataAsync(parentType, parentId, databaseName, culture, context, transaction); - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task> LoadAdditionalDataAsync( - MixDatabaseParentType parentType, - string parentId, - string databaseName, - string culture = null, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var dataId = (await context.MixDatabaseDataAssociation.FirstOrDefaultAsync( - m => m.MixDatabaseName == databaseName && m.ParentType == parentType && m.ParentId == parentId && m.Specificulture == culture))?.DataId; - if (!string.IsNullOrEmpty(dataId)) - { - return await AdditionalViewModel.Repository.GetFirstModelAsync( - m => m.Id == dataId && m.Specificulture == culture - , context, transaction); - } - else - { - // Init default data - var getAttrSet = await Lib.ViewModels.MixDatabases.UpdateViewModel.Repository.GetSingleModelAsync( - m => m.Name == databaseName - , context, transaction); - if (getAttrSet.IsSucceed) - { - AdditionalViewModel result = new AdditionalViewModel() - { - Specificulture = culture, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Status = MixContentStatus.Published, - Fields = getAttrSet.Data.Fields, - ParentType = parentType, - ParentId = parentId - }; - result.ExpandView(context, transaction); - return new RepositoryResponse() - { - IsSucceed = true, - Data = result - }; - } - return new RepositoryResponse(); - } - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static RepositoryResponse LoadAdditionalData( - MixDatabaseParentType parentType, - string parentId, - string databaseName, - string culture = null, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var dataId = context.MixDatabaseDataAssociation.FirstOrDefault( - m => m.MixDatabaseName == databaseName && m.ParentType == parentType && m.ParentId == parentId && m.Specificulture == culture)?.DataId; - if (!string.IsNullOrEmpty(dataId)) - { - return AdditionalViewModel.Repository.GetSingleModel( - m => m.Id == dataId && m.Specificulture == culture - , context, transaction); - } - else - { - // Init default data - var getAttrSet = MixDatabases.UpdateViewModel.Repository.GetSingleModel( - m => m.Name == databaseName - , context, transaction); - if (getAttrSet.IsSucceed) - { - AdditionalViewModel result = new AdditionalViewModel() - { - Specificulture = culture, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Status = MixContentStatus.Published, - Fields = getAttrSet.Data.Fields, - ParentType = parentType, - ParentId = parentId - }; - result.ExpandView(context, transaction); - return new RepositoryResponse() - { - IsSucceed = true, - Data = result - }; - } - return new RepositoryResponse(); - } - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private static List LoadFileData( - string culture, Lib.ViewModels.MixDatabases.ReadViewModel mixDatabase, IFormFile file) - { - //create a list to hold all the values - List excelData = new List(); - - //create a new Excel package in a memorystream - using (var stream = file.OpenReadStream()) - using (ExcelPackage excelPackage = new ExcelPackage(stream)) - { - //loop all worksheets - foreach (ExcelWorksheet worksheet in excelPackage.Workbook.Worksheets) - { - // First row is supose to be headers (list field name) => start from row 2 - int startRow = 2;//worksheet.Dimension.Start.Row - //loop all rows - for (int i = startRow; i <= worksheet.Dimension.End.Row; i++) - { - JObject obj = new JObject(); - //loop all columns in a row - for (int j = worksheet.Dimension.Start.Column; j <= worksheet.Dimension.End.Column; j++) - { - obj.Add(new JProperty(worksheet.Cells[1, j].Value.ToString(), worksheet.Cells[i, j].Value)); - } - ImportViewModel data = new ImportViewModel() - { - Id = obj["id"]?.ToString(), - MixDatabaseId = mixDatabase.Id, - MixDatabaseName = mixDatabase.Name, - Specificulture = culture, - Obj = obj - }; - excelData.Add(data); - } - } - return excelData; - } - } - - public static async Task>> FilterByKeywordAsync(string culture, string mixDatabaseName - , RequestPaging request, string keyword - , Dictionary queryDictionary = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - Expression> attrPredicate = - m => m.Specificulture == culture && m.MixDatabaseName == mixDatabaseName - && (!request.FromDate.HasValue - || (m.CreatedDateTime >= request.FromDate.Value) - ) - && (!request.ToDate.HasValue - || (m.CreatedDateTime <= request.ToDate.Value) - ) - ; - Expression> valPredicate = null; - RepositoryResponse> result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - }; - var filterType = queryDictionary.FirstOrDefault(q => q.Key == "filterType"); - var tasks = new List>>(); - if (queryDictionary != null) - { - foreach (var q in queryDictionary) - { - if (!string.IsNullOrEmpty(q.Key) && q.Key != "mixDatabaseId" && q.Key != "mixDatabaseName" && q.Key != "filterType" && !string.IsNullOrEmpty(q.Value)) - { - if (!string.IsNullOrEmpty(filterType.Value) && filterType.Value == "equal") - { - Expression> pre = m => - m.MixDatabaseColumnName == q.Key && m.StringValue == (q.Value.ToString()); - valPredicate = valPredicate == null - ? pre - : valPredicate = valPredicate.AndAlso(pre); - } - else - { - Expression> pre = - m => m.MixDatabaseColumnName == q.Key && - (EF.Functions.Like(m.StringValue, $"%{q.Value}%")); - valPredicate = valPredicate == null - ? pre - : valPredicate = valPredicate.AndAlso(pre); - } - } - } - if (valPredicate != null) - { - attrPredicate = valPredicate.AndAlso(attrPredicate); - } - } - // Loop queries string => predicate - if (!string.IsNullOrEmpty(keyword)) - { - Expression> pre = m => m.MixDatabaseName == mixDatabaseName && m.Specificulture == culture && m.StringValue.Contains(keyword); - attrPredicate = attrPredicate.AndAlso(pre); - } - - var query = context.MixDatabaseDataValue.Where(attrPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - if (query != null) - { - Expression> predicate = m => dataIds.Any(id => m.Id == id); - result = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null, context, transaction); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> FilterByKeywordAsync(HttpRequest request, string culture = null, string mixDatabaseName = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var queryDictionary = request.Query.ToList(); - mixDatabaseName = mixDatabaseName ?? request.Query["mixDatabaseName"].ToString().Trim(); - var keyword = request.Query["keyword"].ToString(); - var filterType = request.Query["filterType"].ToString(); - var orderBy = request.Query["orderBy"].ToString(); - int.TryParse(request.Query["mixDatabaseId"], out int mixDatabaseId); - bool isDirection = Enum.TryParse(request.Query["direction"], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - int.TryParse(request.Query["pageIndex"], out int pageIndex); - var isPageSize = int.TryParse(request.Query["pageSize"], out int pageSize); - bool isFromDate = DateTime.TryParse(request.Query["fromDate"], out DateTime fromDate); - bool isToDate = DateTime.TryParse(request.Query["toDate"], out DateTime toDate); - bool isStatus = Enum.TryParse(request.Query["status"], out MixContentStatus status); - var tasks = new List>>(); - var getfields = await MixDatabaseColumns.ReadViewModel.Repository.GetModelListByAsync( - m => m.MixDatabaseId == mixDatabaseId || m.MixDatabaseName == mixDatabaseName, context, transaction); - var fields = getfields.IsSucceed ? getfields.Data : new List(); - var fieldQueries = !string.IsNullOrEmpty(request.Query["query"]) ? JObject.Parse(request.Query["query"]) : new JObject(); - - // Data predicate - Expression> predicate = m => m.Specificulture == culture - && (m.MixDatabaseName == mixDatabaseName); - - // val predicate - Expression> attrPredicate = m => m.Specificulture == culture - && (m.MixDatabaseName == mixDatabaseName); - - RepositoryResponse> result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - }; - - // if filter by field name or keyword => filter by attr value - if (fieldQueries.Count > 0 || !string.IsNullOrEmpty(keyword)) - { - // filter by all fields if have keyword - if (!string.IsNullOrEmpty(keyword)) - { - Expression> pre = null; - foreach (var field in fields) - { - Expression> keywordPredicate = m => m.MixDatabaseColumnName == field.Name; - keywordPredicate = keywordPredicate.AndAlsoIf(filterType == "equal", m => m.StringValue == keyword); - keywordPredicate = keywordPredicate.AndAlsoIf(filterType == "contain", m => EF.Functions.Like(m.StringValue, $"%{keyword}%")); - - pre = pre == null - ? keywordPredicate - : pre.Or(keywordPredicate); - } - attrPredicate = attrPredicate.AndAlsoIf(pre != null, pre); - } - - if (fieldQueries != null && fieldQueries.Properties().Count() > 0) // filter by specific field name - { - var valPredicate = GetFilterValueByFields(fields, fieldQueries, filterType); - attrPredicate = attrPredicate.AndAlsoIf(valPredicate != null, valPredicate); - } - - var query = context.MixDatabaseDataValue.Where(attrPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - - predicate = predicate.AndAlsoIf(query != null, m => dataIds.Any(id => m.Id == id)); - } - else - { - predicate = m => m.Specificulture == culture - && (m.MixDatabaseId == mixDatabaseId || m.MixDatabaseName == mixDatabaseName) - && (!isStatus || (m.Status == status)) - && (!isFromDate || (m.CreatedDateTime >= fromDate)) - && (!isToDate || (m.CreatedDateTime <= toDate)); - } - result = await DefaultRepository.Instance.GetModelListByAsync( - predicate, orderBy, direction, isPageSize ? pageSize : default, isPageSize ? pageIndex : 0, null, null, context, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private static Expression> GetFilterValueByFields(List fields, JObject fieldQueries, string filterType) - { - Expression> valPredicate = null; - foreach (var q in fieldQueries) - { - if (fields.Any(f => f.Name == q.Key)) - { - string value = q.Value.ToString(); - if (!string.IsNullOrEmpty(value)) - { - Expression> pre = m => m.MixDatabaseColumnName == q.Key; - pre = pre.AndAlsoIf(filterType == "equal", m => m.StringValue == (q.Value.ToString())); - pre = pre.AndAlsoIf(filterType == "contain", m => EF.Functions.Like(m.StringValue, $"%{q.Value}%")); - - valPredicate = valPredicate == null - ? pre - : valPredicate.Or(pre); - } - } - } - return valPredicate; - } - - public static async Task>> FilterByKeywordAsync(string culture, string mixDatabaseName - , string filterType, string fieldName, string keyword - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - Expression> attrPredicate = m => m.Specificulture == culture && m.MixDatabaseName == mixDatabaseName; - Expression> valPredicate = null; - RepositoryResponse> result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new List() - }; - if (filterType == "equal") - { - Expression> pre = m => m.MixDatabaseColumnName == fieldName && EF.Functions.Like(m.StringValue, keyword); - - valPredicate = valPredicate == null - ? pre - : valPredicate = valPredicate.AndAlso(pre); - } - else - { - Expression> pre = m => m.MixDatabaseColumnName == fieldName && m.StringValue.Contains(keyword); - valPredicate = valPredicate == null - ? pre - : valPredicate = valPredicate.AndAlso(pre); - } - if (valPredicate != null) - { - attrPredicate = valPredicate.AndAlso(attrPredicate); - } - - var query = context.MixDatabaseDataValue.Where(attrPredicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - if (query != null) - { - Expression> predicate = m => m.Specificulture == culture && dataIds.Any(id => m.Id == id); - result = await DefaultRepository.Instance.GetModelListByAsync( - predicate, context, transaction); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetAttributeDataByParent( - string culture, string mixDatabaseName, - string parentId, MixDatabaseParentType parentType, - string orderBy, Heart.Enums.MixHeartEnums.DisplayDirection direction, - int? pageSize, int? pageIndex, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var tasks = new List>>(); - - Expression> predicate = m => m.Specificulture == culture - && (m.MixDatabaseName == mixDatabaseName) - && (m.Status == MixContentStatus.Published) - && (string.IsNullOrEmpty(parentId) - || (m.ParentId == parentId && m.ParentType == parentType) - ); - ; - var query = context.MixDatabaseDataAssociation.Where(predicate).Select(m => m.DataId).Distinct(); - var dataIds = query.ToList(); - Expression> pre = m => dataIds.Any(id => m.Id == id); - return await DefaultRepository.Instance.GetModelListByAsync( - pre, orderBy, direction, pageSize, pageIndex, null, null, context, transaction); - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static RepositoryResponse ExportAttributeToExcel(List lstData, string sheetName - , string folderPath, string fileName - , List headers = null) - { - var result = new RepositoryResponse() - { - Data = new FileViewModel() - { - FileFolder = folderPath, - Filename = fileName + "-" + DateTime.Now.ToString("yyyyMMdd"), - Extension = ".xlsx" - } - }; - try - { - if (lstData.Count > 0) - { - var filenameE = $"{ result.Data.Filename}{result.Data.Extension}"; - - // create new data table - var dtable = new DataTable(); - - if (headers == null) - { - // get first item - var listColumn = lstData[0].Properties(); - - // add column name to table - foreach (var item in listColumn) - { - dtable.Columns.Add(item.Name, typeof(string)); - } - } - else - { - foreach (var item in headers) - { - dtable.Columns.Add(item, typeof(string)); - } - } - - // Row value - foreach (var a in lstData) - { - var r = dtable.NewRow(); - foreach (var prop in a.Properties()) - { - bool isHaveValue = a.TryGetValue(prop.Name, out JToken val); - if (isHaveValue) - { - r[prop.Name] = val.ToString(); - } - } - dtable.Rows.Add(r); - } - - // Save Excel file - using (var pck = new ExcelPackage()) - { - string SheetName = sheetName != string.Empty ? sheetName : "Report"; - var wsDt = pck.Workbook.Worksheets.Add(SheetName); - wsDt.Cells["A1"].LoadFromDataTable(dtable, true, TableStyles.None); - wsDt.Cells[wsDt.Dimension.Address].AutoFitColumns(); - - CommonHelper.SaveFileBytes(folderPath, filenameE, pck.GetAsByteArray()); - result.IsSucceed = true; - - return result; - } - } - else - { - result.Errors.Add("Can not export data of empty list"); - return result; - } - } - catch (Exception ex) - { - result.Errors.Add(ex.Message); - return result; - } - } - - public static JObject ParseData(string dataId, string culture, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, - out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var values = context.MixDatabaseDataValue.Where( - m => m.DataId == dataId && m.Specificulture == culture - && !string.IsNullOrEmpty(m.MixDatabaseColumnName)); - var properties = values.Select(m => m.ToJProperty(_context, _transaction)); - var obj = new JObject( - new JProperty("id", dataId), - properties - ); - - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - - return obj; - } - - public static void CleanCache(this MixDatabaseData data, MixCmsContext context) - { - var tasks = new List(); - // Get Parent Ids - var relatedModels = context.MixDatabaseDataAssociation.Where( - p => p.DataId == data.Id && p.Specificulture == data.Specificulture) - .Select(m => new { navId = m.Id, parentId = m.ParentId }); - foreach (var model in relatedModels) - { - var parentKey = $"_{model.parentId}_{data.Specificulture}"; - var navKey = $"_{model.navId}_{data.Specificulture}"; - tasks.Add(MixCacheService.RemoveCacheAsync(typeof(MixDatabaseData), parentKey)); - tasks.Add(MixCacheService.RemoveCacheAsync(typeof(MixDatabaseDataAssociation), navKey)); - } - Task.WhenAll(tasks); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ImportViewModel.cs deleted file mode 100644 index 1a02a1f1b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ImportViewModel.cs +++ /dev/null @@ -1,403 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("obj")] - public JObject Obj { get; set; } - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - [JsonIgnore] - public List Values { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonIgnore] - public List RefData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Obj == null) - { - Obj = Helper.ParseData(Id, Specificulture, _context, _transaction); - } - } - - public override MixDatabaseData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Priority = Repository.Count(m => m.MixDatabaseName == MixDatabaseName && m.Specificulture == Specificulture, _context, _transaction).Data + 1; - } - - if (string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = _context.MixDatabase.First(m => m.Id == MixDatabaseId)?.Name; - } - if (MixDatabaseId == 0) - { - MixDatabaseId = _context.MixDatabase.First(m => m.Name == MixDatabaseName)?.Id ?? 0; - } - Values ??= MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture - , _context, _transaction) - .Data.OrderBy(a => a.Priority).ToList(); - - Fields ??= MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy( - f => f.MixDatabaseId == MixDatabaseId, - _context, _transaction).Data; - - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - StringValue = field.DefaultValue, - Priority = field.Priority, - Field = field - }; - Values.Add(val); - } - else - { - val.LastModified = DateTime.UtcNow; - } - val.CreatedBy = CreatedBy; - val.Status = Status; - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - if (Obj[val.MixDatabaseColumnName] != null) - { - if (val.Field.DataType == MixDataType.Reference) - { - var arr = Obj[val.MixDatabaseColumnName].Value(); - if (arr != null) - { - foreach (JObject objData in arr) - { - string id = objData["id"]?.Value(); - // if have id => update data, else add new - if (!string.IsNullOrEmpty(id)) - { - var getData = Repository.GetSingleModel( - m => m.Id == id && m.Specificulture == Specificulture, - _context, _transaction); - if (getData.IsSucceed) - { - getData.Data.Obj = objData["obj"].Value(); - RefData.Add(getData.Data); - } - } - else - { - RefData.Add(new ImportViewModel() - { - Specificulture = Specificulture, - MixDatabaseId = field.ReferenceId.Value, - Obj = objData["obj"].Value() - }); - } - } - } - } - else - { - val.ToModelValue(Obj[val.MixDatabaseColumnName], _context, _transaction); - } - } - else - { - Obj.Add(val.Model.ToJProperty(_context, _transaction)); - } - } - - return base.ParseModel(_context, _transaction); ; - } - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var result = await base.SaveModelAsync(isSaveSubModels, context, transaction); - if (result.IsSucceed && !string.IsNullOrEmpty(ParentId)) - { - var getNav = MixDatabaseDataAssociations.UpdateViewModel.Repository.CheckIsExists( - m => m.DataId == Id && m.ParentId == ParentId && m.ParentType == ParentType && m.Specificulture == Specificulture - , context, transaction); - if (!getNav) - { - var nav = new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = Id, - Specificulture = Specificulture, - MixDatabaseId = MixDatabaseId, - MixDatabaseName = MixDatabaseName, - ParentType = ParentType, - ParentId = ParentId, - Status = MixContentStatus.Published - }; - var saveResult = await nav.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - } - } - } - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - if (result.IsSucceed) - { - Obj = Helper.ParseData(Id, Specificulture, context, transaction); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - } - } - - public override RepositoryResponse SaveModel(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.SaveModel(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - Obj = Helper.ParseData(Id, Specificulture, _context, _transaction); - } - return result; - } - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - if (result.IsSucceed) - { - RepositoryResponse saveValues = await SaveValues(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveValues, ref result); - } - // Save Ref Data - if (result.IsSucceed) - { - RepositoryResponse saveRefData = await SaveRefDataAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveRefData, ref result); - } - - //// Save Related Data - //if (result.IsSucceed) - //{ - // RepositoryResponse saveRelated = await SaveRelatedDataAsync(parent, _context, _transaction); - // ViewModelHelper.HandleResult(saveRelated, ref result); - //} - - return result; - } - - private async Task> SaveValues(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Values) - { - if (result.IsSucceed) - { - if (Fields.Any(f => f.Id == item.MixDatabaseColumnId)) - { - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - item.Priority = item.Field.Priority; - item.Status = MixContentStatus.Published; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var delResult = await item.RemoveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(delResult, ref result); - } - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRefDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in RefData) - { - if (result.IsSucceed) - { - item.Specificulture = Specificulture; - item.ParentId = parent.Id; - item.ParentType = MixDatabaseParentType.Set; - item.Status = MixContentStatus.Published; - var saveRef = await item.SaveModelAsync(true, context, transaction); - if (saveRef.IsSucceed) - { - RelatedData.Add(new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = saveRef.Data.Id, - ParentId = Id, - ParentType = MixDatabaseParentType.Set, - MixDatabaseId = saveRef.Data.MixDatabaseId, - MixDatabaseName = saveRef.Data.MixDatabaseName, - CreatedDateTime = DateTime.UtcNow, - Specificulture = Specificulture - }); - } - ViewModelHelper.HandleResult(saveRef, ref result); - } - else - { - break; - } - } - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expands - - public static async Task> SaveObjectAsync(JObject data, string mixDatabaseName) - { - var vm = new ImportViewModel() - { - Id = data["id"]?.Value(), - Specificulture = data["specificulture"]?.Value(), - MixDatabaseName = mixDatabaseName, - Obj = data - }; - return await vm.SaveModelAsync(); - } - - public bool HasValue(string fieldName) - { - return Obj != null && Obj.Value(fieldName) != null; - } - - public T Property(string fieldName) - { - if (Obj != null) - { - return Obj.Value(fieldName); - } - else - { - return default; - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/NavigationViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/NavigationViewModel.cs deleted file mode 100644 index e3b221c6a..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/NavigationViewModel.cs +++ /dev/null @@ -1,158 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Models.Common; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class NavigationViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - public List Values { get; set; } - - public List Fields { get; set; } - - [JsonProperty("data")] - public JObject Obj { get; set; } - - [JsonProperty("nav")] - public MixNavigation Nav - { - get - { - if (MixDatabaseName == MixConstants.MixDatabaseName.NAVIGATION && Obj != null) - { - return Obj.ToObject(); - } - return null; - } - } - - #endregion Views - - #endregion Properties - - #region Contructors - - public NavigationViewModel() : base() - { - } - - public NavigationViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, - out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - if (Obj == null) - { - Obj = Helper.ParseData(Id, Specificulture, context, transaction); - } - - Obj.LoadAllReferenceData(Id, MixDatabaseId, Specificulture, context, transaction); - - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - } - - #region Async - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Values) - { - if (result.IsSucceed) - { - if (Fields.Any(f => f.Id == item.MixDatabaseColumnId)) - { - item.Priority = item.Field.Priority; - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var delResult = await item.RemoveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(delResult, ref result); - } - } - else - { - break; - } - } - } - - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadMvcViewModel.cs deleted file mode 100644 index 542c10188..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadMvcViewModel.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("values")] - public List Values { get; set; } - - [JsonProperty("obj")] - public JObject Obj { get; set; } - - [JsonProperty("previewUrl")] - public string PreviewUrl - { - get => !string.IsNullOrEmpty(Id) && HasValue("seo_url") - ? $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/data/{Specificulture}/{MixDatabaseName}/{Property("seo_url")}" - : null; - } - - [JsonProperty("detailApiUrl")] - public string DetailApiUrl - { - get => !string.IsNullOrEmpty(Id) - ? $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/api/v1/rest/{Specificulture}/attribute-set-data/mvc/{Id}" - : null; - } - - [JsonProperty("templatePath")] - public string TemplatePath { get => $"{MixCmsHelper.GetTemplateFolder(Specificulture)}/{Property("template_path")}"; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction( - _context, _transaction, - out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - - if (Obj == null) - { - Obj = Helper.ParseData(Id, Specificulture, context, transaction); - } - - Obj.LoadAllReferenceData(Id, MixDatabaseId, Specificulture, context, transaction); - - if (isRoot) - { - transaction.Dispose(); - context.Dispose(); - } - } - - public bool HasValue(string fieldName) - { - return Obj != null ? Obj.Value(fieldName) != null : false; - } - - public T Property(string fieldName) - { - return MixCmsHelper.Property(Obj, fieldName); - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadViewModel.cs deleted file mode 100644 index 0b6e0dfd3..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/ReadViewModel.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("values")] - public List Values { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getValues = MixDatabaseDataValues.ReadViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction); - if (getValues.IsSucceed) - { - Values = getValues.Data.OrderBy(a => a.Priority).ToList(); - } - else - { - Console.WriteLine(getValues.Exception); - } - - Fields = MixDatabaseColumns.ReadViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.ReadViewModel( - new MixDatabaseDataValue() { MixDatabaseColumnId = field.Id } - , _context, _transaction) - { - Field = field, - MixDatabaseColumnName = field.Name, - StringValue = field.DefaultValue, - Priority = field.Priority - }; - Values.Add(val); - } - val.MixDatabaseName = MixDatabaseName; - val.Priority = field.Priority; - val.Field = field; - }; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/UpdateViewModel.cs deleted file mode 100644 index 0081df081..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabaseDatas/UpdateViewModel.cs +++ /dev/null @@ -1,365 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabaseDatas -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("mixDatabaseId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("mixDatabaseName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - [JsonProperty("values")] - public List Values { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonProperty("dataNavs")] - public List DataNavs { get; set; } - - [JsonProperty("data")] - public JObject Data { get; set; } - - [JsonProperty("parentId")] - public string ParentId { get; set; } - - [JsonProperty("parentType")] - public MixDatabaseParentType ParentType { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Status = Status == default ? MixService.GetEnumConfig(MixAppSettingKeywords.DefaultContentStatus) : Status; - } - // Related Datas - DataNavs = MixDatabaseDataAssociations.UpdateViewModel.Repository.GetModelListBy( - n => n.ParentId == Id && n.ParentType == MixDatabaseParentType.Set && n.Specificulture == Specificulture, - _context, _transaction).Data; - - Values = MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction).Data.OrderBy(a => a.Priority).ToList(); - Fields = MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => (f.MixDatabaseId == MixDatabaseId || f.MixDatabaseName == MixDatabaseName), _context, _transaction).Data; - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() { MixDatabaseColumnId = field.Id } - , _context, _transaction) - { - Field = field, - MixDatabaseColumnName = field.Name, - StringValue = field.DefaultValue, - Priority = field.Priority - }; - Values.Add(val); - } - val.CreatedBy = CreatedBy; - val.ModifiedBy = ModifiedBy; - val.MixDatabaseName = MixDatabaseName; - val.Priority = field.Priority; - val.Field = field; - val.DataType = val.Field.DataType; - val.MixDatabaseColumnName = val.MixDatabaseColumnName ?? val.Field?.Name; - } - } - - public override MixDatabaseData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - if (MixDatabaseId == 0 && !string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseId = MixDatabases.ReadViewModel.Repository.GetSingleModel(m => m.Name == MixDatabaseName, _context, _transaction).Data?.Id ?? 0; - } - else if (MixDatabaseId > 0 && string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = MixDatabases.ReadViewModel.Repository.GetSingleModel(m => m.Name == MixDatabaseName, _context, _transaction).Data?.Name; - } - } - return base.ParseModel(_context, _transaction); - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var result = await base.SaveModelAsync(isSaveSubModels, context, transaction); - // if save current data success and there is related parent data - if (result.IsSucceed && !string.IsNullOrEmpty(ParentId)) - { - MixDatabaseDataAssociations.UpdateViewModel nav = new MixDatabaseDataAssociations.UpdateViewModel() - { - DataId = result.Data.Id, - Specificulture = Specificulture, - MixDatabaseId = result.Data.MixDatabaseId, - MixDatabaseName = result.Data.MixDatabaseName, - ParentId = ParentId, - ParentType = ParentType - }; - var saveNav = await nav.SaveModelAsync(true, context, transaction); - result.IsSucceed = result.IsSucceed && saveNav.IsSucceed; - result.Errors = saveNav.Errors; - result.Exception = saveNav.Exception; - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - // TODO: Double check logic code - var additionalSet = _context.MixDatabase.FirstOrDefault(m => m.Name == "sys_additional_field"); - foreach (var item in Values) - { - if (item.DataId != parent.Id) - { - item.Id = null; - } - if (result.IsSucceed) - { - if (additionalSet != null && item.Field != null && item.Field.Id == 0) - { - // Add field to additional_field set - item.Field.MixDatabaseId = additionalSet.Id; - item.Field.MixDatabaseName = additionalSet.Name; - var saveField = await item.Field.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveField, ref result); - } - if (result.IsSucceed) - { - item.MixDatabaseColumnId = item.Field?.Id ?? item.MixDatabaseColumnId; - item.MixDatabaseColumnName = item.Field?.Name ?? item.MixDatabaseColumnName; - item.Priority = item.Field?.Priority ?? item.Priority; - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - else - { - break; - } - } - } - - return result; - } - - public override RepositoryResponse SaveSubModels(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Values) - { - if (result.IsSucceed) - { - item.Field = Fields.Find(f => f.Name == item.MixDatabaseColumnName); - item.Priority = item.Field?.Priority ?? item.Priority; - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - return result; - } - - #endregion Overrides - - #region Expand - - private async Task> SaveRelatedDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - foreach (var item in RelatedData) - { - if (result.IsSucceed) - { - if (string.IsNullOrEmpty(item.ParentId) && item.ParentType == MixDatabaseParentType.Set) - { - var set = context.MixDatabase.First(s => s.Name == item.ParentName); - item.ParentId = set.Id.ToString(); - } - item.Specificulture = Specificulture; - item.MixDatabaseId = parent.MixDatabaseId; - item.MixDatabaseName = parent.MixDatabaseName; - item.Id = parent.Id; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - - return result; - } - - private JProperty ParseValue(MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.DataType) - { - case MixDataType.DateTime: - return new JProperty(item.MixDatabaseColumnName, item.DateTimeValue); - - case MixDataType.Date: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Time: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Double: - return (new JProperty(item.MixDatabaseColumnName, item.DoubleValue)); - - case MixDataType.Boolean: - return (new JProperty(item.MixDatabaseColumnName, item.BooleanValue)); - - case MixDataType.Integer: - return (new JProperty(item.MixDatabaseColumnName, item.IntegerValue)); - - case MixDataType.Reference: - //string url = $"/api/v1/odata/en-us/related-attribute-set-data/mobile/parent/set/{Id}/{item.Field.ReferenceId}"; - return (new JProperty(item.MixDatabaseColumnName, new JArray())); - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Upload: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - return (new JProperty(item.MixDatabaseColumnName, item.StringValue)); - } - } - - private void ParseData() - { - Data = new JObject - { - new JProperty("id", Id), - new JProperty("specificulture", Specificulture), - new JProperty("createdDateTime", CreatedDateTime) - }; - foreach (var item in Values.OrderBy(v => v.Priority)) - { - Data.Add(ParseValue(item)); - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/DeleteViewModel.cs deleted file mode 100644 index 44c31ee99..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/DeleteViewModel.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; - -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("ReferenceId")] - public int? ReferenceId { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixDatabase model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override RepositoryResponse RemoveRelatedModels(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var removeData = MixDatabaseDatas.DeleteViewModel.Repository.RemoveListModel(false, f => f.MixDatabaseId == Id, _context, _transaction); - ViewModelHelper.HandleResult(removeData, ref result); - if (result.IsSucceed) - { - var removeFields = MixDatabaseColumns.DeleteViewModel.Repository.RemoveListModel(false, f => f.MixDatabaseId == Id, _context, _transaction); - ViewModelHelper.HandleResult(removeFields, ref result); - } - return result; - } - - public override async System.Threading.Tasks.Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var removeData = await MixDatabaseDatas.DeleteViewModel.Repository.RemoveListModelAsync(false, f => f.MixDatabaseId == Id, _context, _transaction); - ViewModelHelper.HandleResult(removeData, ref result); - if (result.IsSucceed) - { - var removeFields = await MixDatabaseColumns.DeleteViewModel.Repository.RemoveListModelAsync( - false, f => f.MixDatabaseId == Id || f.ReferenceId == Id, _context, _transaction); - ViewModelHelper.HandleResult(removeFields, ref result); - } - return result; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/Helper.cs deleted file mode 100644 index 8a41bd84e..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/Helper.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class Helper - { - //public static RepositoryResponse> LoadPostData(int postId, string specificulture, int? pageSize = null, int? pageIndex = 0 - // , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - //{ - // Expression> dataExp = null; - // dataExp = m => m.PostId == postId && m.Specificulture == specificulture && (m.PostId == postId); - // var getDataResult = MixPostAttributeDatas.UpdateViewModel.Repository - // .GetModelListBy( - // dataExp - // , MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - // , pageSize, pageIndex - // , _context: _context, _transaction: _transaction); - // if (getDataResult.Data.TotalItems == 0) - // { - // getDataResult.Data.Items.Add(new MixPostAttributeDatas.UpdateViewModel()); - // } - // return getDataResult; - //} - - //public static async System.Threading.Tasks.Task>> LoadPostDataAsync(int postId, string specificulture, int? pageSize = null, int? pageIndex = 0 - // , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - //{ - // Expression> dataExp = null; - // dataExp = m => m.PostId == postId && m.Specificulture == specificulture && (m.PostId == postId); - // var getDataResult = await MixPostAttributeDatas.UpdateViewModel.Repository - // .GetModelListByAsync( - // dataExp - // , MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - // , pageSize, pageIndex, null, null - // , _context: _context, _transaction: _transaction); - // if (getDataResult.Data.TotalItems == 0) - // { - // getDataResult.Data.Items.Add(new MixPostAttributeDatas.UpdateViewModel()); - // } - // return getDataResult; - //} - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/ImportViewModel.cs deleted file mode 100644 index 610140503..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ImportViewModel.cs +++ /dev/null @@ -1,181 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("ReferenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("edmSubject")] - public string EdmSubject { get; set; } - - [JsonProperty("edmFrom")] - public string EdmFrom { get; set; } - - [JsonProperty("edmAutoSend")] - public bool? EdmAutoSend { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonIgnore] - [JsonProperty("data")] - public List Data { get; set; } - - [JsonProperty("isExportData")] - public bool IsExportData { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixDatabase model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //Fields = MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(a => a.MixDatabaseId == Id, _context, _transaction).Data?.OrderBy(a => a.Priority).ToList(); - //Data = MixDatabaseDatas.UpdateViewModel.Repository.GetModelListBy(a => a.MixDatabaseId == Id, _context, _transaction).Data?.OrderBy(a => a.Priority).ToList(); - } - - public override MixDatabase ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (_context.MixDatabase.Any(s => s.Name == Name && s.Id != Id)) - { - IsValid = false; - Errors.Add($"{Name} is Existed"); - } - } - } - - public override async Task> SaveSubModelsAsync(MixDatabase parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Fields) - { - if (result.IsSucceed) - { - item.MixDatabaseName = parent.Name; - item.MixDatabaseId = parent.Id; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixDatabase parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Fields) - { - if (result.IsSucceed) - { - item.MixDatabaseName = parent.Name; - item.MixDatabaseId = parent.Id; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - return result; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadMvcViewModel.cs deleted file mode 100644 index ff62da85d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadMvcViewModel.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("ReferenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("edmSubject")] - public string EdmSubject { get; set; } - - [JsonProperty("edmFrom")] - public string EdmFrom { get; set; } - - [JsonProperty("edmAutoSend")] - public bool? EdmAutoSend { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - public PaginationModel Data { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixDatabase model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = Fields ?? MixDatabaseColumns.UpdateViewModel - .Repository.GetModelListBy(a => a.MixDatabaseId == Id, _context, _transaction).Data?.OrderBy(a => a.Priority).ToList(); - } - - #endregion Overrides - - #region Expand - - public void LoadData(string parentId, MixDatabaseParentType parentType, string specificulture, int? pageSize = null, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository - .GetModelListBy( - m => m.ParentId == parentId && m.ParentType == parentType && m.Specificulture == specificulture - , MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - , pageSize, pageIndex - , _context: _context, _transaction: _transaction); - - Data = getData.Data; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadViewModel.cs deleted file mode 100644 index 5669f5772..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/ReadViewModel.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("ReferenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("edmSubject")] - public string EdmSubject { get; set; } - - [JsonProperty("edmFrom")] - public string EdmFrom { get; set; } - - [JsonProperty("edmAutoSend")] - public bool? EdmAutoSend { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - public List Fields { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixDatabase model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = MixDatabaseColumns.ReadViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == Id, _context, _transaction).Data; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixDatabases/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixDatabases/UpdateViewModel.cs deleted file mode 100644 index cebf69d38..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixDatabases/UpdateViewModel.cs +++ /dev/null @@ -1,218 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixDatabases -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("ReferenceId")] - public int? ReferenceId { get; set; } - - [JsonProperty("type")] - public MixDatabaseType Type { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("edmSubject")] - public string EdmSubject { get; set; } - - [JsonProperty("edmFrom")] - public string EdmFrom { get; set; } - - [JsonProperty("edmAutoSend")] - public bool? EdmAutoSend { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("fields")] - public List Fields { get; set; } - - [JsonProperty("formView")] - public MixTemplates.UpdateViewModel FormView { get; set; } - - [JsonProperty("edmView")] - public MixTemplates.UpdateViewModel EdmView { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixDatabase model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id > 0) - { - Fields ??= MixDatabaseColumns.UpdateViewModel - .Repository.GetModelListBy(a => a.MixDatabaseId == Id, _context, _transaction).Data?.OrderBy(a => a.Priority).ToList() - ?? new List(); - //FormView = MixTemplates.UpdateViewModel.GetTemplateByPath(FormTemplate, Specificulture, _context, _transaction).Data; - //EdmView = MixTemplates.UpdateViewModel.GetTemplateByPath(EdmTemplate, Specificulture, _context, _transaction).Data; - } - else - { - Fields = new List(); - } - } - - public override MixDatabase ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - FormTemplate = FormView != null ? string.Format(@"{0}/{1}{2}", FormView.FolderType, FormView.FileName, FormView.Extension) : FormTemplate; - EdmTemplate = EdmView != null ? string.Format(@"{0}/{1}{2}", EdmView.FolderType, EdmView.FileName, EdmView.Extension) : EdmTemplate; - return base.ParseModel(_context, _transaction); - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (_context.MixDatabase.Any(s => s.Name == Name && s.Id != Id)) - { - IsValid = false; - Errors.Add($"{Name} is Existed"); - } - } - } - - public override async Task> SaveSubModelsAsync(MixDatabase parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Fields) - { - if (result.IsSucceed) - { - item.MixDatabaseId = parent.Id; - item.MixDatabaseName = parent.Name; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixDatabase parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (result.IsSucceed) - { - foreach (var item in Fields) - { - if (result.IsSucceed) - { - item.MixDatabaseName = parent.Name; - item.MixDatabaseId = parent.Id; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - return result; - } - - //public override List GenerateRelatedData(MixCmsContext context, IDbContextTransaction transaction) - //{ - // var tasks = new List(); - // var attrDatas = context.MixDatabaseData.Where(m => m.MixDatabaseId == Id); - // var attrFields = context.MixDatabaseColumn.Where(m => m.MixDatabaseId == Id); - - // foreach (var item in attrDatas) - // { - // tasks.Add(Task.Run(() => - // { - // MixDatabaseDatas.UpdateViewModel.Repository.RemoveCache(item, context, transaction); - // })); - // } - // foreach (var item in attrFields) - // { - // tasks.Add(Task.Run(() => - // { - // MixDatabaseColumns.UpdateViewModel.Repository.RemoveCache(item, context, transaction); - // })); - // } - // return tasks; - //} - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixLanguages/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixLanguages/ImportViewModel.cs deleted file mode 100644 index dc5b848eb..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixLanguages/ImportViewModel.cs +++ /dev/null @@ -1,275 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixLanguages -{ - public class ImportViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixLanguage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixLanguage ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - Value = Property.Value ?? Value; - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - if (string.IsNullOrEmpty(DefaultValue)) - { - DefaultValue = Value; - } - return base.ParseModel(_context, _transaction); - } - - #region Async - - public override async Task> RemoveRelatedModelsAsync(ImportViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = (await _context.SaveChangesAsync()) > 0 - }; - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - } - return result; - } - - #endregion Async - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - IsValid = !Repository.CheckIsExists(m => m.Keyword == Keyword && m.Specificulture == Specificulture && m.Id != Id); - if (!IsValid) - { - Errors.Add($"The keyword: {Keyword} is existed"); - } - } - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = LoadCultures(Specificulture, _context, _transaction); - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - this.Cultures.ForEach(c => c.IsSupported = true); - } - - public override RepositoryResponse RemoveRelatedModels(ImportViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = _context.SaveChanges() > 0 - }; - } - - #endregion Overrides - - #region Expand - - public static async Task> ImportLanguages(List arrLanguage, string destCulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - - try - { - foreach (var item in arrLanguage) - { - var lang = new ImportViewModel(item, context, transaction); - lang.Specificulture = destCulture; - lang.CreatedDateTime = DateTime.UtcNow; - var saveResult = await lang.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - if (isRoot) - { - context.Dispose(); - } - } - return result; - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixLanguage.Any(p => p.Keyword == Keyword && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixLanguages/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixLanguages/ReadMvcViewModel.cs deleted file mode 100644 index 641c5b1fe..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixLanguages/ReadMvcViewModel.cs +++ /dev/null @@ -1,134 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixLanguages -{ - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixLanguage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - } - - public override RepositoryResponse RemoveRelatedModels(ReadMvcViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = _context.SaveChanges() > 0 - }; - } - - public override async Task> RemoveRelatedModelsAsync(ReadMvcViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = (await _context.SaveChangesAsync()) > 0 - }; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixLanguages/SystemLanguageViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixLanguages/SystemLanguageViewModel.cs deleted file mode 100644 index 509628ede..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixLanguages/SystemLanguageViewModel.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixLanguages -{ - public class SystemLanguageViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public SystemLanguageViewModel() : base() - { - } - - public SystemLanguageViewModel(MixLanguage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - - - #region Expands - - public static async Task> ImportLanguages(List arrLanguage, string destCulture) - { - UnitOfWorkHelper.InitTransaction(null, null, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - - var result = new RepositoryResponse() { IsSucceed = true }; - - try - { - foreach (var item in arrLanguage) - { - var lang = new SystemLanguageViewModel(item, context, transaction); - lang.Specificulture = destCulture; - var saveResult = await lang.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, true, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixLanguages/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixLanguages/UpdateViewModel.cs deleted file mode 100644 index 2d00c1fd5..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixLanguages/UpdateViewModel.cs +++ /dev/null @@ -1,275 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixLanguages -{ - public class UpdateViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [Required] - [JsonProperty("keyword")] - public string Keyword { get; set; } - - [JsonProperty("category")] - public string Category { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - [JsonProperty("dataType")] - public MixDataType DataType { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("defaultValue")] - public string DefaultValue { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain, Specificulture); } } - - [JsonProperty("property")] - public DataValueViewModel Property { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixLanguage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixLanguage ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(s => s.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - Value = Property.Value ?? Value; - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - if (string.IsNullOrEmpty(DefaultValue)) - { - DefaultValue = Value; - } - return base.ParseModel(_context, _transaction); - } - - #region Async - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = (await _context.SaveChangesAsync()) > 0 - }; - } - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - return result; - } - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - if (result.IsSucceed) - { - MixService.LoadFromDatabase(); - MixService.SaveSettings(); - } - } - return result; - } - - #endregion Async - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - IsValid = !Repository.CheckIsExists(m => m.Keyword == Keyword && m.Specificulture == Specificulture && m.Id != Id); - if (!IsValid) - { - Errors.Add($"The keyword: {Keyword} is existed"); - } - } - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = LoadCultures(Specificulture, _context, _transaction); - Property = new DataValueViewModel() { DataType = DataType, Value = Value, Name = Keyword }; - this.Cultures.ForEach(c => c.IsSupported = true); - } - - public override RepositoryResponse RemoveRelatedModels(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - foreach (var culture in Cultures.Where(c => c.Specificulture != Specificulture)) - { - var lang = _context.MixLanguage.First(c => c.Keyword == Keyword && c.Specificulture == culture.Specificulture); - if (lang != null) - { - _context.MixLanguage.Remove(lang); - } - } - return new RepositoryResponse() - { - IsSucceed = _context.SaveChanges() > 0 - }; - } - - #endregion Overrides - - #region Expand - - public static async Task> ImportLanguages(List arrLanguage, string destCulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - - try - { - foreach (var item in arrLanguage) - { - var lang = new UpdateViewModel(item, context, transaction); - lang.Specificulture = destCulture; - lang.CreatedDateTime = DateTime.UtcNow; - var saveResult = await lang.SaveModelAsync(false, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - if (isRoot) - { - context.Dispose(); - } - } - return result; - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixLanguage.Any(p => p.Keyword == Keyword && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixMedias/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixMedias/ReadViewModel.cs deleted file mode 100644 index 119ea41e6..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixMedias/ReadViewModel.cs +++ /dev/null @@ -1,166 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Domain.Core.Models; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixMedias -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [Required(ErrorMessage = "Please choose File")] - [JsonProperty("extension")] - public string Extension { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("fileType")] - public string FileType { get; set; } - - [JsonProperty("fileSize")] - public int FileSize { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("targetUrl")] - public string TargetUrl { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("fullPath")] - public string FullPath { - get { - if (!string.IsNullOrEmpty(FileName) && string.IsNullOrEmpty(TargetUrl)) - { - return FileFolder.IndexOf("http") > 0 ? $"{FileFolder}/{FileName}{Extension}" - : $"{Domain}/{FileFolder}/{FileName}{Extension}"; - } - else - { - return TargetUrl; - } - } - } - - [JsonProperty("filePath")] - public string FilePath { - get { - if (!string.IsNullOrEmpty(FileName) && string.IsNullOrEmpty(TargetUrl)) - { - return FileFolder.IndexOf("http") > 0 ? $"{FileFolder}/{FileName}{Extension}" - : $"/{FileFolder}/{FileName}{Extension}"; - } - else - { - return TargetUrl; - } - } - } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixMedia model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Expand - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixMedia.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixMedias/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixMedias/UpdateViewModel.cs deleted file mode 100644 index 0618f78da..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixMedias/UpdateViewModel.cs +++ /dev/null @@ -1,263 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixMedias -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("fileType")] - public string FileType { get; set; } - - [JsonProperty("fileSize")] - public int FileSize { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("targetUrl")] - public string TargetUrl { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("fullPath")] - public string FullPath { - get { - if (!string.IsNullOrEmpty(FileName) && string.IsNullOrEmpty(TargetUrl)) - { - return FileFolder.IndexOf("http") > 0 ? $"{FileFolder}/{FileName}{Extension}" - : $"{Domain}/{FileFolder}/{FileName}{Extension}"; - } - else - { - return TargetUrl; - } - } - } - - [JsonProperty("filePath")] - public string FilePath { - get { - if (!string.IsNullOrEmpty(FileName) && string.IsNullOrEmpty(TargetUrl)) - { - return FileFolder.IndexOf("http") > 0 ? $"{FileFolder}/{FileName}{Extension}" - : $"/{FileFolder}/{FileName}{Extension}"; - } - else - { - return TargetUrl; - } - } - } - - [JsonProperty("mediaFile")] - public FileViewModel MediaFile { get; set; } - - [JsonProperty("file")] - public IFormFile File { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixMedia model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixMedia ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (CreatedDateTime == default) - { - Id = Id > 0 ? Id : UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - if (string.IsNullOrEmpty(TargetUrl)) - { - if (FileFolder[0] == '/') { FileFolder = FileFolder.Substring(1); } - } - return base.ParseModel(_context, _transaction); - } - - public override void Validate(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (MediaFile?.FileStream != null) - { - FileFolder = $"{MixService.GetTemplateUploadFolder(Specificulture)}"; - MediaFile.Filename = $"{SeoHelper.GetSEOString(MediaFile.Filename).ToLower()}-{ DateTime.UtcNow.Ticks}"; - MediaFile.FileFolder = FileFolder; - var isSaved = MixFileRepository.Instance.SaveWebFile(MediaFile); - if (isSaved) - { - Extension = MediaFile.Extension.ToLower(); - FileName = MediaFile.Filename; - FileFolder = MediaFile.FileFolder; - if (string.IsNullOrEmpty(Title)) - { - Title = FileName; - } - } - else - { - IsValid = false; - } - } - else - { - if (File != null) - { - var saveFile = MixFileRepository.Instance.SaveWebFile(File, $"{FileFolder}"); - if (saveFile == null) - { - IsValid = false; - Errors.Add("Cannot save file"); - } - else - { - if (string.IsNullOrEmpty(Title)) - { - Title = FileName; - } - FileName = saveFile.Filename; - Extension = saveFile.Extension; - } - } - } - FileType = FileType ?? "image"; - base.Validate(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - MediaFile = new FileViewModel(); - } - - public override RepositoryResponse RemoveRelatedModels(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse - { - IsSucceed = MixFileRepository.Instance.DeleteWebFile(FileName, Extension, FileFolder) - }; - result.IsSucceed = Repository.RemoveListModel(false, m => m.Id == Id && m.Specificulture != Specificulture, _context, _transaction).IsSucceed; - return result; - } - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - // Remove local file - if (FileFolder.IndexOf("http") < 0) - { - MixFileRepository.Instance.DeleteWebFile(FileName, Extension, FileFolder); - } - await Repository.RemoveListModelAsync(false, m => m.Id == Id && m.Specificulture != Specificulture, _context, _transaction); - return await base.RemoveRelatedModelsAsync(view, _context, _transaction); - } - - #endregion Overrides - - #region Expand - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixMedia.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/Helper.cs deleted file mode 100644 index 6fef53c7d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/Helper.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Services; -using Newtonsoft.Json.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModuleDatas -{ - public class Helper - { - public static JToken ParseValue(JObject JItem, ApiModuleDataValueViewModel item) - { - JToken result = null; - bool isHaveValue = JItem.TryGetValue(item.Name, out JToken val); - if (isHaveValue) - { - switch (item.DataType) - { - case MixDataType.Reference: - //string url = $"/api/v1/odata/en-us/related-attribute-set-data/mobile/parent/set/{Id}/{item.Field.ReferenceId}"; - val["value"] = new JArray(); - break; - - case MixDataType.Upload: - string fullUrl = val["value"].ToString().TrimStart('/'); - - fullUrl = fullUrl.IndexOf("http") >= 0 ? fullUrl : $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/{fullUrl}"; - val["value"] = fullUrl; - break; - - case MixDataType.DateTime: - case MixDataType.Date: - case MixDataType.Time: - case MixDataType.Double: - case MixDataType.Boolean: - case MixDataType.Integer: - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - break; - } - result = val; - } - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ImportViewModel.cs deleted file mode 100644 index fae82edd3..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ImportViewModel.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModuleDatas -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } = "[]"; - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("postId")] - public int? PostId { get; set; } - - [JsonProperty("productId")] - public int? ProductId { get; set; } - - [JsonProperty("pageId")] - public int? PageId { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixModuleData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixModuleData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - else - { - LastModified = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = _context.MixModule.First(m => m.Id == ModuleId && m.Specificulture == Specificulture)?.Fields; - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadMvcViewModel.cs deleted file mode 100644 index 0c019e274..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadMvcViewModel.cs +++ /dev/null @@ -1,238 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.NetCore.Attributes; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModuleDatas -{ - [GeneratedController("api/v1/rest/{culture}/mix-module-data/mvc")] - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonIgnore] - [JsonProperty("fields")] - public string Fields { get; set; } = "[]"; - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("postId")] - public int? PostId { get; set; } - - [JsonProperty("productId")] - public int? ProductId { get; set; } - - [JsonProperty("pageId")] - public int? PageId { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("dataProperties")] - public List DataProperties { get; set; } - - [JsonProperty("obj")] - public JObject Obj { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixModuleData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixModuleData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - - LastModified = DateTime.UtcNow; - Value = JsonConvert.SerializeObject(Obj); - Fields = JsonConvert.SerializeObject(DataProperties); - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = Fields ?? _context.MixModule.First(m => m.Id == ModuleId && m.Specificulture == Specificulture)?.Fields; - DataProperties = Fields == null ? null : JsonConvert.DeserializeObject>(Fields); - Obj = Value == null ? InitValue() : JsonConvert.DeserializeObject(Value); - foreach (var item in DataProperties) - { - Obj[item.Name] = Helper.ParseValue(Obj, item); - if (Obj[item.Name] == null) - { - Obj[item.Name] = new JObject() - { - new JProperty("dataType", item.DataType), - new JProperty("value", Obj[item.Name]?.Value().Value("value")) - }; - } - } - } - - public override void Validate(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - base.Validate(_context, _transaction); - - if (IsValid) - { - foreach (var col in DataProperties) - { - var result = col.Validate(Id, Specificulture, Obj, _context, _transaction); - if (!result.IsSucceed) - { - IsValid = false; - Errors.AddRange(result.Errors); - } - } - } - } - - #endregion Overrides - - #region Expands - - public string ParseObjectValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(prop.Name, obj)); - } - return result.ToString(Formatting.None); - } - - public JObject InitValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(prop.Name, obj)); - } - return result; - } - - public string GetStringValue(string name) - { - var prop = DataProperties.FirstOrDefault(p => p.Name == name); - return prop != null && prop.Value != null ? prop.Value.ToString() : string.Empty; - } - - public string Property(string name) - { - return Obj[name]?.Value().Value("value"); - } - - public ApiModuleDataValueViewModel GetDataProperty(string name) - { - return DataProperties.FirstOrDefault(p => p.Name == name); - } - - public static async System.Threading.Tasks.Task>> UpdateInfosAsync(List data) - { - MixCmsContext context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - var result = new RepositoryResponse>(); - try - { - foreach (var item in data) - { - var model = context.MixModuleData.FirstOrDefault(m => m.Id == item.Id && m.Specificulture == item.Specificulture); - if (model != null) - { - model.Priority = item.Priority; - context.Entry(model).State = Microsoft.EntityFrameworkCore.EntityState.Modified; - } - } - result.IsSucceed = (await context.SaveChangesAsync()) > 0; - if (!result.IsSucceed) - { - result.Errors.Add("Nothing changed"); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - UnitOfWorkHelper.HandleException(ex, true, transaction); - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - - #endregion Expands - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadViewModel.cs deleted file mode 100644 index eb7f2a639..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/ReadViewModel.cs +++ /dev/null @@ -1,241 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModuleDatas -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonIgnore] - [JsonProperty("fields")] - public string Fields { get; set; } = "[]"; - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("postId")] - public int? PostId { get; set; } - - [JsonProperty("productId")] - public int? ProductId { get; set; } - - [JsonProperty("pageId")] - public int? PageId { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("dataProperties")] - public List DataProperties { get; set; } - - [JsonProperty("jItem")] - public JObject JItem { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixModuleData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixModuleData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - - LastModified = DateTime.UtcNow; - Value = JsonConvert.SerializeObject(JItem); - Fields = JsonConvert.SerializeObject(DataProperties); - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = Fields ?? _context.MixModule.First(m => m.Id == ModuleId && m.Specificulture == Specificulture)?.Fields; - DataProperties = Fields == null ? null : JsonConvert.DeserializeObject>(Fields); - JItem = Value == null ? InitValue() : JsonConvert.DeserializeObject(Value); - foreach (var item in DataProperties) - { - JItem[item.Name] = Helper.ParseValue(JItem, item); - if (JItem[item.Name] == null) - { - JItem[item.Name] = new JObject() - { - new JProperty("dataType", item.DataType), - new JProperty("value", JItem[item.Name]?.Value().Value("value")) - }; - } - } - } - - public override void Validate(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - base.Validate(_context, _transaction); - - if (IsValid) - { - foreach (var col in DataProperties) - { - var result = col.Validate(Id, Specificulture, JItem, _context, _transaction); - if (!result.IsSucceed) - { - IsValid = false; - Errors.AddRange(result.Errors); - } - } - } - } - - #endregion Overrides - - #region Expands - - public string ParseObjectValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(prop.Name, obj)); - } - return result.ToString(Formatting.None); - } - - public JObject InitValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(prop.Name, obj)); - } - return result; - } - - public string GetStringValue(string name) - { - var prop = DataProperties.FirstOrDefault(p => p.Name == name); - return prop != null && prop.Value != null ? prop.Value.ToString() : string.Empty; - } - - public bool HasValue(string fieldName) - { - return !string.IsNullOrEmpty(JItem[fieldName]?.Value()?.Value("value")); - } - - public string Property(string name) - { - return HasValue(name) ? JItem[name]?.Value()?.Value("value") : default; - } - - public ApiModuleDataValueViewModel GetDataProperty(string name) - { - return DataProperties.FirstOrDefault(p => p.Name == name); - } - - public static async System.Threading.Tasks.Task>> UpdateInfosAsync(List data) - { - MixCmsContext context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - var result = new RepositoryResponse>(); - try - { - foreach (var item in data) - { - var model = context.MixModuleData.FirstOrDefault(m => m.Id == item.Id && m.Specificulture == item.Specificulture); - if (model != null) - { - model.Priority = item.Priority; - context.Entry(model).State = Microsoft.EntityFrameworkCore.EntityState.Modified; - } - } - result.IsSucceed = (await context.SaveChangesAsync()) > 0; - if (!result.IsSucceed) - { - result.Errors.Add("Nothing changed"); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - UnitOfWorkHelper.HandleException(ex, true, transaction); - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - - #endregion Expands - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/UpdateViewModel.cs deleted file mode 100644 index 7f0150174..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModuleDatas/UpdateViewModel.cs +++ /dev/null @@ -1,186 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModuleDatas -{ - public class UpdateViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } = "[]"; - - [JsonProperty("value")] - public string Value { get; set; } - - [JsonProperty("postId")] - public int? PostId { get; set; } - - [JsonProperty("productId")] - public int? ProductId { get; set; } - - [JsonProperty("pageId")] - public int? PageId { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("dataProperties")] - public List DataProperties { get; set; } - - [JsonProperty("jItem")] - public JObject JItem { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixModuleData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixModuleData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - } - LastModified = DateTime.UtcNow; - Value = JsonConvert.SerializeObject(JItem); - Fields = JsonConvert.SerializeObject(DataProperties); - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Fields = _context.MixModule.First(m => m.Id == ModuleId && m.Specificulture == Specificulture)?.Fields; - DataProperties = Fields == null ? null : JsonConvert.DeserializeObject>(Fields); - JItem = Value == null ? InitValue() : JsonConvert.DeserializeObject(Value); - foreach (var item in DataProperties) - { - JItem[item.Name] = Helper.ParseValue(JItem, item); - if (JItem[item.Name] == null) - { - JItem[item.Name] = new JObject() - { - new JProperty("dataType", item.DataType), - new JProperty("value", JItem[item.Name]?.Value().Value("value")) - }; - } - } - } - - public override void Validate(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - base.Validate(_context, _transaction); - - if (IsValid) - { - foreach (var col in DataProperties) - { - var result = col.Validate(Id, Specificulture, JItem, _context, _transaction); - if (!result.IsSucceed) - { - IsValid = false; - Errors.AddRange(result.Errors); - } - } - } - } - - #endregion Overrides - - #region Expands - - public string ParseObjectValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(CommonHelper.ParseJsonPropertyName(prop.Name), obj)); - } - return result.ToString(Formatting.None); - } - - public JObject InitValue() - { - JObject result = new JObject(); - foreach (var prop in DataProperties) - { - JObject obj = new JObject(); - obj.Add(new JProperty("dataType", prop.DataType)); - obj.Add(new JProperty("value", prop.Value)); - result.Add(new JProperty(CommonHelper.ParseJsonPropertyName(prop.Name), obj)); - } - return result; - } - - public string GetStringValue(string name) - { - var prop = DataProperties.FirstOrDefault(p => p.Name == name); - return prop != null && prop.Value != null ? prop.Value.ToString() : string.Empty; - } - - public ApiModuleDataValueViewModel GetDataProperty(string name) - { - return DataProperties.FirstOrDefault(p => p.Name == name); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ImportViewModel.cs deleted file mode 100644 index dbb2d0a4c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ImportViewModel.cs +++ /dev/null @@ -1,170 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModulePosts -{ - public class ImportViewModel - : ViewModelBase - { - public ImportViewModel(MixModulePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ImportViewModel() : base() - { - } - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #region Views - - [JsonProperty("post")] - public MixPosts.ImportViewModel Post { get; set; } - - [JsonProperty("module")] - public MixModules.ReadListItemViewModel Module { get; set; } - - #endregion Views - - #region overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - IsValid = !_context.MixModulePost.Any(m => m.PostId == PostId && m.ModuleId == ModuleId - && m.Id != Id && m.Specificulture == Specificulture); - if (!IsValid) - { - Errors.Add("Existed"); - } - } - } - - public override MixModulePost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ImportViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - } - - #endregion overrides - - #region Expand - - public static RepositoryResponse> GetModulePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixModule.Include(cp => cp.MixModulePost).Where(a => a.Specificulture == specificulture - && (a.Type == (int)MixModuleType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixModulePosts.ReadViewModel( - new MixModulePost() - { - PostId = postId, - ModuleId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixModulePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadMvcViewModel.cs deleted file mode 100644 index a66f154e5..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadMvcViewModel.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModulePosts -{ - public class ReadMvcViewModel - : ViewModelBase - { - public ReadMvcViewModel(MixModulePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadMvcViewModel() : base() - { - } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #region Views - - [JsonProperty("post")] - public MixPosts.ReadMvcViewModel Post { get; set; } - - #endregion Views - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ReadMvcViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - } - - #endregion overrides - - #region Expand - - public static RepositoryResponse> GetModulePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixModule.Include(cp => cp.MixModulePost).Where(a => a.Specificulture == specificulture && a.Type == (int)MixModuleType.ListPost) - .Select(p => new MixModulePosts.ReadViewModel( - new MixModulePost() - { - PostId = postId, - ModuleId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixModulePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (transaction == null) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadViewModel.cs deleted file mode 100644 index 07943f06b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModulePosts/ReadViewModel.cs +++ /dev/null @@ -1,179 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixModulePosts -{ - public class ReadViewModel - : ViewModelBase - { - public ReadViewModel(MixModulePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #region Views - - [JsonProperty("post")] - public MixPosts.ReadListItemViewModel Post { get; set; } - - [JsonProperty("module")] - public MixModules.ReadListItemViewModel Module { get; set; } - - #endregion Views - - #region overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - IsValid = !_context.MixModulePost.Any(m => m.PostId == PostId && m.ModuleId == ModuleId - && m.Id != Id && m.Specificulture == Specificulture); - if (!IsValid) - { - Errors.Add("Existed"); - } - } - } - - public override MixModulePost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ReadListItemViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - - var getModule = MixModules.ReadListItemViewModel.Repository.GetSingleModel(p => p.Id == ModuleId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getModule.IsSucceed) - { - Module = getModule.Data; - } - } - - #endregion overrides - - #region Expand - - public static RepositoryResponse> GetModulePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixModule.Include(cp => cp.MixModulePost).Where(a => a.Specificulture == specificulture - && (a.Type == (int)MixModuleType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixModulePosts.ReadViewModel( - new MixModulePost() - { - PostId = postId, - ModuleId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixModulePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModules/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixModules/Helper.cs deleted file mode 100644 index a9e2ddcab..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModules/Helper.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixModules -{ - public class Helper - { - public static async Task> Import(List arrModule, string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - int id = UpdateViewModel.ModelRepository.Max(m => m.Id, context, transaction).Data + 1; - foreach (var item in arrModule) - { - item.Id = id; - item.CreatedDateTime = DateTime.UtcNow; - item.Specificulture = destCulture; - context.MixModule.Add(item); - id++; - } - await context.SaveChangesAsync(); - result.Data = true; - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - public static List LoadCultures(int id, string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixModule.Any(p => p.Id == id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - public static RepositoryResponse GetBy( - Expression> predicate, string postId = null, string productId = null, int pageId = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = UpdateViewModel.Repository.GetSingleModel(predicate, _context, _transaction); - if (result.IsSucceed) - { - result.Data.PostId = postId; - result.Data.PageId = pageId; - } - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModules/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModules/ImportViewModel.cs deleted file mode 100644 index e63ecf24c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModules/ImportViewModel.cs +++ /dev/null @@ -1,215 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixModules -{ - //Use for update module info only => don't need to load data - public class ImportViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [Required] - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } - - [JsonProperty("type")] - public MixModuleType Type { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("data")] - public List Data { get; set; } = new List(); - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } // Parent to Posts - - //Parent Post Id - [JsonProperty("postId")] - public string PostId { get; set; } - - //Parent Category Id - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isExportData")] - public bool IsExportData { get; set; } - - [JsonProperty("relatedData")] - public MixDatabaseDataAssociations.ImportViewModel RelatedData { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid && Id == 0) - { - IsValid = !Repository.CheckIsExists(m => m.Name == Name && m.Specificulture == Specificulture - , _context, _transaction); - if (!IsValid) - { - Errors.Add("Module Name Existed"); - } - } - } - - public override MixModule ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = ReadListItemViewModel.Repository.Max(m => m.Id, _context, _transaction).Data + 1; - LastModified = DateTime.UtcNow; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - GetAdditionalData(Id.ToString(), MixDatabaseParentType.Module, _context, _transaction); - } - - public override async Task> SaveSubModelsAsync(MixModule parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse { IsSucceed = true }; - - foreach (var item in Data) - { - if (result.IsSucceed) - { - item.Specificulture = parent.Specificulture; - item.ModuleId = parent.Id; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - #region Async - - public override Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - return base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - } - - #endregion Async - - #endregion Overrides - - #region Expand - - public void LoadData(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse> getDataResult = new RepositoryResponse>(); - getDataResult = MixModuleDatas.ReadViewModel.Repository - .GetModelListBy(m => m.ModuleId == Id && m.Specificulture == Specificulture - , "Priority", 0, null, null - , _context, _transaction); - } - - public List GetPostNavs(MixCmsContext context, IDbContextTransaction transaction) - { - return MixModulePosts.ImportViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture && m.ModuleId == Id, - context, transaction).Data; - } - - private void GetAdditionalData(string id, MixDatabaseParentType type, MixCmsContext context, IDbContextTransaction transaction) - { - var getRelatedData = MixDatabaseDataAssociations.ImportViewModel.Repository.GetFirstModel( - m => m.Specificulture == Specificulture && m.ParentType == type - && m.ParentId == id, context, transaction); - if (getRelatedData.IsSucceed) - { - RelatedData = (getRelatedData.Data); - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModules/ReadListItemViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModules/ReadListItemViewModel.cs deleted file mode 100644 index 447ed3dfa..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModules/ReadListItemViewModel.cs +++ /dev/null @@ -1,137 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixModules -{ - public class ReadListItemViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } - - [JsonProperty("type")] - public MixModuleType Type { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - [JsonConverter(typeof(StringEnumConverter))] - public MixContentStatus Status { get; set; } - - #endregion Models - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrWhiteSpace(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => $"/{Specificulture}/module/{Id}/{SeoHelper.GetSEOString(Title)}"; } - - #endregion Properties - - #region Contructors - - public ReadListItemViewModel() : base() - { - } - - public ReadListItemViewModel(MixModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModules/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModules/ReadMvcViewModel.cs deleted file mode 100644 index 2cf714965..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModules/ReadMvcViewModel.cs +++ /dev/null @@ -1,328 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.NetCore.Attributes; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; - -namespace Mix.Cms.Lib.ViewModels.MixModules -{ - [GeneratedController("api/v1/rest/{culture}/mix-module/mvc")] - public class ReadMvcViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } - - [JsonProperty("type")] - public MixModuleType Type { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("columns")] - public List Columns - { - get { return Fields == null ? null : JsonConvert.DeserializeObject>(Fields); } - set { Fields = JsonConvert.SerializeObject(value); } - } - - [JsonProperty("view")] - public MixTemplates.ReadListItemViewModel View { get; set; } - - [JsonProperty("formView")] - public MixTemplates.ReadListItemViewModel FormView { get; set; } - - [JsonProperty("edmView")] - public MixTemplates.ReadListItemViewModel EdmView { get; set; } - - [JsonProperty("data")] - public PaginationModel Data { get; set; } = new PaginationModel(); - - [JsonProperty("posts")] - public PaginationModel Posts { get; set; } = new PaginationModel(); - - public string TemplatePath - { - get - { - return $"/{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, Specificulture) ?? "Default"}/" + - $"{Template}"; - } - } - - public string FormTemplatePath - { - get - { - return $"/{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, Specificulture) ?? "Default"}/" + - $"{FormTemplate}"; - } - } - - public string EdmTemplatePath - { - get - { - return $"/{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, Specificulture) ?? "Default"}/" + - $"{EdmTemplate}"; - } - } - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.ReadMvcViewModel AttributeData { get; set; } - - #endregion Views - - public int? PostId { get; set; } - public int? PageId { get; set; } - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //Load Template + Style + Scripts for views - this.View = MixTemplates.ReadListItemViewModel.GetTemplateByPath(Template, Specificulture, _context, _transaction).Data; - this.FormView = MixTemplates.ReadListItemViewModel.GetTemplateByPath(FormTemplate, Specificulture, _context, _transaction).Data; - this.EdmView = MixTemplates.ReadListItemViewModel.GetTemplateByPath(EdmTemplate, Specificulture, _context, _transaction).Data; - // call load data from controller for padding parameter (postId, productId, ...) - LoadAttributes(_context, _transaction); - } - - #endregion Overrides - - #region Expand - - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getAttrs = MixDatabases.UpdateViewModel.Repository.GetSingleModel(m => m.Name == MixConstants.MixDatabaseName.ADDITIONAL_FIELD_MODULE, _context, _transaction); - if (getAttrs.IsSucceed) - { - AttributeData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetFirstModel( - a => a.ParentId == Id.ToString() && a.Specificulture == Specificulture && a.MixDatabaseId == getAttrs.Data.Id - , _context, _transaction).Data; - } - } - - public static RepositoryResponse GetBy( - Expression> predicate, int? postId = null, int? productid = null, int pageId = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = Repository.GetSingleModel(predicate, _context, _transaction); - if (result.IsSucceed) - { - result.Data.PostId = postId; - result.Data.PageId = pageId; - result.Data.LoadData(); - } - return result; - } - - public void LoadData(int? postId = null, int? productId = null, int? pageId = null - , int? pageSize = null, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - pageSize = pageSize > 0 ? pageSize : PageSize; - pageIndex = pageIndex > 0 ? pageIndex : 0; - Expression> dataExp = null; - Expression> postExp = null; - switch (Type) - { - case MixModuleType.Content: - case MixModuleType.Data: - dataExp = m => m.ModuleId == Id && m.Specificulture == Specificulture; - //postExp = n => n.ModuleId == Id && n.Specificulture == Specificulture; - //productExp = m => m.ModuleId == Id && m.Specificulture == Specificulture; - break; - - case MixModuleType.ListPost: - postExp = n => n.ModuleId == Id && n.Specificulture == Specificulture; - break; - - default: - dataExp = m => m.ModuleId == Id && m.Specificulture == Specificulture; - postExp = n => n.ModuleId == Id && n.Specificulture == Specificulture; - break; - } - - if (dataExp != null) - { - var getDataResult = MixModuleDatas.ReadViewModel.Repository - .GetModelListBy( - dataExp - , MixService.GetConfig(MixAppSettingKeywords.OrderBy - ), 0 - , pageSize, pageIndex - , _context: context, _transaction: transaction); - if (getDataResult.IsSucceed) - { - //getDataResult.Data.JsonItems = new List(); - //getDataResult.Data.Items.ForEach(d => getDataResult.Data.JsonItems.Add(d.JItem)); - Data = getDataResult.Data; - } - } - if (postExp != null) - { - var getPosts = MixModulePosts.ReadViewModel.Repository - .GetModelListBy(postExp - , MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - , pageSize, pageIndex - , _context: context, _transaction: transaction); - if (getPosts.IsSucceed) - { - Posts = getPosts.Data; - } - } - } - catch (Exception ex) - { - UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public bool HasValue(string fieldName) - { - return AttributeData != null && AttributeData.Data.Obj.GetValue(fieldName) != null; - } - - public T Property(string fieldName) - { - return MixCmsHelper.Property(AttributeData?.Data?.Obj, fieldName); - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixModules/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixModules/UpdateViewModel.cs deleted file mode 100644 index 101e4f45a..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixModules/UpdateViewModel.cs +++ /dev/null @@ -1,491 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixModules -{ - //Use for update module info only => don't need to load data - public class UpdateViewModel : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("formTemplate")] - public string FormTemplate { get; set; } - - [JsonProperty("edmTemplate")] - public string EdmTemplate { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("fields")] - public string Fields { get; set; } - - [JsonProperty("type")] - public MixModuleType Type { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("data")] - public PaginationModel Data { get; set; } = new PaginationModel(); - - [JsonProperty("columns")] - public List Columns { get; set; } - - #region Template - - [JsonProperty("templates")] - public List Templates { get; set; }// Post Templates - - [JsonIgnore] - public string TemplateFolderType - { - get - { - return MixTemplateFolders.Modules; - } - } - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonIgnore] - public int ActivedTheme - { - get - { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string ThemeFolderType { get { return MixTemplateFolders.Modules.ToString(); } } - - [JsonProperty("templateFolder")] - public string TemplateFolder - { - get - { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{ThemeFolderType}"; - } - } - - #endregion Template - - #region Form - - [JsonProperty("forms")] - public List Forms { get; set; }// Post Forms - - [JsonIgnore] - public string FormFolderType - { - get - { - return MixTemplateFolders.Forms.ToString(); - } - } - - [JsonProperty("formView")] - public MixTemplates.UpdateViewModel FormView { get; set; } - - [JsonProperty("formFolder")] - public string FormFolder - { - get - { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Forms}"; - } - } - - #endregion Form - - #region Edm - - [JsonProperty("edms")] - public List Edms { get; set; }// Post Edms - - [JsonIgnore] - public string EdmFolderType - { - get - { - return MixTemplateFolders.Edms.ToString(); - } - } - - [JsonProperty("edmView")] - public MixTemplates.UpdateViewModel EdmView { get; set; } - - [JsonProperty("edmFolder")] - public string EdmFolder - { - get - { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Edms}"; - } - } - - #endregion Edm - - //Parent Post Id - [JsonProperty("postId")] - public string PostId { get; set; } - - //Parent Category Id - [JsonProperty("pageId")] - public int PageId { get; set; } - - public List UrlAliases { get; set; } - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid && Id == 0) - { - IsValid = !Repository.CheckIsExists(m => m.Name == Name && m.Specificulture == Specificulture - , _context, _transaction); - if (!IsValid) - { - Errors.Add("Module Name Existed"); - } - } - } - - public override MixModule ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = ReadListItemViewModel.Repository.Max(m => m.Id, _context, _transaction).Data + 1; - LastModified = DateTime.UtcNow; - CreatedDateTime = DateTime.UtcNow; - } - Template = View != null ? $"{View.FolderType}/{View.FileName}{View.Extension}" : Template; - FormTemplate = FormView != null ? $"{FormView.FolderType}/{FormView.FileName}{FormView.Extension}" : FormTemplate; - EdmTemplate = EdmView != null ? $"{EdmView.FolderType}/{EdmView.FileName}{EdmView.Extension}" : EdmTemplate; - - var arrField = Columns != null ? JArray.Parse( - Newtonsoft.Json.JsonConvert.SerializeObject(Columns.OrderBy(c => c.Priority).Where( - c => !string.IsNullOrEmpty(c.Name)))) : new JArray(); - Fields = arrField.ToString(Newtonsoft.Json.Formatting.None); - if (!string.IsNullOrEmpty(Image) && Image[0] == '/') { Image = Image.Substring(1); } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = MixModules.Helper.LoadCultures(Id, Specificulture, _context, _transaction); - Cultures.ForEach(c => c.IsSupported = _context.MixModule.Any(m => m.Id == Id && m.Specificulture == c.Specificulture)); - Columns = new List(); - JArray arrField = !string.IsNullOrEmpty(Fields) ? JArray.Parse(Fields) : new JArray(); - foreach (var field in arrField) - { - ModuleFieldViewModel thisField = new ModuleFieldViewModel() - { - Name = CommonHelper.ParseJsonPropertyName(field["name"].ToString()), - Title = field["title"]?.ToString(), - Options = field["options"] != null ? field["options"].Value() : new JArray(), - Priority = field["priority"] != null ? field["priority"].Value() : 0, - DataType = (MixDataType)(int)field["dataType"], - Width = field["width"] != null ? field["width"].Value() : 3, - IsUnique = field["isUnique"] != null ? field["isUnique"].Value() : true, - IsRequired = field["isRequired"] != null ? field["isRequired"].Value() : true, - IsDisplay = field["isDisplay"] != null ? field["isDisplay"].Value() : true, - IsSelect = field["isSelect"] != null ? field["isSelect"].Value() : false, - IsGroupBy = field["isGroupBy"] != null ? field["isGroupBy"].Value() : false, - }; - Columns.Add(thisField); - } - - this.Templates = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.TemplateFolderType, _context, _transaction).Data; - var templateName = Template?.Substring(Template.LastIndexOf('/') + 1) ?? MixConstants.DefaultTemplate.Module; - this.View = Templates.FirstOrDefault(t => !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}")); - this.View ??= Templates.FirstOrDefault(); - this.Template = $"{View?.FileFolder}/{View?.FileName}{View?.Extension}"; - - this.Forms = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.FormFolderType - , _context, _transaction).Data; - this.FormView = MixTemplates.UpdateViewModel.GetTemplateByPath(FormTemplate, Specificulture, MixTemplateFolders.Forms, _context, _transaction); - this.FormTemplate = $"{FormView?.FileFolder}/{FormView?.FileName}{View?.Extension}"; - - this.Edms = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.EdmFolderType - , _context, _transaction).Data; - this.EdmView = MixTemplates.UpdateViewModel.GetTemplateByPath(EdmTemplate, Specificulture, MixTemplateFolders.Edms, _context, _transaction); - this.EdmTemplate = $"{EdmView?.FileFolder}/{EdmView?.FileName}{View?.Extension}"; - } - - #region Async - - public override Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - return base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - } - - public override async Task> SaveSubModelsAsync(MixModule parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse { IsSucceed = true }; - - if (View.Id == 0) - { - var saveViewResult = await View.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveViewResult, ref result); - } - - if (FormView.Id == 0 && result.IsSucceed && !string.IsNullOrEmpty(FormView.Content)) - { - var saveResult = await FormView.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - if (EdmView.Id == 0 && result.IsSucceed && !string.IsNullOrEmpty(EdmView.Content)) - { - var saveResult = await EdmView.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expand - - public static async Task> SaveByModuleName(string culture, string createdBy, string name, string formName, JObject obj - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var getModule = await Repository.GetSingleModelAsync(m => m.Specificulture == culture && m.Name == name, context, transaction); - string dataId = obj["id"]?.Value(); - if (getModule.IsSucceed) - { - // Get Attribute set - var getAttrSet = await Lib.ViewModels.MixDatabases.ReadViewModel.Repository.GetSingleModelAsync(m => m.Name == formName, context, transaction); - if (getAttrSet.IsSucceed) - { - // Save attr data + navigation - MixDatabaseDatas.UpdateViewModel data = new MixDatabaseDatas.UpdateViewModel() - { - Id = dataId, - CreatedBy = createdBy, - MixDatabaseId = getAttrSet.Data.Id, - MixDatabaseName = getAttrSet.Data.Name, - Specificulture = culture, - Data = obj - }; - - // Create navigation module - attr data - var getNavigation = await MixDatabaseDataAssociations.ReadViewModel.Repository.GetSingleModelAsync( - m => m.ParentId == getModule.Data.Id.ToString() && m.ParentType == MixDatabaseParentType.Module && m.Specificulture == culture - , context, transaction); - if (!getNavigation.IsSucceed) - { - data.RelatedData.Add(new MixDatabaseDataAssociations.UpdateViewModel() - { - ParentId = getModule.Data.Id.ToString(), - Specificulture = culture, - ParentType = MixDatabaseParentType.Module - }); - } - var portalResult = await data.SaveModelAsync(true, context, transaction); - UnitOfWorkHelper.HandleTransaction(portalResult.IsSucceed, isRoot, transaction); - - return new RepositoryResponse() - { - IsSucceed = portalResult.IsSucceed, - Data = portalResult.Data?.Data, - Exception = portalResult.Exception, - Errors = portalResult.Errors - }; - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Status = (int)MixResponseStatus.BadRequest - }; - } - } - else - { - return new RepositoryResponse() - { - IsSucceed = false, - Status = (int)MixResponseStatus.BadRequest - }; - } - } - catch (Exception ex) - { - return (UnitOfWorkHelper.HandleException(ex, isRoot, transaction)); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public void LoadData(int? postId = null, int? productId = null, int? pageId = null - , int? pageSize = null, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse> getDataResult = new RepositoryResponse>(); - - switch (Type) - { - case MixModuleType.Content: - getDataResult = MixModuleDatas.ReadViewModel.Repository - .GetModelListBy(m => m.ModuleId == Id && m.Specificulture == Specificulture - , "Priority", 0, pageSize, pageIndex - , _context, _transaction); - break; - - default: - break; - } - - if (getDataResult.IsSucceed) - { - //getDataResult.Data.JsonItems = new List(); - //getDataResult.Data.Items.ForEach(d => getDataResult.Data.JsonItems.Add(d.JItem)); - Data = getDataResult.Data; - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPageModules/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPageModules/ImportViewModel.cs deleted file mode 100644 index ca4fbf900..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPageModules/ImportViewModel.cs +++ /dev/null @@ -1,87 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPageModules -{ - public class ImportViewModel - : ViewModelBase - { - public ImportViewModel(MixPageModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ImportViewModel() : base() - { - } - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("module")] - public MixModules.ImportViewModel Module { get; set; } - - #endregion Views - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getModule = MixModules.ImportViewModel.Repository.GetSingleModel(p => p.Id == ModuleId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getModule.IsSucceed) - { - Module = getModule.Data; - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPageModules/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPageModules/ReadMvcViewModel.cs deleted file mode 100644 index 016660226..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPageModules/ReadMvcViewModel.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPageModules -{ - public class ReadMvcViewModel - : ViewModelBase - { - public ReadMvcViewModel(MixPageModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadMvcViewModel() : base() - { - } - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("module")] - public MixModules.ReadMvcViewModel Module { get; set; } - - #endregion Views - - #region overrides - - public override MixPageModule ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getModule = MixModules.ReadMvcViewModel.Repository.GetSingleModel(p => p.Id == ModuleId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getModule.IsSucceed) - { - Module = getModule.Data; - //Module.LoadData(); - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixPagePosts/Helper.cs deleted file mode 100644 index 2ba5323eb..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/Helper.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPagePosts -{ - public class Helper - { - public static RepositoryResponse> GetNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixPage.Include(cp => cp.MixPagePost).Where(a => a.Specificulture == specificulture - && (a.Type == MixPageType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixPagePosts.ReadViewModel( - new MixPagePost() - { - PostId = postId, - PageId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixPagePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static RepositoryResponse> GetActivedNavAsync( - int? postId - , int? pageId = null - , string specificulture = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - if (postId.HasValue || pageId.HasValue) - { - specificulture = specificulture ?? MixService.GetConfig("DefaultCulture"); - var result = DefaultRepository.Instance.GetModelListBy( - m => (!postId.HasValue || m.PostId == postId.Value) - && (!pageId.HasValue || m.PageId == pageId.Value) - && m.Specificulture == specificulture, _context, _transaction); - return result; - } - else - { - return new RepositoryResponse>(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ImportViewModel.cs deleted file mode 100644 index 0e5127542..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ImportViewModel.cs +++ /dev/null @@ -1,164 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPagePosts -{ - public class ImportViewModel - : ViewModelBase - { - public ImportViewModel(MixPagePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ImportViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("post")] - public MixPosts.ImportViewModel Post { get; set; } - - [JsonProperty("page")] - public MixPages.ImportViewModel Page { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override MixPagePost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ImportViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - } - - #endregion overrides - - #region Expand - - public static RepositoryResponse> GetPagePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixPage.Include(cp => cp.MixPagePost).Where(a => a.Specificulture == specificulture - && (a.Type == MixPageType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixPagePosts.ImportViewModel( - new MixPagePost() - { - PostId = postId, - PageId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixPagePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadMvcViewModel.cs deleted file mode 100644 index 954cc214e..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadMvcViewModel.cs +++ /dev/null @@ -1,176 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPagePosts -{ - public class ReadMvcViewModel - : ViewModelBase - { - public ReadMvcViewModel(MixPagePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadMvcViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("post")] - public MixPosts.ReadListItemViewModel Post { get; set; } - - [JsonProperty("page")] - public MixPages.ReadViewModel Page { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override MixPagePost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - #endregion overrides - - #region Expand - - public void LoadPage(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPage = MixPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == PageId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPage.IsSucceed) - { - Page = getPage.Data; - } - } - - public void LoadPost(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ReadListItemViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - } - - public static RepositoryResponse> GetPagePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixPage.Include(cp => cp.MixPagePost).Where(a => a.Specificulture == specificulture - && (a.Type == MixPageType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixPagePosts.ReadViewModel( - new MixPagePost() - { - PostId = postId, - PageId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixPagePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadViewModel.cs deleted file mode 100644 index 2cddf5986..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPagePosts/ReadViewModel.cs +++ /dev/null @@ -1,196 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPagePosts -{ - public class ReadViewModel - : ViewModelBase - { - public ReadViewModel(MixPagePost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("post")] - public MixPosts.ReadListItemViewModel Post { get; set; } - - [JsonProperty("page")] - public MixPages.ReadViewModel Page { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - IsValid = !_context.MixPagePost.Any(m => m.PostId == PostId && m.PageId == PageId - && m.Id != Id && m.Specificulture == Specificulture); - if (!IsValid) - { - Errors.Add("Existed"); - } - } - } - - public override MixPagePost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //this.LoadPost(_context, _transaction); - //this.LoadPage(_context, _transaction); - } - - #endregion overrides - - #region Expand - - public void LoadPage(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPage = MixPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == PageId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPage.IsSucceed) - { - Page = getPage.Data; - } - } - - public void LoadPost(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ReadListItemViewModel.Repository.GetSingleModel(p => p.Id == PostId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getPost.IsSucceed) - { - Post = getPost.Data; - } - } - - public static RepositoryResponse> GetPagePostNavAsync(int postId, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var navCategoryPostViewModels = context.MixPage.Include(cp => cp.MixPagePost).Where(a => a.Specificulture == specificulture - && (a.Type == MixPageType.ListPost) - ) - .AsEnumerable() - .Select(p => new MixPagePosts.ReadViewModel( - new MixPagePost() - { - PostId = postId, - PageId = p.Id, - Specificulture = specificulture - }, - _context, _transaction) - { - IsActived = p.MixPagePost.Any(cp => cp.PostId == postId && cp.Specificulture == specificulture), - Description = p.Title - }); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = navCategoryPostViewModels.ToList() - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - if (isRoot) - { - transaction.Rollback(); - } - return new RepositoryResponse>() - { - IsSucceed = true, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/DeleteViewModel.cs deleted file mode 100644 index 08b624c4e..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/DeleteViewModel.cs +++ /dev/null @@ -1,258 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("updatedDateTime")] - public DateTime? UpdatedDateTime { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("moduleNavs")] - public List ModuleNavs { get; set; } // Parent to Modules - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("imageFileStream")] - public FileStreamViewModel ImageFileStream { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - #region Template - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonProperty("templates")] - public List Templates { get; set; } - - [JsonProperty("master")] - public MixTemplates.UpdateViewModel Master { get; set; } - - [JsonProperty("masters")] - public List Masters { get; set; } - - [JsonIgnore] - public int ActivedTheme { - get { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string TemplateFolderType { - get { - return MixTemplateFolders.Pages; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Pages}"; - } - } - - #endregion Template - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("attributes")] - public MixDatabases.UpdateViewModel Attributes { get; set; } - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.UpdateViewModel AttributeData { get; set; } - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Async - - public override async Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse { IsSucceed = true }; - var navPosts = _context.MixPagePost.Where(m => m.PageId == Id && m.Specificulture == Specificulture); - await navPosts.ForEachAsync(m => _context.Entry(m).State = EntityState.Deleted); - var navModls = _context.MixPageModule.Where(m => m.PageId == Id && m.Specificulture == Specificulture); - await navModls.ForEachAsync(m => _context.Entry(m).State = EntityState.Deleted); - await _context.SaveChangesAsync(); - var removeRelatedData = await MixDatabaseDataAssociations.Helper.RemoveRelatedDataAsync( - Id.ToString(), MixDatabaseParentType.Page - , Specificulture - , _context, _transaction); - ViewModelHelper.HandleResult(removeRelatedData, ref result); - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/Helper.cs deleted file mode 100644 index 84e5877e4..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/Helper.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Domain.Core.Models; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class Helper - { - public static List LoadCultures(int id, string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixPage.Any(p => p.Id == id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/ImportViewModel.cs deleted file mode 100644 index f06be9175..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/ImportViewModel.cs +++ /dev/null @@ -1,191 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("isExportData")] - public bool IsExportData { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } = "default"; - - [JsonProperty("relatedData")] - public MixDatabaseDataAssociations.ImportViewModel RelatedData { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - GetAdditionalData(Id.ToString(), MixDatabaseParentType.Page, _context, _transaction); - } - - #endregion Overrides - - #region Expands - - public List GetAliases(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixUrlAliases.UpdateViewModel.Repository.GetModelListBy(p => p.Specificulture == Specificulture - && p.SourceId == Id.ToString() && p.Type == (int)MixUrlAliasType.Page, context, transaction); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return new List(); - } - } - - public List GetModuleNavs(MixCmsContext context, IDbContextTransaction transaction) - { - return MixPageModules.ImportViewModel.Repository.GetModelListBy( - module => module.Specificulture == Specificulture && module.PageId == Id, - context, transaction).Data; - } - - public List GetPostNavs(MixCmsContext context, IDbContextTransaction transaction) - { - return MixPagePosts.ImportViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture && m.PageId == Id, - context, transaction).Data; - } - - private void GetAdditionalData(string id, MixDatabaseParentType type, MixCmsContext context, IDbContextTransaction transaction) - { - var getRelatedData = MixDatabaseDataAssociations.ImportViewModel.Repository.GetFirstModel( - m => m.Specificulture == Specificulture && m.ParentType == type - && m.ParentId == id, context, transaction); - if (getRelatedData.IsSucceed) - { - RelatedData = (getRelatedData.Data); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadListItemViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/ReadListItemViewModel.cs deleted file mode 100644 index d64436d8b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadListItemViewModel.cs +++ /dev/null @@ -1,185 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class ReadListItemViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("totalPost")] - public int TotalPost { get; set; } - - [JsonProperty("totalProduct")] - public int TotalProduct { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadListItemViewModel() : base() - { - } - - public ReadListItemViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var countPost = MixPagePosts.ReadViewModel.Repository.Count(c => c.PageId == Id && c.Specificulture == Specificulture - , _context: _context, _transaction: _transaction); - - if (countPost.IsSucceed) - { - TotalPost = countPost.Data; - } - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/ReadMvcViewModel.cs deleted file mode 100644 index 48f9999e7..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadMvcViewModel.cs +++ /dev/null @@ -1,444 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Interfaces; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.NetCore.Attributes; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - [GeneratedController("api/v1/rest/{culture}/mix-page/mvc")] - public class ReadMvcViewModel : ViewModelBase, IMvcViewModel - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("details")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/page/{SeoName}" : null; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("view")] - public MixTemplates.ReadListItemViewModel View { get; set; } - - [JsonProperty("posts")] - public PaginationModel Posts { get; set; } = new PaginationModel(); - - [JsonProperty("modules")] - public List Modules { get; set; } = new List(); // Get All Module - - public string TemplatePath - { - get - { - return $"/{MixFolders.TemplatesFolder}/{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, Specificulture)}/{Template}"; - } - } - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.ReadMvcViewModel AttributeData { get; set; } - - [JsonProperty("bodyClass")] - public string BodyClass => CssClass; - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - this.View = MixTemplates.ReadListItemViewModel.GetTemplateByPath(Template, Specificulture, _context, _transaction).Data; - if (View != null) - { - GetSubModules(_context, _transaction); - } - LoadAttributes(_context, _transaction); - } - - #endregion Overrides - - #region Expands - - #region Sync - - public void LoadData(int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - pageSize = pageSize > 0 ? pageSize : PageSize; - pageIndex = pageIndex > 0 ? pageIndex : 0; - Expression> dataExp = null; - Expression> postExp = null; - foreach (var item in Modules) - { - item.Module.LoadData(_context: context, _transaction: transaction); - } - switch (Type) - { - case MixPageType.ListPost: - postExp = n => n.PageId == Id && n.Specificulture == Specificulture; - break; - - default: - dataExp = m => m.PageId == Id && m.Specificulture == Specificulture; - postExp = n => n.PageId == Id && n.Specificulture == Specificulture; - break; - } - - if (postExp != null) - { - var getPosts = MixPagePosts.ReadViewModel.Repository - .GetModelListBy(postExp - , MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - , pageSize, pageIndex - , _context: context, _transaction: transaction); - if (getPosts.IsSucceed) - { - Posts = getPosts.Data; - Posts.Items.ForEach(m => m.LoadPost(context, transaction)); - } - } - } - catch (Exception ex) - { - UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public void LoadDataByTag(string tagName - , string orderBy, int orderDirection - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - pageSize = pageSize > 0 ? pageSize : PageSize; - pageIndex = pageIndex ?? 0; - Expression> postExp = null; - JObject obj = new JObject(new JProperty("text", tagName)); - - postExp = n => n.Tags.Contains(obj.ToString(Newtonsoft.Json.Formatting.None)) && n.Specificulture == Specificulture; - - if (postExp != null) - { - var getPosts = MixPosts.ReadListItemViewModel.Repository - .GetModelListBy(postExp - , MixService.GetConfig(orderBy), 0 - , pageSize, pageIndex - , _context: context, _transaction: transaction); - if (getPosts.IsSucceed) - { - Posts.Items = new List(); - Posts.PageIndex = getPosts.Data.PageIndex; - Posts.PageSize = getPosts.Data.PageSize; - Posts.TotalItems = getPosts.Data.TotalItems; - Posts.TotalPage = getPosts.Data.TotalPage; - foreach (var post in getPosts.Data.Items) - { - Posts.Items.Add(new MixPagePosts.ReadViewModel() - { - PageId = Id, - PostId = post.Id, - Post = post - }); - } - } - } - } - catch (Exception ex) - { - UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public void LoadDataByKeyword(string keyword - , string orderBy, int orderDirection - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - pageSize = pageSize > 0 ? pageSize : PageSize; - pageIndex = pageIndex ?? 0; - Expression> postExp = null; - - postExp = n => n.Title.Contains(keyword) && n.Specificulture == Specificulture; - - if (postExp != null) - { - var getPosts = MixPosts.ReadListItemViewModel.Repository - .GetModelListBy(postExp - , MixService.GetConfig(orderBy), 0 - , pageSize, pageIndex - , _context: context, _transaction: transaction); - if (getPosts.IsSucceed) - { - Posts.Items = new List(); - Posts.PageIndex = getPosts.Data.PageIndex; - Posts.PageSize = getPosts.Data.PageSize; - Posts.TotalItems = getPosts.Data.TotalItems; - Posts.TotalPage = getPosts.Data.TotalPage; - foreach (var post in getPosts.Data.Items) - { - Posts.Items.Add(new MixPagePosts.ReadViewModel() - { - PageId = Id, - PostId = post.Id, - Post = post - }); - } - } - } - } - catch (Exception ex) - { - UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private void GetSubModules(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getNavs = MixPageModules.ReadMvcViewModel.Repository.GetModelListBy( - m => m.PageId == Id && m.Specificulture == Specificulture - , _context, _transaction); - if (getNavs.IsSucceed) - { - Modules = getNavs.Data; - StringBuilder scripts = new StringBuilder(); - StringBuilder styles = new StringBuilder(); - foreach (var nav in getNavs.Data.OrderBy(n => n.Priority).ToList()) - { - string script = $" {nav.Module.View?.Scripts} "; - string style = $" {nav.Module.View?.Styles} "; - scripts.Append(script); - styles.Append(style); - } - View.Scripts += scripts.ToString(); - View.Styles += styles.ToString(); - } - } - - private void GetSubPosts(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPosts = MixPagePosts.ReadViewModel.Repository.GetModelListBy( - n => n.PageId == Id && n.Specificulture == Specificulture, - MixService.GetConfig(MixAppSettingKeywords.OrderBy), 0 - , 4, 0 - , _context: _context, _transaction: _transaction - ); - if (getPosts.IsSucceed) - { - Posts = getPosts.Data; - } - } - - #endregion Sync - - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getAttrs = MixDatabases.UpdateViewModel.Repository.GetSingleModel(m => m.Name == MixConstants.MixDatabaseName.ADDITIONAL_FIELD_PAGE, _context, _transaction); - if (getAttrs.IsSucceed) - { - AttributeData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetFirstModel( - a => a.ParentId == Id.ToString() && a.Specificulture == Specificulture && a.MixDatabaseId == getAttrs.Data.Id - , _context, _transaction).Data; - } - } - - public MixModules.ReadMvcViewModel GetModule(string name) - { - return Modules.FirstOrDefault(m => m.Module.Name == name)?.Module; - } - - public bool HasValue(string fieldName) - { - return AttributeData != null && AttributeData.Data.Obj.GetValue(fieldName) != null; - } - - public T Property(string fieldName) - { - return MixCmsHelper.Property(AttributeData?.Data?.Obj, fieldName); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/ReadViewModel.cs deleted file mode 100644 index 5677e1d61..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/ReadViewModel.cs +++ /dev/null @@ -1,234 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1)) - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("childs")] - public List Childs { get; set; } - - [JsonProperty("totalPost")] - public int TotalPost { get; set; } - - [JsonProperty("totalProduct")] - public int TotalProduct { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/page/{SeoName}" : null; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var countPost = MixPagePosts.ReadViewModel.Repository.Count(c => c.PageId == Id && c.Specificulture == Specificulture - , _context: _context, _transaction: _transaction); - - if (countPost.IsSucceed) - { - TotalPost = countPost.Data; - } - } - - #endregion Overrides - - #region Expands - - public static async Task>> UpdateInfosAsync(List cates) - { - MixCmsContext context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - var result = new RepositoryResponse>(); - try - { - foreach (var item in cates) - { - item.LastModified = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, context, transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Errors.AddRange(saveResult.Errors); - result.Exception = saveResult.Exception; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - UnitOfWorkHelper.HandleException(ex, true, transaction); - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPages/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPages/UpdateViewModel.cs deleted file mode 100644 index ce713c249..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPages/UpdateViewModel.cs +++ /dev/null @@ -1,473 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPages -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("cssClass")] - public string CssClass { get; set; } - - [JsonProperty("layout")] - public string Layout { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public MixPageType Type { get; set; } = MixPageType.ListPost; - - [JsonProperty("tags")] - public string Tags { get; set; } - - [JsonProperty("staticUrl")] - public string StaticUrl { get; set; } - - [JsonProperty("level")] - public int? Level { get; set; } - - [JsonProperty("pageSize")] - public int? PageSize { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/page/{SeoName}" : null; } - - [JsonProperty("moduleNavs")] - public List ModuleNavs { get; set; } // Parent to Modules - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("imageFileStream")] - public FileStreamViewModel ImageFileStream { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - #region Template - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonProperty("templates")] - public List Templates { get; set; } - - [JsonProperty("master")] - public MixTemplates.UpdateViewModel Master { get; set; } - - [JsonProperty("masters")] - public List Masters { get; set; } - - [JsonIgnore] - public int ActivedTheme { - get { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string TemplateFolderType { - get { - return MixTemplateFolders.Pages.ToString(); - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Pages}"; - } - } - - #endregion Template - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixPage ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - GenerateSEO(_context, _transaction); - - Template = View != null ? $"{View.FolderType}/{View.FileName}{View.Extension}" : Template; - Layout = Master != null ? $"{Master.FolderType}/{Master.FileName}{Master.Extension}" : null; - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - LastModified = DateTime.UtcNow; - if (!string.IsNullOrEmpty(Image) && Image[0] == '/') { Image = Image.Substring(1); } - if (!string.IsNullOrEmpty(Thumbnail) && Thumbnail[0] == '/') { Thumbnail = Thumbnail.Substring(1); } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = Helper.LoadCultures(Id, Specificulture, _context, _transaction); - if (!string.IsNullOrEmpty(this.Tags)) - { - ListTag = JArray.Parse(this.Tags); - } - - // Load page views - this.Templates = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.TemplateFolderType, _context, _transaction).Data; - var templateName = Template?.Substring(Template.LastIndexOf('/') + 1) ?? MixConstants.DefaultTemplate.Page; - this.View = Templates.FirstOrDefault(t => !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}")); - if (this.View == null) - { - this.View = Templates.FirstOrDefault(t => MixConstants.DefaultTemplate.Module.Equals($"{t.FileName}{t.Extension}")); - } - this.Template = $"{View?.FileFolder}/{View?.FileName}{View.Extension}"; - // Load Attributes - // Load master views - this.Masters = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == MixTemplateFolders.Masters.ToString(), _context, _transaction).Data; - var masterName = Layout?.Substring(Layout.LastIndexOf('/') + 1) ?? MixConstants.DefaultTemplate.Master; - this.Master = Masters.FirstOrDefault(t => !string.IsNullOrEmpty(masterName) && masterName.Equals($"{t.FileName}{t.Extension}")); - if (this.Master == null) - { - this.Master = Masters.FirstOrDefault(t => MixConstants.DefaultTemplate.Master.Equals($"{t.FileName}{t.Extension}")); - } - this.Layout = $"{Master?.FileFolder}/{Master?.FileName}{Master?.Extension}"; - - this.ModuleNavs = GetModuleNavs(_context, _transaction); - this.UrlAliases = GetAliases(_context, _transaction); - } - - #region Sync - - public override RepositoryResponse SaveSubModels(MixPage parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse { IsSucceed = true }; - if (View.Id == 0) - { - var saveTemplate = View.SaveModel(true, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - if (result.IsSucceed && Master != null) - { - var saveLayout = Master.SaveModel(true, _context, _transaction); - ViewModelHelper.HandleResult(saveLayout, ref result); - } - if (result.IsSucceed && UrlAliases != null) - { - foreach (var item in UrlAliases) - { - if (result.IsSucceed) - { - item.SourceId = parent.Id.ToString(); - item.Type = MixUrlAliasType.Page; - item.Specificulture = Specificulture; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - if (result.IsSucceed) - { - foreach (var item in ModuleNavs) - { - item.PageId = parent.Id; - - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - } - return result; - } - - #endregion Sync - - #region Async - - public override async Task> SaveSubModelsAsync(MixPage parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse { IsSucceed = true }; - - if (View.Id == 0) - { - var saveTemplate = await View.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - - if (result.IsSucceed && Master != null) - { - var saveLayout = Master.SaveModel(true, _context, _transaction); - ViewModelHelper.HandleResult(saveLayout, ref result); - } - if (result.IsSucceed && UrlAliases != null) - { - foreach (var item in UrlAliases) - { - if (result.IsSucceed) - { - item.SourceId = parent.Id.ToString(); - item.Type = MixUrlAliasType.Page; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - } - if (result.IsSucceed) - { - foreach (var item in ModuleNavs) - { - item.PageId = parent.Id; - - if (item.IsActived) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - } - - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expands - - private void GenerateSEO(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(this.SeoName)) - { - this.SeoName = SeoHelper.GetSEOString(this.Title); - } - int i = 1; - string name = SeoName; - while (Repository.CheckIsExists(a => a.SeoName == name && a.Specificulture == Specificulture && a.Id != Id - , _context, _transaction)) - { - name = SeoName + "_" + i; - i++; - } - SeoName = name; - - if (string.IsNullOrEmpty(this.SeoTitle)) - { - this.SeoTitle = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoDescription)) - { - this.SeoDescription = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoKeywords)) - { - this.SeoKeywords = SeoHelper.GetSEOString(this.Title); - } - } - - public List GetAliases(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixUrlAliases.UpdateViewModel.Repository.GetModelListBy(p => p.Specificulture == Specificulture - && p.SourceId == Id.ToString() && p.Type == (int)MixUrlAliasType.Page, context, transaction); - if (result.IsSucceed && result.Data != null) - { - return result.Data; - } - else - { - return new List(); - } - } - - public List GetModuleNavs(MixCmsContext context, IDbContextTransaction transaction) - { - // Load Actived Modules - var result = MixPageModules.ReadMvcViewModel.Repository.GetModelListBy(m => m.PageId == Id && m.Specificulture == Specificulture - , context, transaction).Data; - result.ForEach(nav => - { - nav.IsActived = true; - }); - var moduleids = result.Select(m => m.ModuleId); - // Load inactived modules - var otherModules = MixModules.ReadListItemViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture && !moduleids.Any(r => r == m.Id) - , context, transaction).Data; - foreach (var item in otherModules) - { - result.Add(new MixPageModules.ReadMvcViewModel() - { - Specificulture = Specificulture, - PageId = Id, - ModuleId = item.Id, - Image = item.ImageUrl, - Description = item.Title - }); - } - return result.OrderBy(m => m.Priority).ToList(); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadPermissionViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadPermissionViewModel.cs deleted file mode 100644 index 264bc95a2..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadPermissionViewModel.cs +++ /dev/null @@ -1,140 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPagePortalPages -{ - public class ReadPermissionViewModel - : ViewModelBase - { - public ReadPermissionViewModel(MixPortalPageNavigation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadPermissionViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("parentId")] - public int ParentId { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("page")] - public MixPortalPages.ReadRolePermissionViewModel Page { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPage = MixPortalPages.ReadRolePermissionViewModel.Repository.GetSingleModel(p => p.Id == PageId - , _context, _transaction - ); - if (getPage.IsSucceed) - { - Page = getPage.Data; - } - } - - #endregion overrides - - #region Expands - - public static async System.Threading.Tasks.Task>> UpdateInfosAsync(List cates) - { - MixCmsContext context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - var result = new RepositoryResponse>(); - try - { - foreach (var item in cates) - { - var saveResult = await item.SaveModelAsync(false, context, transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Errors.AddRange(saveResult.Errors); - result.Exception = saveResult.Exception; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - UnitOfWorkHelper.HandleException(ex, true, transaction); - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadViewModel.cs deleted file mode 100644 index 2923f82a8..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/ReadViewModel.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPagePortalPages -{ - public class ReadViewModel - : ViewModelBase - { - public ReadViewModel(MixPortalPageNavigation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("parentId")] - public int ParentId { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("page")] - public MixPortalPages.ReadViewModel Page { get; set; } - - [JsonProperty("parent")] - public MixPortalPages.ReadViewModel Parent { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Page = MixPortalPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == PageId).Data; - Parent = MixPortalPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == ParentId).Data; - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/UpdateViewModel.cs deleted file mode 100644 index 56fda2713..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPagePortalPages/UpdateViewModel.cs +++ /dev/null @@ -1,179 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPagePortalPages -{ - public class UpdateViewModel - : ViewModelBase - { - public UpdateViewModel(MixPortalPageNavigation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public UpdateViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("parentId")] - public int ParentId { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("page")] - public MixPortalPages.UpdateRolePermissionViewModel PortalPage { get; set; } - - [JsonProperty("parent")] - public MixPortalPages.ReadViewModel ParentPage { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override MixPortalPageNavigation ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - } - return base.ParseModel(_context, _transaction); - } - - public override async Task> SaveSubModelsAsync(MixPortalPageNavigation parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - if (PortalPage != null) - { - var result = await PortalPage.SaveModelAsync(false, _context, _transaction); - return new RepositoryResponse() - { - IsSucceed = result.IsSucceed, - Data = result.IsSucceed, - Errors = result.Errors, - Exception = result.Exception - }; - } - else - { - return await base.SaveSubModelsAsync(parent, _context, _transaction); - } - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCategory = MixPortalPages.UpdateRolePermissionViewModel.Repository.GetSingleModel(p => p.Id == PageId - - ); - if (getCategory.IsSucceed) - { - PortalPage = getCategory.Data; - } - //var getParent = MixPortalPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == ParentId - // , _context: _context, _transaction: _transaction - //); - //if (getParent.IsSucceed) - //{ - // ParentPage = getParent.Data; - //} - } - - #endregion overrides - - #region Expands - - public static async System.Threading.Tasks.Task>> UpdateInfosAsync(List cates) - { - MixCmsContext context = new MixCmsContext(); - var transaction = context.Database.BeginTransaction(); - var result = new RepositoryResponse>(); - try - { - foreach (var item in cates) - { - var saveResult = await item.SaveModelAsync(false, context, transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Errors.AddRange(saveResult.Errors); - result.Exception = saveResult.Exception; - break; - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, true, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - UnitOfWorkHelper.HandleException(ex, true, transaction); - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPageRoles/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPageRoles/ReadViewModel.cs deleted file mode 100644 index 5c085b59b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPageRoles/ReadViewModel.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPageRoles -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Model - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("pageId")] - public int PageId { get; set; } - - [JsonProperty("roleId")] - public string RoleId { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Model - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - //[JsonProperty("page")] - //public MixPortalPages.ReadViewModel Page { get; set; } - - #endregion Views - - #endregion Properties - - public ReadViewModel(MixPortalPageRole model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - #region overrides - - public override MixPortalPageRole ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (CreatedDateTime == default(DateTime)) - { - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - //var getCategory = MixPortalPages.ReadViewModel.Repository.GetSingleModel(p => p.Id == Id - //, _context: _context, _transaction: _transaction - //); - //if (getCategory.IsSucceed) - //{ - // Page = getCategory.Data; - //} - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadRolePermissionViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadRolePermissionViewModel.cs deleted file mode 100644 index 1628f9275..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadRolePermissionViewModel.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPages -{ - public class ReadRolePermissionViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("textKeyword")] - public string TextKeyword { get; set; } - - [JsonProperty("textDefault")] - public string TextDefault { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Descriotion { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("url")] - public string Url { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("childPages")] - public List ChildPages { get; set; } = new List(); - - [JsonProperty("navPermission")] - public MixPortalPageRoles.ReadViewModel NavPermission { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadRolePermissionViewModel() : base() - { - } - - public ReadRolePermissionViewModel(MixPortalPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getChilds = MixPortalPagePortalPages.ReadPermissionViewModel.Repository.GetModelListBy( - n => n.ParentId == Id, _context, _transaction); - if (getChilds.IsSucceed) - { - ChildPages = getChilds.Data.OrderBy(c => c.Priority).ToList(); - } - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadViewModel.cs deleted file mode 100644 index 4ab3794e2..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/ReadViewModel.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPages -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("textKeyword")] - public string TextKeyword { get; set; } - - [JsonProperty("textDefault")] - public string TextDefault { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Descriotion { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("url")] - public string Url { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - //[JsonProperty("childNavs")] - //public List ChildNavs { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixPortalPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - //public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - //{ - // var getChilds = MixPortalPagePortalPages.ReadViewModel.Repository.GetModelListBy(n => n.ParentId == Id, _context, _transaction); - // if (getChilds.IsSucceed) - // { - // ChildNavs = getChilds.Data.OrderBy(c => c.Priority).ToList(); - // } - //} - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateRolePermissionViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateRolePermissionViewModel.cs deleted file mode 100644 index 6b63d0874..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateRolePermissionViewModel.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPages -{ - public class UpdateRolePermissionViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("textKeyword")] - public string TextKeyword { get; set; } - - [JsonProperty("textDefault")] - public string TextDefault { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Descriotion { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("url")] - public string Url { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("childPages")] - public List ChildPages { get; set; } = new List(); - - [JsonProperty("navPermission")] - public MixPortalPageRoles.ReadViewModel NavPermission { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateRolePermissionViewModel() : base() - { - } - - public UpdateRolePermissionViewModel(MixPortalPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getChilds = MixPortalPagePortalPages.UpdateViewModel.Repository.GetModelListBy(n => n.ParentId == Id, _context, _transaction); - if (getChilds.IsSucceed) - { - ChildPages = getChilds.Data.OrderBy(c => c.Priority).ToList(); - } - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateViewModel.cs deleted file mode 100644 index bf7ec43ab..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPortalPages/UpdateViewModel.cs +++ /dev/null @@ -1,284 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPortalPages -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("textKeyword")] - public string TextKeyword { get; set; } - - [JsonProperty("textDefault")] - public string TextDefault { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("url")] - public string Url { get; set; } - - [JsonProperty("level")] - public int Level { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("childNavs")] - public List ChildNavs { get; set; } = new List(); - - [JsonProperty("parentNavs")] - public List ParentNavs { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixPortalPage model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixPortalPage ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - var navParent = ParentNavs?.FirstOrDefault(p => p.IsActived); - - if (navParent != null) - { - Level = navParent.Level + 1; - } - else - { - Level = 0; - } - - if (ChildNavs != null) - { - ChildNavs.Where(c => c.IsActived).ToList().ForEach(c => c.PortalPage.Level = Level + 1); - } - - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - this.ParentNavs = GetParentNavs(_context, _transaction); - this.ChildNavs = GetChildNavs(_context, _transaction); - } - - public override async Task> SaveSubModelsAsync(MixPortalPage parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse { IsSucceed = true }; - - if (result.IsSucceed) - { - foreach (var item in ParentNavs) - { - item.PageId = parent.Id; - var startId = Lib.ViewModels.MixPortalPagePortalPages.UpdateViewModel.Repository.Max(m => m.Id, _context, _transaction).Data + 1; - if (item.IsActived) - { - if (item.Id == 0) - { - item.Id = startId; - startId += 1; - } - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(true, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - if (result.IsSucceed) - { - foreach (var item in ChildNavs) - { - item.ParentId = parent.Id; - var startId = Lib.ViewModels.MixPortalPagePortalPages.UpdateViewModel.Repository.Max(m => m.Id, _context, _transaction).Data + 1; - if (item.IsActived) - { - if (item.Id == 0) - { - item.Id = startId; - startId += 1; - } - - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(true, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - return result; - } - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var removeNavs = await MixPortalPagePortalPages.UpdateViewModel.Repository.RemoveListModelAsync(false, p => p.PageId == Id || p.ParentId == Id); - var result = new RepositoryResponse() - { - IsSucceed = true, - Errors = removeNavs.Errors, - Exception = removeNavs.Exception - }; - return result; - } - - #endregion Overrides - - #region Expands - - public List GetParentNavs(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixPortalPagePortalPages.UpdateViewModel.Repository.GetModelListBy( - m => m.PageId == Id, context, transaction).Data; - result.ForEach(nav => - { - nav.IsActived = true; - }); - - //var activeIds = result.Select(m => m.PageId).ToList(); - - //var query = context.MixPortalPage - // .Include(cp => cp.MixPortalPageNavigationParent) - // .Where(PortalPage => - // // not load current active parent - // !activeIds.Any(p => p == PortalPage.Id) && - // // not load current page or page already have another parent - // PortalPage.Id != Id - // ) - // .AsEnumerable() - // .Select(PortalPage => - // new MixPortalPagePortalPages.ReadViewModel() - // { - // PageId = Id, - // ParentId = PortalPage.Id, - // Description = PortalPage.TextDefault, - // Level = PortalPage.Level - // } - // ); - //result.AddRange(query.ToList()); - return result.OrderBy(m => m.Priority).ToList(); - } - - public List GetChildNavs(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixPortalPagePortalPages.UpdateViewModel.Repository.GetModelListBy( - m => m.ParentId == Id, context, transaction).Data; - result.ForEach(nav => - { - nav.IsActived = true; - }); - //var activeIds = result.Select(m => m.PageId).ToList(); - - //var query = context.MixPortalPage - // .Include(cp => cp.MixPortalPageNavigationParent) - // .Where(PortalPage => - // // not load current active parent - // !activeIds.Any(p => p == PortalPage.Id) && - // // not load current page or page already have another parent - // PortalPage.Id != Id - // ) - // .AsEnumerable() - // .Select(PortalPage => - // new MixPortalPagePortalPages.ReadViewModel( - // new MixPortalPageNavigation() - // { - // PageId = PortalPage.Id, - // ParentId = Id, - // Description = PortalPage.TextDefault, - // }, context, transaction)); - - //result.AddRange(query.ToList()); - return result.OrderBy(m => m.Priority).ToList(); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPostMedias/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPostMedias/ReadMvcViewModel.cs deleted file mode 100644 index ad291dec0..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPostMedias/ReadMvcViewModel.cs +++ /dev/null @@ -1,132 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixMedias; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPostMedias -{ - public class ReadViewModel - : ViewModelBase - { - public ReadViewModel(MixPostMedia model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("mediaId")] - public int MediaId { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - public UpdateViewModel Media { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override MixPostMedia ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getMedia = UpdateViewModel.Repository.GetSingleModel(p => p.Id == MediaId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getMedia.IsSucceed) - { - Media = getMedia.Data; - } - } - - public override RepositoryResponse SaveSubModels(MixPostMedia parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var saveMedia = Media.SaveModel(false, _context, _transaction); - if (!saveMedia.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveMedia.Exception; - result.Errors = saveMedia.Errors; - } - return result; - } - - #region Async - - public override async Task> SaveSubModelsAsync(MixPostMedia parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var saveMedia = await Media.SaveModelAsync(false, _context, _transaction); - if (!saveMedia.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveMedia.Exception; - result.Errors = saveMedia.Errors; - } - return result; - } - - #endregion Async - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPostModules/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPostModules/ReadMvcViewModel.cs deleted file mode 100644 index 991d8fca7..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPostModules/ReadMvcViewModel.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPostModules -{ - public class ReadViewModel - : ViewModelBase - { - public ReadViewModel(MixPostModule model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - public ReadViewModel() : base() - { - } - - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("moduleId")] - public int ModuleId { get; set; } - - [JsonProperty("postId")] - public int PostId { get; set; } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("module")] - public MixModules.ReadMvcViewModel Module { get; set; } - - #endregion Views - - #endregion Properties - - #region overrides - - public override MixPostModule ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getModule = MixModules.ReadMvcViewModel.Repository.GetSingleModel(p => p.Id == ModuleId && p.Specificulture == Specificulture - , _context: _context, _transaction: _transaction - ); - if (getModule.IsSucceed) - { - Module = getModule.Data; - } - } - - #endregion overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPostPosts/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPostPosts/ReadViewModel.cs deleted file mode 100644 index cb844fc36..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPostPosts/ReadViewModel.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixPostPosts -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("sourceId")] - public int SourceId { get; set; } - - [JsonProperty("destinationId")] - public int DestinationId { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("relatedPost")] - public MixPosts.ReadListItemViewModel RelatedPost { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixPostAssociation model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getPost = MixPosts.ReadListItemViewModel.Repository.GetSingleModel( - m => m.Id == DestinationId && m.Specificulture == Specificulture - , _context: _context, _transaction: _transaction); - if (getPost.IsSucceed) - { - this.RelatedPost = getPost.Data; - } - } - - public override MixPostAssociation ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - return base.ParseModel(_context, _transaction); - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/CreateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/CreateViewModel.cs deleted file mode 100644 index df93d832d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/CreateViewModel.cs +++ /dev/null @@ -1,1110 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class CreateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonIgnore] - [JsonProperty("extraFields")] - public string ExtraFields { get; set; } = "[]"; - - [JsonIgnore] - [JsonProperty("extraProperties")] - public string ExtraProperties { get; set; } = "[]"; - - [JsonProperty("icon")] - public string Icon { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("categories")] - public List Pages { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } // Parent to Modules - - [JsonProperty("mediaNavs")] - public List MediaNavs { get; set; } - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("imageFileStream")] - public FileStreamViewModel ImageFileStream { get; set; } - - [JsonProperty("thumbnailFileStream")] - public FileStreamViewModel ThumbnailFileStream { get; set; } - - #region Template - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonProperty("templates")] - public List Templates { get; set; }// Post Templates - - [JsonIgnore] - public int ActivedTheme - { - get - { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string TemplateFolderType - { - get - { - return MixTemplateFolders.Posts; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder - { - get - { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Posts}"; - } - } - - #endregion Template - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("properties")] - public List Properties { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("columns")] - public List Columns { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public CreateViewModel() : base() - { - } - - public CreateViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - ExtraFields = MixService.GetConfig("DefaultPostAttr"); - } - Cultures = LoadCultures(Specificulture, _context, _transaction); - UrlAliases = GetAliases(_context, _transaction); - if (!string.IsNullOrEmpty(this.Tags)) - { - ListTag = JArray.Parse(this.Tags); - } - - // Load Properties - LoadExtraProperties(); - - //Get Templates - LoadTemplates(_context, _transaction); - - // Load Parent Pages - LoadParentPage(_context, _transaction); - - // Load Parent Modules - LoadParentModules(_context, _transaction); - - // Medias - LoadMedias(_context, _transaction); - - // Related Posts - LoadRelatedPost(_context, _transaction); - } - - public override MixPost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - LastModified = DateTime.UtcNow; - PublishedDateTime = PublishedDateTime?.ToUniversalTime(); - - // Parsing Extra Fields to json string - var arrField = Columns != null ? JArray.Parse( - Newtonsoft.Json.JsonConvert.SerializeObject(Columns.OrderBy(c => c.Priority).Where( - c => !string.IsNullOrEmpty(c.Name)))) : new JArray(); - ExtraFields = arrField.ToString(Newtonsoft.Json.Formatting.None); - - // Parsing Extra Properties value - if (Properties != null && Properties.Count > 0) - { - JArray arrProperties = new JArray(); - foreach (var p in Properties.Where(p => !string.IsNullOrEmpty(p.Value) && !string.IsNullOrEmpty(p.Name))) - { - arrProperties.Add(JObject.FromObject(p)); - } - ExtraProperties = arrProperties.ToString(Formatting.None)?.Trim(); - } - - Template = View != null ? string.Format(@"{0}/{1}{2}", View.FolderType, View.FileName, View.Extension) : Template; - if (ThumbnailFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ThumbnailFileStream.Name); - bool saveThumbnail = CommonHelper.SaveFileBase64(folder, filename, ThumbnailFileStream.Base64); - if (saveThumbnail) - { - CommonHelper.RemoveFile(Thumbnail); - Thumbnail = $"{folder}/{filename}"; - } - } - if (ImageFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ImageFileStream.Name); - bool saveImage = CommonHelper.SaveFileBase64(folder, filename, ImageFileStream.Base64); - if (saveImage) - { - CommonHelper.RemoveFile(Image); - Image = $"{folder}/{filename}"; - } - } - - if (!string.IsNullOrEmpty(Image) && Image[0] == '/') { Image = Image.Substring(1); } - if (!string.IsNullOrEmpty(Thumbnail) && Thumbnail[0] == '/') { Thumbnail = Thumbnail.Substring(1); } - Tags = ListTag.ToString(Newtonsoft.Json.Formatting.None); - GenerateSEO(); - - return base.ParseModel(_context, _transaction); - } - - #region Async Methods - - #region Save Sub Models Async - - public override async Task> SaveSubModelsAsync( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - // Save Template - var saveTemplate = await View.SaveModelAsync(true, _context, _transaction); - result.IsSucceed = result.IsSucceed && saveTemplate.IsSucceed; - ViewModelHelper.HandleResult(saveTemplate, ref result); - - if (result.IsSucceed) - { - // Save Alias - result = await SaveUrlAliasAsync(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Medias - result = await SaveMediasAsync(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save related posts - result = await SaveRelatedPostAsync(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Parent Category - result = await SaveParentPagesAsync(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save Parent Modules - result = await SaveParentModulesAsync(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save Attribute Set Values - result = await SaveMixDatabaseDataAsync(parent.Id, _context, _transaction); - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - private async Task> SaveParentModulesAsync(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Modules) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private async Task> SaveParentPagesAsync(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Pages) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private async Task> SaveRelatedPostAsync(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navPost in PostNavs) - { - navPost.SourceId = id; - navPost.Status = MixContentStatus.Published; - navPost.Specificulture = Specificulture; - if (navPost.IsActived) - { - var saveResult = await navPost.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await navPost.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private async Task> SaveMediasAsync(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navMedia in MediaNavs) - { - navMedia.PostId = id; - navMedia.Specificulture = Specificulture; - - if (navMedia.IsActived) - { - var saveResult = await navMedia.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var saveResult = await navMedia.RemoveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - private async Task> SaveUrlAliasAsync(int parentId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in UrlAliases) - { - item.SourceId = parentId.ToString(); - item.Type = MixUrlAliasType.Post; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - } - return result; - } - - private Task> SaveMixDatabaseDataAsync(int parentId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - //foreach (var nav in MixDatabaseNavs) - //{ - // nav.PostId = parentId; - // nav.Specificulture = Specificulture; - - // if (nav.IsActived) - // { - // // Save Navigation Post - Attribute Set - // var saveResult = await nav.SaveModelAsync(true, _context, _transaction); - // ViewModelHelper.HandleResult(saveResult, ref result); - // } - // else - // { - // var saveResult = await nav.RemoveModelAsync(false, _context, _transaction); - // ViewModelHelper.HandleResult(saveResult, ref result); - - // //// Remove Post Attribute Data - // //if (result.IsSucceed) - // //{ - // // var data = await _context.MixPostAttributeData.Where(n => n.PostId == Id && n.MixDatabaseId == nav.MixDatabaseId - // // && n.Specificulture == Specificulture).ToListAsync(); - // // foreach (var item in data) - // // { - // // var values = await _context.MixPostMixDatabaseDataValue.Where(n => - // // n.DataId == item.Id && n.PostId == Id - // // && n.Specificulture == Specificulture).ToListAsync(); - // // foreach (var val in values) - // // { - // // _context.Entry(val).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - // // } - // // _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - // // } - // // await _context.SaveChangesAsync(); - - // // ViewModelHelper.HandleResult(saveResult, ref result); - // //} - // } - //} - return Task.FromResult(result); - } - - #endregion Save Sub Models Async - - public override async Task> RemoveRelatedModelsAsync(CreateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = await _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = await _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = await _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = await _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - result.IsSucceed = (await _context.SaveChangesAsync() > 0); - return result; - } - - public override Task>> CloneAsync(MixPost model, List cloneCultures, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - return base.CloneAsync(model, cloneCultures, _context, _transaction); - } - - #endregion Async Methods - - #region Sync Methods - - #region Save Sub Models - - public override RepositoryResponse SaveSubModels( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - // Save Template - var saveTemplate = View.SaveModel(true, _context, _transaction); - result.IsSucceed = result.IsSucceed && saveTemplate.IsSucceed; - ViewModelHelper.HandleResult(saveTemplate, ref result); - - if (result.IsSucceed) - { - // Save Alias - result = SaveUrlAlias(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Medias - result = SaveMedias(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save related posts - result = SaveRelatedPost(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Parent Category - result = SaveParentPages(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save Parent Modules - result = SaveParentModules(parent.Id, _context, _transaction); - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - private RepositoryResponse SaveParentModules(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Modules) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private RepositoryResponse SaveParentPages(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Pages) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private RepositoryResponse SaveRelatedPost(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navPost in PostNavs) - { - navPost.SourceId = id; - navPost.Status = MixContentStatus.Published; - navPost.Specificulture = Specificulture; - if (navPost.IsActived) - { - var saveResult = navPost.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = navPost.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private RepositoryResponse SaveMedias(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navMedia in MediaNavs) - { - navMedia.PostId = id; - navMedia.Specificulture = Specificulture; - - if (navMedia.IsActived) - { - var saveResult = navMedia.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var saveResult = navMedia.RemoveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - private RepositoryResponse SaveUrlAlias(int parentId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in UrlAliases) - { - item.SourceId = parentId.ToString(); - item.Type = MixUrlAliasType.Post; - item.Specificulture = Specificulture; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - } - return result; - } - - #endregion Save Sub Models - - public override RepositoryResponse RemoveRelatedModels(CreateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToList(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - result.IsSucceed = (_context.SaveChanges() > 0); - return result; - } - - #endregion Sync Methods - - #endregion Overrides - - #region Expands - - private void LoadRelatedPost(MixCmsContext _context, IDbContextTransaction _transaction) - { - PostNavs = GetRelated(_context, _transaction); - // Load other post ( != Id) and not actived (not in acticleNavs) - var otherPosts = MixPosts.ReadListItemViewModel.Repository.GetModelListBy( - m => m.Id != Id && m.Specificulture == Specificulture - && !PostNavs.Any(n => n.DestinationId == m.Id) - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, 10, 0, _context, _transaction); - foreach (var item in otherPosts.Data.Items) - { - PostNavs.Add(new MixPostPosts.ReadViewModel() - { - SourceId = Id, - Image = item.ImageUrl, - DestinationId = item.Id, - Description = item.Title - }); - } - } - - private void LoadMedias(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getPostMedia = MixPostMedias.ReadViewModel.Repository.GetModelListBy(n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostMedia.IsSucceed) - { - MediaNavs = getPostMedia.Data.OrderBy(p => p.Priority).ToList(); - MediaNavs.ForEach(n => n.IsActived = true); - } - } - - private void LoadParentModules(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getModulePost = MixModulePosts.ReadViewModel.GetModulePostNavAsync(Id, Specificulture, _context, _transaction); - if (getModulePost.IsSucceed) - { - this.Modules = getModulePost.Data; - this.Modules.ForEach(c => - { - c.IsActived = MixModulePosts.ReadViewModel.Repository.CheckIsExists(n => n.ModuleId == c.ModuleId && n.PostId == Id, _context, _transaction); - }); - } - var otherModules = MixModules.ReadListItemViewModel.Repository.GetModelListBy( - m => (m.Type == (int)MixModuleType.Content || m.Type == (int)MixModuleType.ListPost) - && m.Specificulture == Specificulture - && !Modules.Any(n => n.ModuleId == m.Id && n.Specificulture == m.Specificulture) - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, null, 0, _context, _transaction); - foreach (var item in otherModules.Data.Items) - { - Modules.Add(new MixModulePosts.ReadViewModel() - { - ModuleId = item.Id, - Image = item.Image, - PostId = Id, - Description = Title - }); - } - } - - private void LoadParentPage(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getPagePost = MixPagePosts.ReadViewModel.GetPagePostNavAsync(Id, Specificulture, _context, _transaction); - if (getPagePost.IsSucceed) - { - this.Pages = getPagePost.Data; - this.Pages.ForEach(c => - { - c.IsActived = MixPagePosts.ReadViewModel.Repository.CheckIsExists(n => n.PageId == c.PageId && n.PostId == Id, _context, _transaction); - }); - } - } - - private void LoadTemplates(MixCmsContext _context, IDbContextTransaction _transaction) - { - this.Templates = this.Templates ?? MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.TemplateFolderType).Data; - View = MixTemplates.UpdateViewModel.GetTemplateByPath(Template, Specificulture, MixTemplateFolders.Posts, _context, _transaction); - - this.Template = $"{this.View?.FileFolder}/{this.View?.FileName}"; - } - - private void LoadExtraProperties() - { - // Parsing Extra Properties fields - Columns = new List(); - JArray arrField = !string.IsNullOrEmpty(ExtraFields) ? JArray.Parse(ExtraFields) : new JArray(); - foreach (var field in arrField) - { - ModuleFieldViewModel thisField = new ModuleFieldViewModel() - { - Name = CommonHelper.ParseJsonPropertyName(field["name"].ToString()), - Title = field["title"]?.ToString(), - DefaultValue = field["defaultValue"]?.ToString(), - Options = field["options"] != null ? field["options"].Value() : new JArray(), - Priority = field["priority"] != null ? field["priority"].Value() : 0, - DataType = (MixDataType)(int)field["dataType"], - Width = field["width"] != null ? field["width"].Value() : 3, - IsUnique = field["isUnique"] != null ? field["isUnique"].Value() : true, - IsRequired = field["isRequired"] != null ? field["isRequired"].Value() : true, - IsDisplay = field["isDisplay"] != null ? field["isDisplay"].Value() : true, - IsSelect = field["isSelect"] != null ? field["isSelect"].Value() : false, - IsGroupBy = field["isGroupBy"] != null ? field["isGroupBy"].Value() : false, - }; - Columns.Add(thisField); - } - - // Parsing Extra Properties value - Properties = new List(); - - if (!string.IsNullOrEmpty(ExtraProperties)) - { - JArray arr = JArray.Parse(ExtraProperties); - foreach (JToken item in arr) - { - var property = item.ToObject(); - Properties.Add(property); - } - } - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixPost.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - private void GenerateSEO() - { - if (string.IsNullOrEmpty(this.SeoName)) - { - this.SeoName = SeoHelper.GetSEOString(this.Title); - } - int i = 1; - string name = SeoName; - while (UpdateViewModel.Repository.CheckIsExists(a => a.SeoName == name && a.Specificulture == Specificulture && a.Id != Id)) - { - name = SeoName + "_" + i; - i++; - } - SeoName = name; - - if (string.IsNullOrEmpty(this.SeoTitle)) - { - this.SeoTitle = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoDescription)) - { - this.SeoDescription = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoKeywords)) - { - this.SeoKeywords = SeoHelper.GetSEOString(this.Title); - } - } - - public List GetRelated(MixCmsContext context, IDbContextTransaction transaction) - { - var navs = MixPostPosts.ReadViewModel.Repository.GetModelListBy(n => n.SourceId == Id && n.Specificulture == Specificulture, context, transaction).Data; - navs.ForEach(n => n.IsActived = true); - return navs.OrderBy(p => p.Priority).ToList(); - } - - public List GetAliases(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixUrlAliases.UpdateViewModel.Repository.GetModelListBy(p => p.Specificulture == Specificulture - && p.SourceId == Id.ToString() && p.Type == (int)MixUrlAliasType.Post, context, transaction); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return new List(); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/DeleteViewModel.cs deleted file mode 100644 index a5ec1b23c..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/DeleteViewModel.cs +++ /dev/null @@ -1,155 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - public string Type { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public DeleteViewModel() : base() - { - } - - public DeleteViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Async Methods - - public override async Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = await _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = await _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = await _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = await _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = await _context.MixRelatedPost.Where(n => (n.Id == Id || n.DestinationId == Id) && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = await _context.MixDatabaseDataAssociation.Where(n => n.ParentId == Id.ToString() && n.ParentType == MixDatabaseParentType.Post && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - await _context.SaveChangesAsync(); - var removeRelatedData = await MixDatabaseDataAssociations.Helper.RemoveRelatedDataAsync( - Id.ToString(), MixDatabaseParentType.Post - , Specificulture - , _context, _transaction); - ViewModelHelper.HandleResult(removeRelatedData, ref result); - return result; - } - - #endregion Async Methods - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/Helper.cs deleted file mode 100644 index a9e868d7b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/Helper.cs +++ /dev/null @@ -1,593 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class Helper - { - /// - /// Gets the modelist by meta. - /// - /// The type of the view. - /// The culture. - /// Name of the meta. Ex: sys_tag / sys_category - /// The meta value. - /// Name of the order by property. - /// The direction. - /// Size of the page. - /// Index of the page. - /// The context. - /// The transaction. - /// - public static async Task>> GetModelistByMeta( - string metaName, string metaValue - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - PageIndex = pageIndex.HasValue ? pageIndex.Value : 0, - PageSize = pageSize - } - }; - // Get Tag - var getVal = await MixDatabaseDataValues.ReadViewModel.Repository.GetSingleModelAsync( - m => m.Specificulture == culture && m.Status == MixContentStatus.Published - && m.MixDatabaseName == metaName - && m.MixDatabaseColumnName == "title" && EF.Functions.Like(m.StringValue, metaValue) - , context, transaction); - if (getVal.IsSucceed) - { - result = await GetPostListByDataId( - dataId: getVal.Data.DataId, - culture: culture, - orderByPropertyName: orderByPropertyName, - direction: direction, - pageSize: pageSize, - pageIndex: pageIndex, - _context: context, - _transaction: transaction); - //var query = context.MixRelatedAttributeData.Where(m=> m.Specificulture == culture - // && m.Id == getVal.Data.DataId && m.ParentId == parentId && m.ParentType == (int) MixEnums.MixDatabaseDataType.Post) - // .Select(m => m.ParentId).Distinct().ToList(); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetPostListByValueId( - string valueId - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - PageIndex = pageIndex.HasValue ? pageIndex.Value : 0, - PageSize = pageSize - } - }; - // Get Tag - var getVal = await MixDatabaseDataValues.ReadViewModel.Repository.GetSingleModelAsync( - m => m.Specificulture == culture - && m.Status == MixContentStatus.Published - && m.Id == valueId - , context, transaction); - if (getVal.IsSucceed) - { - result = await GetPostListByDataId( - dataId: getVal.Data.DataId, - culture: culture, - orderByPropertyName: orderByPropertyName, - direction: direction, - pageSize: pageSize, - pageIndex: pageIndex, - _context: context, - _transaction: transaction); - //var query = context.MixRelatedAttributeData.Where(m=> m.Specificulture == culture - // && m.Id == getVal.Data.DataId && m.ParentId == parentId && m.ParentType == (int) MixEnums.MixDatabaseDataType.Post) - // .Select(m => m.ParentId).Distinct().ToList(); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetPostListByValueIds( - List valueIds - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - PageIndex = pageIndex.HasValue ? pageIndex.Value : 0, - PageSize = pageSize - } - }; - // Get Data - Expression> predicate = m => m.Specificulture == culture - && m.Status == MixContentStatus.Published; - foreach (var item in valueIds) - { - Expression> pre = m => m.Id == item; - predicate = predicate.AndAlso(pre); - } - var getVal = await MixDatabaseDataValues.ReadViewModel.Repository.GetModelListByAsync(predicate, context, transaction); - if (getVal.IsSucceed) - { - var dataIds = getVal.Data.Select(m => m.DataId).Distinct(); - if (dataIds.Count() == 1) - { - result = await GetPostListByDataIds( - dataIds: dataIds.ToList(), - culture: culture, - orderByPropertyName: orderByPropertyName, - direction: direction, - pageSize: pageSize, - pageIndex: pageIndex, - _context: context, - _transaction: transaction); - } - //var query = context.MixRelatedAttributeData.Where(m=> m.Specificulture == culture - // && m.Id == getVal.Data.DataId && m.ParentId == parentId && m.ParentType == (int) MixEnums.MixDatabaseDataType.Post) - // .Select(m => m.ParentId).Distinct().ToList(); - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetPostListByPageId( - int pageId - , string keyword = null - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var result = await DefaultRepository.Instance.GetModelListByAsync( - m => m.Specificulture == culture && m.PageId == pageId - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(m.MixPost.Title, $"%{keyword}%")) - || (EF.Functions.Like(m.MixPost.Excerpt, $"%{keyword}%")) - || (EF.Functions.Like(m.MixPost.Content, $"%{keyword}%")) - ) - , orderByPropertyName, direction, pageSize, pageIndex - , _context: context, _transaction: transaction - ); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetPostListByDataId( - string dataId - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var getRelatedData = await MixDatabaseDataAssociations.ReadViewModel.Repository.GetModelListByAsync( - m => m.Specificulture == culture && m.DataId == dataId - && m.ParentType == MixDatabaseParentType.Post - , orderByPropertyName = "CreatedDateTime", direction, pageSize, pageIndex - , _context: context, _transaction: transaction - ); - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - Items = new List(), - PageIndex = pageIndex ?? 0, - PageSize = pageSize - } - }; - if (getRelatedData.IsSucceed) - { - foreach (var item in getRelatedData.Data.Items) - { - if (int.TryParse(item.ParentId, out int postId)) - { - var getData = await DefaultRepository.Instance.GetSingleModelAsync( - m => m.Specificulture == item.Specificulture && m.Id == postId - , context, transaction); - if (getData.IsSucceed) - { - result.Data.Items.Add(getData.Data); - } - } - } - result.Data.TotalItems = getRelatedData.Data.TotalItems; - result.Data.TotalPage = getRelatedData.Data.TotalPage; - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> GetPostListByDataIds( - List dataIds - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - var result = new RepositoryResponse>(); - Expression> predicate = m => m.Specificulture == culture && dataIds.Contains(m.DataId) - && m.ParentType == MixDatabaseParentType.Post; - foreach (var id in dataIds) - { - Expression> pre = m => m.DataId == id; - predicate = predicate.AndAlso(pre); - } - var getRelatedData = await MixDatabaseDataAssociations.ReadViewModel.Repository.GetModelListByAsync( - predicate - , orderByPropertyName = "CreatedDateTime", direction, pageSize, pageIndex - , _context: context, _transaction: transaction - ); - if (getRelatedData.IsSucceed) - { - foreach (var item in getRelatedData.Data.Items) - { - if (int.TryParse(item.ParentId, out int postId)) - { - var getData = await DefaultRepository.Instance.GetSingleModelAsync( - m => m.Specificulture == item.Specificulture && m.Id == postId - , context, transaction); - if (getData.IsSucceed) - { - result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - Items = new List(), - PageIndex = pageIndex ?? 0, - PageSize = pageSize - } - }; - result.Data.Items.Add(getData.Data); - } - } - } - result.Data.TotalItems = getRelatedData.Data.TotalItems; - result.Data.TotalPage = getRelatedData.Data.TotalPage; - } - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task>> SearchPostByIds( - string keyword - , List dataIds - , List pageIds = null - , string culture = null - , string orderByPropertyName = "CreatedDateTime" - , Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture = culture ?? MixService.GetConfig("DefaultCulture"); - Expression> postPredicate = m => m.Specificulture == culture - && (string.IsNullOrEmpty(keyword) - || (EF.Functions.Like(m.Title, $"%{keyword}%")) - || (EF.Functions.Like(m.Excerpt, $"%{keyword}%")) - || (EF.Functions.Like(m.Content, $"%{keyword}%"))); - if (dataIds.Count > 0) - { - var searchPostByDataIds = SearchPostByDataIdsPredicate(dataIds, culture, context); - postPredicate = searchPostByDataIds.AndAlso(postPredicate); - } - - if (pageIds != null && pageIds.Count > 0) - { - var searchPostByPageIds = SearchPostByPageIdsPredicate(pageIds, culture, context); - postPredicate = searchPostByPageIds.AndAlso(postPredicate); - } - - if (!typeof(MixPost).GetProperties().Any(p => p.Name.ToLower() == orderByPropertyName.ToLower())) - { - var postIds = context.MixPost.Where(postPredicate).Select(p => p.Id); - var orderedPostIds = context.MixDatabaseDataAssociation.Where( - m => m.Specificulture == culture && postIds.Any(p => p.ToString() == m.ParentId)) - .Join(context.MixDatabaseDataValue, r => r.DataId, v => v.DataId, (r, v) => new { r, v }) - .OrderBy(rv => rv.v.StringValue) - .Select(rv => rv.r.ParentId); - postPredicate = p => orderedPostIds.Distinct().Any(o => o == p.Id.ToString() && p.Specificulture == culture); - } - - return await DefaultRepository.Instance.GetModelListByAsync( - postPredicate - , orderByPropertyName, direction - , pageSize, pageIndex - , _context: context, _transaction: transaction); - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private static Expression> SearchPostByPageIdsPredicate(List pageIds, string culture, MixCmsContext context) - { - Expression> postPredicate = null; - Expression> predicate = null; - foreach (var id in pageIds) - { - // Get list related post ids by data id - Expression> pre = - m => m.Specificulture == culture - && m.Status == MixContentStatus.Published - && m.PageId == id; - predicate = predicate == null ? pre : predicate.Or(pre); - } - if (predicate != null) - { - var postIds = context.MixPagePost - .Where(predicate) - .Select(m => m.PostId).Distinct(); - postPredicate = p => postIds.Any(m => m == p.Id); - } - return postPredicate; - } - - private static Expression> SearchPostByDataIdsPredicate(List dataIds, string culture, MixCmsContext context) - { - Expression> postPredicate = null; - Expression> predicate = null; - foreach (var id in dataIds) - { - // Get list related post ids by data id - Expression> pre = - m => m.Specificulture == culture - && m.ParentType == MixDatabaseParentType.Post - && m.DataId == id; - - predicate = predicate == null ? pre : predicate.AndAlso(pre); - } - - if (predicate != null) - { - var postIds = context.MixDatabaseDataAssociation - .Where(predicate) - .Select(m => m.ParentId).Distinct(); - postPredicate = p => postIds.Any(m => p.Id.ToString() == m); - } - - return postPredicate; - } - - public static async Task>> SearchPostByField( - string fieldName, string value - , string culture = null - , string orderByPropertyName = "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection direction = Heart.Enums.MixHeartEnums.DisplayDirection.Desc - , int? pageSize = null, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - where TView : ViewModelBase - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - culture ??= MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - var result = new RepositoryResponse>() - { - IsSucceed = true, - Data = new PaginationModel() - { - PageIndex = pageIndex.HasValue ? pageIndex.Value : 0, - PageSize = pageSize - } - }; - var tasks = new List>>(); - // Get Value - var dataIds = await context.MixDatabaseDataValue.Where( - m => m.MixDatabaseName == MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST && m.Specificulture == culture - && EF.Functions.Like(m.StringValue, value) && m.MixDatabaseColumnName == fieldName) - .Select(m => m.DataId)?.ToListAsync(); - if (dataIds != null && dataIds.Count > 0) - { - var getRelatedData = await MixDatabaseDataAssociations.ReadViewModel.Repository.GetModelListByAsync( - m => dataIds.Contains(m.DataId) - , orderByPropertyName, direction, pageSize, pageIndex - , _context: context, _transaction: transaction - ); - if (getRelatedData.IsSucceed) - { - foreach (var item in getRelatedData.Data.Items) - { - if (int.TryParse(item.ParentId, out int postId)) - { - var getData = await DefaultRepository.Instance.GetSingleModelAsync( - m => m.Specificulture == item.Specificulture && m.Id == postId - , context, transaction); - if (getData.IsSucceed) - { - result.Data.Items.Add(getData.Data); - } - } - } - result.Data.TotalItems = getRelatedData.Data.TotalItems; - result.Data.TotalPage = getRelatedData.Data.TotalPage; - } - } - - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException>(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static async Task PublishScheduledPosts() - { - using (var context = new MixCmsContext()) - { - var now = DateTime.UtcNow; - now = now.AddSeconds(-now.Second); - var sheduledPosts = context.MixPost - .Where(m => m.Status == MixContentStatus.Schedule - && Equals(m.PublishedDateTime.Value, now)); - var posts = await sheduledPosts.ToListAsync(); - foreach (var post in posts) - { - post.Status = MixContentStatus.Published; - } - _ = await context.SaveChangesAsync(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/ImportViewModel.cs deleted file mode 100644 index 0811e31f3..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/ImportViewModel.cs +++ /dev/null @@ -1,173 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("categories")] - public List Pages { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } // Parent to Modules - - [JsonProperty("mediaNavs")] - public List MediaNavs { get; set; } - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("attributes")] - public MixDatabases.ImportViewModel Attributes { get; set; } - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.UpdateViewModel AttributeData { get; set; } - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("relatedData")] - public MixDatabaseDataAssociations.ImportViewModel RelatedData { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() : base() - { - } - - public ImportViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - GetAdditionalData(Id.ToString(), MixDatabaseParentType.Post, _context, _transaction); - } - - private void GetAdditionalData(string id, MixDatabaseParentType type, MixCmsContext context, IDbContextTransaction transaction) - { - var getRelatedData = MixDatabaseDataAssociations.ImportViewModel.Repository.GetFirstModel( - m => m.Specificulture == Specificulture && m.ParentType == type - && m.ParentId == id, context, transaction); - if (getRelatedData.IsSucceed) - { - RelatedData = (getRelatedData.Data); - } - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadListItemViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadListItemViewModel.cs deleted file mode 100644 index 6537b046f..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadListItemViewModel.cs +++ /dev/null @@ -1,248 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class ReadListItemViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.ReadMvcViewModel AttributeData { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } = new List(); - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } = new List(); - - [JsonProperty("listTag")] - public List ListTag { get => SysTags.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - [JsonProperty("listCategory")] - public List ListCategory { get => SysCategories.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"{MixService.GetConfig(MixAppSettingKeywords.Domain)}/{Specificulture}/post/{Id}/{SeoName}" : null; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("pages")] - public List Pages { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadListItemViewModel() : base() - { - } - - public ReadListItemViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - LoadAttributes(_context, _transaction); - LoadPages(_context, _transaction); - LoadTags(_context, _transaction); - LoadCategories(_context, _transaction); - } - - private void LoadPages(MixCmsContext context, IDbContextTransaction transaction) - { - this.Pages = MixPagePosts.Helper.GetActivedNavAsync(Id, null, Specificulture, context, transaction).Data; - this.Pages.ForEach(p => p.LoadPage(context, transaction)); - } - - #endregion Overrides - - #region Expands - - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - string type = Type ?? MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST; - var getAttrs = MixDatabases.UpdateViewModel.Repository.GetSingleModel( - m => m.Name == type, _context, _transaction); - if (getAttrs.IsSucceed) - { - AttributeData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetFirstModel( - a => a.ParentId == Id.ToString() && a.Specificulture == Specificulture - && a.MixDatabaseId == getAttrs.Data.Id - , _context, _transaction).Data; - } - } - - private void LoadTags(MixCmsContext context, IDbContextTransaction transaction) - { - var getTags = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_TAG, context, transaction); - if (getTags.IsSucceed) - { - SysTags = getTags.Data; - } - } - - private void LoadCategories(MixCmsContext context, IDbContextTransaction transaction) - { - var getData = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_CATEGORY, context, transaction); - if (getData.IsSucceed) - { - SysCategories = getData.Data; - } - } - - //Get Property by name - public T Property(string fieldName) - { - if (AttributeData != null) - { - var field = AttributeData.Data.Obj?.GetValue(fieldName); - if (field != null) - { - return field.Value(); - } - else - { - return default(T); - } - } - else - { - return default(T); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadMvcViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadMvcViewModel.cs deleted file mode 100644 index b5cb49f7d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadMvcViewModel.cs +++ /dev/null @@ -1,352 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Interfaces; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class ReadMvcViewModel - : ViewModelBase, IMvcViewModel - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonIgnore] - [JsonProperty("extraFields")] - public string ExtraFields { get; set; } = "[]"; - - [JsonIgnore] - [JsonProperty("extraProperties")] - public string ExtraProperties { get; set; } = "[]"; - - [JsonProperty("icon")] - public string Icon { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/post/{Id}/{SeoName}" : null; } - - [JsonProperty("view")] - public MixTemplates.ReadListItemViewModel View { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("templatePath")] - public string TemplatePath - { - get - { - return $"/{ MixFolders.TemplatesFolder}/{MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, Specificulture) ?? "Default"}/{Template}"; - } - } - - //[JsonProperty("properties")] - //public List Properties { get; set; } - - [JsonProperty("mediaNavs")] - public List MediaNavs { get; set; } - - [JsonProperty("moduleNavs")] - public List ModuleNavs { get; set; } - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } - - [JsonProperty("Databases")] - public List Databases { get; set; } = new List(); - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.ReadMvcViewModel AttributeData { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } = new List(); - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } = new List(); - - [JsonProperty("listTag")] - public List ListTag { get => SysTags.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - [JsonProperty("listCategory")] - public List ListCategory { get => SysCategories.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - [JsonProperty("pages")] - public List Pages { get; set; } - - [JsonProperty("Layout")] - public string Layout { get; set; } - - [JsonProperty("author")] - public JObject Author { get; set; } - - [JsonProperty("bodyClass")] - public string BodyClass => Property("body_class"); - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadMvcViewModel() : base() - { - } - - public ReadMvcViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - LoadAttributes(_context, _transaction); - LoadTags(_context, _transaction); - LoadCategories(_context, _transaction); - //Load Template + Style + Scripts for views - LoadAuthor(_context, _transaction); - this.View = MixTemplates.ReadListItemViewModel.GetTemplateByPath(Template, Specificulture, _context, _transaction).Data; - if (Pages == null) - { - LoadPages(_context, _transaction); - var getPostMedia = MixPostMedias.ReadViewModel.Repository.GetModelListBy(n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostMedia.IsSucceed) - { - MediaNavs = getPostMedia.Data.OrderBy(p => p.Priority).ToList(); - MediaNavs.ForEach(n => n.IsActived = true); - } - - // Modules - var getPostModule = MixPostModules.ReadViewModel.Repository.GetModelListBy( - n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostModule.IsSucceed) - { - ModuleNavs = getPostModule.Data.OrderBy(p => p.Priority).ToList(); - foreach (var item in ModuleNavs) - { - item.IsActived = true; - item.Module.LoadData(postId: Id, _context: _context, _transaction: _transaction); - } - } - - // Related Posts - PostNavs = MixPostPosts.ReadViewModel.Repository.GetModelListBy(n => n.SourceId == Id && n.Specificulture == Specificulture, _context, _transaction).Data; - } - } - - private void LoadAuthor(MixCmsContext context, IDbContextTransaction transaction) - { - if (!string.IsNullOrEmpty(CreatedBy)) - { - var getAuthor = MixDatabaseDatas.Helper.LoadAdditionalData(MixDatabaseParentType.User, CreatedBy, MixDatabaseNames.SYSTEM_USER_DATA - , Specificulture, context, transaction); - if (getAuthor.IsSucceed) - { - Author = getAuthor.Data.Obj; - } - } - } - - private void LoadTags(MixCmsContext context, IDbContextTransaction transaction) - { - var getTags = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture && m.Status == MixContentStatus.Published - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_TAG, context, transaction); - if (getTags.IsSucceed) - { - SysTags = getTags.Data; - } - } - - private void LoadCategories(MixCmsContext context, IDbContextTransaction transaction) - { - var getData = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_CATEGORY, context, transaction); - if (getData.IsSucceed) - { - SysCategories = getData.Data; - } - } - - #endregion Overrides - - #region Expands - - private void LoadPages(MixCmsContext _context, IDbContextTransaction _transaction) - { - this.Pages = MixPagePosts.Helper.GetActivedNavAsync(Id, null, Specificulture, _context, _transaction).Data; - this.Pages.ForEach(p => p.LoadPage(_context, _transaction)); - } - - /// Loads the attributes. - /// The context. - /// The transaction. - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - Type = string.IsNullOrEmpty(Type) ? MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST : Type; - var getAttrs = MixDatabases.UpdateViewModel.Repository.GetSingleModel(m => m.Name == Type, _context, _transaction); - if (getAttrs.IsSucceed) - { - AttributeData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetFirstModel( - a => a.ParentId == Id.ToString() && a.Specificulture == Specificulture && a.MixDatabaseId == getAttrs.Data.Id - , _context, _transaction).Data ?? new MixDatabaseDataAssociations.ReadMvcViewModel(); - } - } - - public bool HasValue(string fieldName) - { - return AttributeData != null && AttributeData.Data.Obj.GetValue(fieldName) != null; - } - - /// Get Post's Property by type and name - /// Type of field - /// Name of the field. - /// T - public T Property(string fieldName) - { - return MixCmsHelper.Property(AttributeData?.Data?.Obj, fieldName); - } - - /// Gets the module. - /// The name. - /// MixModules.ReadMvcViewModel - public MixModules.ReadMvcViewModel GetModule(string name) - { - return ModuleNavs.FirstOrDefault(m => m.Module.Name == name)?.Module; - } - - /// Gets the attribute set. - /// The name. - /// Databases.ReadMvcViewModel - public MixDatabases.ReadViewModel GetMixDatabase(string name) - { - return Databases.FirstOrDefault(m => m.Name == name); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadViewModel.cs deleted file mode 100644 index 1684b1a15..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/ReadViewModel.cs +++ /dev/null @@ -1,432 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonIgnore] - [JsonProperty("extraFields")] - public string ExtraFields { get; set; } = "[]"; - - [JsonIgnore] - [JsonProperty("extraProperties")] - public string ExtraProperties { get; set; } = "[]"; - - [JsonProperty("icon")] - public string Icon { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/post/{Id}/{SeoName}" : null; } - - [JsonProperty("properties")] - public List Properties { get; set; } - - [JsonProperty("attributeData")] - public MixDatabaseDataAssociations.ReadMvcViewModel AttributeData { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } = new List(); - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } = new List(); - - [JsonProperty("listTag")] - public List ListTag { get => SysTags.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - [JsonProperty("listCategory")] - public List ListCategory { get => SysCategories.Select(t => t.AttributeData.Property("title")).Distinct().ToList(); } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Expands - - //Get Property by name - public string Property(string name) - { - var prop = Properties.FirstOrDefault(p => p.Name.ToLower() == name.ToLower()); - return prop?.Value; - } - - public static async Task>> GetModelListByCategoryAsync( - int pageId, string specificulture - , string orderByPropertyName, Heart.Enums.MixHeartEnums.DisplayDirection direction - , int? pageSize = 1, int? pageIndex = 0, int? skip = null, int? top = null - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var query = context.MixPagePost.Include(ac => ac.MixPost) - .Where(ac => - ac.PageId == pageId && ac.Specificulture == specificulture - && ac.Status == MixContentStatus.Published).Select(ac => ac.MixPost); - PaginationModel result = await Repository.ParsePagingQueryAsync( - query, orderByPropertyName - , direction - , pageSize, pageIndex, skip, top - , context, transaction - ); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = result - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - Repository.LogErrorMessage(ex); - if (isRoot) - { - //if current transaction is root transaction - transaction.Rollback(); - } - - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #region Sync - - public static RepositoryResponse> GetModelListByCategory( - int pageId, string specificulture - , string orderByPropertyName, Heart.Enums.MixHeartEnums.DisplayDirection direction - , int? pageSize = 1, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var query = context.MixPagePost.Include(ac => ac.MixPost) - .Where(ac => - ac.PageId == pageId && ac.Specificulture == specificulture - && ac.Status == MixContentStatus.Published).Select(ac => ac.MixPost); - PaginationModel result = Repository.ParsePagingQuery( - query, orderByPropertyName - , direction - , pageSize, pageIndex - , null, null - , context, transaction - ); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = result - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - Repository.LogErrorMessage(ex); - if (isRoot) - { - //if current transaction is root transaction - transaction.Rollback(); - } - - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - public static RepositoryResponse> GetModelListByModule( - int ModuleId, string specificulture - , string orderByPropertyName, Heart.Enums.MixHeartEnums.DisplayDirection direction - , int? pageSize = 1, int? pageIndex = 0 - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - var query = context.MixModulePost.Include(ac => ac.MixPost) - .Where(ac => - ac.ModuleId == ModuleId && ac.Specificulture == specificulture - && (ac.Status == MixContentStatus.Published || ac.Status == MixContentStatus.Preview)).Select(ac => ac.MixPost); - PaginationModel result = Repository.ParsePagingQuery( - query, orderByPropertyName - , direction - , pageSize, pageIndex - , null, null - , context, transaction - ); - return new RepositoryResponse>() - { - IsSucceed = true, - Data = result - }; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - Repository.LogErrorMessage(ex); - if (isRoot) - { - //if current transaction is root transaction - transaction.Rollback(); - } - - return new RepositoryResponse>() - { - IsSucceed = false, - Data = null, - Exception = ex - }; - } - finally - { - if (isRoot) - { - //if current Context is Root - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - #endregion Sync - - #endregion Expands - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - LoadAttributes(_context, _transaction); - LoadTags(_context, _transaction); - LoadCategories(_context, _transaction); - } - - private void LoadTags(MixCmsContext context, IDbContextTransaction transaction) - { - var getTags = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture && m.Status == MixContentStatus.Published - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_TAG, context, transaction); - if (getTags.IsSucceed) - { - SysTags = getTags.Data; - } - } - - private void LoadCategories(MixCmsContext context, IDbContextTransaction transaction) - { - var getData = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_CATEGORY, context, transaction); - if (getData.IsSucceed) - { - SysCategories = getData.Data; - } - } - - #endregion Overrides - - #region Expands - - /// Loads the attributes. - /// The context. - /// The transaction. - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getAttrs = MixDatabases.UpdateViewModel.Repository.GetSingleModel(m => m.Name == MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST, _context, _transaction); - if (getAttrs.IsSucceed) - { - AttributeData = MixDatabaseDataAssociations.ReadMvcViewModel.Repository.GetFirstModel( - a => a.ParentId == Id.ToString() && a.Specificulture == Specificulture && a.MixDatabaseId == getAttrs.Data.Id - , _context, _transaction).Data; - } - } - - /// Get Post's Property by type and name - /// Type of field - /// Name of the field. - /// T - public T Property(string fieldName) - { - if (AttributeData != null) - { - var field = AttributeData.Data.Obj.GetValue(fieldName); - if (field != null) - { - return field.Value(); - } - else - { - return default; - } - } - else - { - return default; - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/Readme.md b/src/Mix.Cms.Lib/ViewModels/MixPosts/Readme.md deleted file mode 100644 index 8c5ef8fbc..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/Readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Apis: -## Mix.Cms.Lib.ViewModels.MixPosts.ReadMvcViewModel -### GetProperty -ex: Model.Property("[propName]"); -### GetModule -ex: Model.GetModule("[moduleSetName]"); -### GetMixDatabase -ex: Model.GetMixDatabase("[attrSetName]"); \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/SyncViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/SyncViewModel.cs deleted file mode 100644 index ea60a445b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/SyncViewModel.cs +++ /dev/null @@ -1,908 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class SyncViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonIgnore] - [JsonProperty("extraFields")] - public string ExtraFields { get; set; } = "[]"; - - [JsonIgnore] - [JsonProperty("extraProperties")] - public string ExtraProperties { get; set; } = "[]"; - - [JsonProperty("icon")] - public string Icon { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("categories")] - public List Pages { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } // Parent to Modules - - [JsonProperty("mediaNavs")] - public List MediaNavs { get; set; } - - [JsonProperty("moduleNavs")] - public List ModuleNavs { get; set; } - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("imageFileStream")] - public FileStreamViewModel ImageFileStream { get; set; } - - [JsonProperty("thumbnailFileStream")] - public FileStreamViewModel ThumbnailFileStream { get; set; } - - #region Template - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonProperty("templates")] - public List Templates { get; set; }// Post Templates - - [JsonIgnore] - public int ActivedTheme { - get { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string TemplateFolderType { - get { - return MixTemplateFolders.Posts; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Posts}"; - } - } - - #endregion Template - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("properties")] - public List Properties { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get; set; } - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("columns")] - public List Columns { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public SyncViewModel() : base() - { - } - - public SyncViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - ExtraFields = MixService.GetConfig("DefaultPostAttr"); - } - Cultures = LoadCultures(Specificulture, _context, _transaction); - UrlAliases = GetAliases(_context, _transaction); - if (!string.IsNullOrEmpty(this.Tags)) - { - ListTag = JArray.Parse(this.Tags); - } - - // Parsing Extra Properties fields - Columns = new List(); - JArray arrField = !string.IsNullOrEmpty(ExtraFields) ? JArray.Parse(ExtraFields) : new JArray(); - foreach (var field in arrField) - { - ModuleFieldViewModel thisField = new ModuleFieldViewModel() - { - Name = CommonHelper.ParseJsonPropertyName(field["name"].ToString()), - Title = field["title"]?.ToString(), - Options = field["options"] != null ? field["options"].Value() : new JArray(), - Priority = field["priority"] != null ? field["priority"].Value() : 0, - DataType = (MixDataType)(int)field["dataType"], - Width = field["width"] != null ? field["width"].Value() : 3, - IsUnique = field["isUnique"] != null ? field["isUnique"].Value() : true, - IsRequired = field["isRequired"] != null ? field["isRequired"].Value() : true, - IsDisplay = field["isDisplay"] != null ? field["isDisplay"].Value() : true, - IsSelect = field["isSelect"] != null ? field["isSelect"].Value() : false, - IsGroupBy = field["isGroupBy"] != null ? field["isGroupBy"].Value() : false, - }; - Columns.Add(thisField); - } - - // Parsing Extra Properties value - Properties = new List(); - - if (!string.IsNullOrEmpty(ExtraProperties)) - { - JArray arr = JArray.Parse(ExtraProperties); - foreach (JToken item in arr) - { - Properties.Add(item.ToObject()); - } - } - //Get Templates - this.Templates = this.Templates ?? MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.TemplateFolderType).Data; - View = MixTemplates.UpdateViewModel.GetTemplateByPath(Template, Specificulture, MixTemplateFolders.Posts, _context, _transaction); - - this.Template = $"{this.View?.FileFolder}/{this.View?.FileName}"; - - var getPagePost = MixPagePosts.ReadViewModel.GetPagePostNavAsync(Id, Specificulture, _context, _transaction); - if (getPagePost.IsSucceed) - { - this.Pages = getPagePost.Data; - this.Pages.ForEach(c => - { - c.IsActived = MixPagePosts.ReadViewModel.Repository.CheckIsExists(n => n.PageId == c.PageId && n.PostId == Id, _context, _transaction); - }); - } - - var getModulePost = MixModulePosts.ReadViewModel.GetModulePostNavAsync(Id, Specificulture, _context, _transaction); - if (getModulePost.IsSucceed) - { - this.Modules = getModulePost.Data; - this.Modules.ForEach(c => - { - c.IsActived = MixModulePosts.ReadViewModel.Repository.CheckIsExists(n => n.ModuleId == c.ModuleId && n.PostId == Id, _context, _transaction); - }); - } - var otherModules = MixModules.ReadListItemViewModel.Repository.GetModelListBy( - m => (m.Type == (int)MixModuleType.Content || m.Type == (int)MixModuleType.ListPost) - && m.Specificulture == Specificulture - && !Modules.Any(n => n.ModuleId == m.Id && n.Specificulture == m.Specificulture) - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, null, 0, _context, _transaction); - foreach (var item in otherModules.Data.Items) - { - Modules.Add(new MixModulePosts.ReadViewModel() - { - ModuleId = item.Id, - Image = item.Image, - PostId = Id, - Description = Title - }); - } - - // Medias - var getPostMedia = MixPostMedias.ReadViewModel.Repository.GetModelListBy(n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostMedia.IsSucceed) - { - MediaNavs = getPostMedia.Data.OrderBy(p => p.Priority).ToList(); - MediaNavs.ForEach(n => n.IsActived = true); - } - // Modules - var getPostModule = MixPostModules.ReadViewModel.Repository.GetModelListBy( - n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostModule.IsSucceed) - { - ModuleNavs = getPostModule.Data.OrderBy(p => p.Priority).ToList(); - foreach (var item in ModuleNavs) - { - item.IsActived = true; - item.Module.LoadData(postId: Id, _context: _context, _transaction: _transaction); - } - } - - // Related Posts - PostNavs = GetRelated(_context, _transaction); - var otherPosts = MixPosts.ReadListItemViewModel.Repository.GetModelListBy( - m => m.Id != Id && m.Specificulture == Specificulture - && !PostNavs.Any(n => n.SourceId == Id) - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, 10, 0, _context, _transaction); - foreach (var item in otherPosts.Data.Items) - { - PostNavs.Add(new MixPostPosts.ReadViewModel() - { - SourceId = Id, - Image = item.ImageUrl, - DestinationId = item.Id, - Description = item.Title - }); - } - } - - public override MixPost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - LastModified = DateTime.UtcNow; - PublishedDateTime = PublishedDateTime?.ToUniversalTime(); - - // Parsing Extra Fields to json string - var arrField = Columns != null ? JArray.Parse( - Newtonsoft.Json.JsonConvert.SerializeObject(Columns.OrderBy(c => c.Priority).Where( - c => !string.IsNullOrEmpty(c.Name)))) : new JArray(); - ExtraFields = arrField.ToString(Newtonsoft.Json.Formatting.None); - - // Parsing Extra Properties value - if (Properties != null && Properties.Count > 0) - { - JArray arrProperties = new JArray(); - foreach (var p in Properties.Where(p => !string.IsNullOrEmpty(p.Value) && !string.IsNullOrEmpty(p.Name))) - { - arrProperties.Add(JObject.FromObject(p)); - } - ExtraProperties = arrProperties.ToString(Formatting.None)?.Trim(); - } - - Template = View != null ? string.Format(@"{0}/{1}{2}", View.FolderType, View.FileName, View.Extension) : Template; - if (ThumbnailFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ThumbnailFileStream.Name); - bool saveThumbnail = CommonHelper.SaveFileBase64(folder, filename, ThumbnailFileStream.Base64); - if (saveThumbnail) - { - CommonHelper.RemoveFile(Thumbnail); - Thumbnail = $"{folder}/{filename}"; - } - } - if (ImageFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ImageFileStream.Name); - bool saveImage = CommonHelper.SaveFileBase64(folder, filename, ImageFileStream.Base64); - if (saveImage) - { - CommonHelper.RemoveFile(Image); - Image = $"{folder}/{filename}"; - } - } - - if (!string.IsNullOrEmpty(Image) && Image[0] == '/') { Image = Image.Substring(1); } - if (!string.IsNullOrEmpty(Thumbnail) && Thumbnail[0] == '/') { Thumbnail = Thumbnail.Substring(1); } - Tags = ListTag.ToString(Newtonsoft.Json.Formatting.None); - GenerateSEO(); - - return base.ParseModel(_context, _transaction); - } - - #region Async Methods - - public override async Task> SaveSubModelsAsync( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - if (result.IsSucceed) - { - foreach (var item in UrlAliases) - { - item.SourceId = parent.Id.ToString(); - item.Type = MixUrlAliasType.Post; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - result.Errors.AddRange(saveResult.Errors); - break; - } - } - } - if (result.IsSucceed) - { - var startMediaId = MixMedias.UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data; - foreach (var navMedia in MediaNavs) - { - if (navMedia.Media != null) - { - startMediaId += 1; - navMedia.Media.Specificulture = Specificulture; - navMedia.Media.Id = startMediaId; - var saveMedia = await navMedia.Media.SaveModelAsync(false, _context, _transaction); - if (saveMedia.IsSucceed) - { - navMedia.PostId = parent.Id; - navMedia.MediaId = saveMedia.Data.Model.Id; - navMedia.Specificulture = parent.Specificulture; - var saveResult = await navMedia.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - result.IsSucceed = false; - result.Exception = saveMedia.Exception; - Errors.AddRange(saveMedia.Errors); - } - } - } - } - if (result.IsSucceed) - { - foreach (var navModule in ModuleNavs) - { - navModule.PostId = parent.Id; - navModule.Specificulture = parent.Specificulture; - navModule.Status = MixContentStatus.Published; - if (navModule.IsActived) - { - var saveResult = await navModule.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await navModule.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - if (result.IsSucceed) - { - foreach (var navPost in PostNavs) - { - navPost.SourceId = parent.Id; - navPost.Status = MixContentStatus.Published; - navPost.Specificulture = parent.Specificulture; - if (navPost.IsActived) - { - var saveResult = await navPost.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await navPost.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - if (result.IsSucceed) - { - // Save Parent Category - foreach (var item in Pages) - { - item.PostId = parent.Id; - item.Description = parent.Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - if (result.IsSucceed) - { - // Save Parent Modules - foreach (var item in Modules) - { - item.PostId = parent.Id; - item.Description = parent.Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - #endregion Async Methods - - #region Sync Methods - - public override RepositoryResponse SaveSubModels( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - if (result.IsSucceed) - { - var startMediaId = MixMedias.UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data; - foreach (var navMedia in MediaNavs) - { - if (navMedia.Media != null) - { - startMediaId += 1; - navMedia.Media.Specificulture = Specificulture; - navMedia.Media.Id = startMediaId; - var saveMedia = navMedia.Media.SaveModel(false, _context, _transaction); - if (saveMedia.IsSucceed) - { - navMedia.PostId = parent.Id; - navMedia.MediaId = saveMedia.Data.Model.Id; - navMedia.Specificulture = parent.Specificulture; - var saveResult = navMedia.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - result.IsSucceed = false; - result.Exception = saveMedia.Exception; - Errors.AddRange(saveMedia.Errors); - } - } - } - } - if (result.IsSucceed) - { - foreach (var navModule in ModuleNavs) - { - navModule.PostId = parent.Id; - navModule.Specificulture = parent.Specificulture; - navModule.Status = MixContentStatus.Published; - if (navModule.IsActived) - { - var saveResult = navModule.SaveModel(true, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = navModule.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - if (result.IsSucceed) - { - // Save Parent Category - foreach (var item in Pages) - { - item.PostId = parent.Id; - item.Description = parent.Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - if (result.IsSucceed) - { - // Save Parent Modules - foreach (var item in Modules) - { - item.PostId = parent.Id; - item.Description = parent.Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - public override RepositoryResponse RemoveRelatedModels(SyncViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToList(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - result.IsSucceed = (_context.SaveChanges() > 0); - return result; - } - - #endregion Sync Methods - - #endregion Overrides - - #region Expands - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixPost.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - private void GenerateSEO() - { - if (string.IsNullOrEmpty(this.SeoName)) - { - this.SeoName = SeoHelper.GetSEOString(this.Title); - } - int i = 1; - string name = SeoName; - while (UpdateViewModel.Repository.CheckIsExists(a => a.SeoName == name && a.Specificulture == Specificulture && a.Id != Id)) - { - name = SeoName + "_" + i; - i++; - } - SeoName = name; - - if (string.IsNullOrEmpty(this.SeoTitle)) - { - this.SeoTitle = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoDescription)) - { - this.SeoDescription = SeoHelper.GetSEOString(this.Title); - } - - if (string.IsNullOrEmpty(this.SeoKeywords)) - { - this.SeoKeywords = SeoHelper.GetSEOString(this.Title); - } - } - - public List GetRelated(MixCmsContext context, IDbContextTransaction transaction) - { - var navs = MixPostPosts.ReadViewModel.Repository.GetModelListBy(n => n.SourceId == Id && n.Specificulture == Specificulture, context, transaction).Data; - navs.ForEach(n => n.IsActived = true); - return navs.OrderBy(p => p.Priority).ToList(); - } - - public List GetAliases(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixUrlAliases.UpdateViewModel.Repository.GetModelListBy(p => p.Specificulture == Specificulture - && p.SourceId == Id.ToString() && p.Type == (int)MixUrlAliasType.Post, context, transaction); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return new List(); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixPosts/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixPosts/UpdateViewModel.cs deleted file mode 100644 index 210c5ea81..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixPosts/UpdateViewModel.cs +++ /dev/null @@ -1,1223 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Common.Helper; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixPosts -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("template")] - public string Template { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonIgnore] - [JsonProperty("extraFields")] - public string ExtraFields { get; set; } = "[]"; - - [JsonIgnore] - [JsonProperty("extraProperties")] - public string ExtraProperties { get; set; } = "[]"; - - [JsonProperty("icon")] - public string Icon { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("excerpt")] - public string Excerpt { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("seoName")] - public string SeoName { get; set; } - - [JsonProperty("seoTitle")] - public string SeoTitle { get; set; } - - [JsonProperty("seoDescription")] - public string SeoDescription { get; set; } - - [JsonProperty("seoKeywords")] - public string SeoKeywords { get; set; } - - [JsonProperty("source")] - public string Source { get; set; } - - [JsonProperty("views")] - public int? Views { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("publishedDateTime")] - public DateTime? PublishedDateTime { get; set; } - - [JsonProperty("tags")] - public string Tags { get; set; } = "[]"; - - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("templatePath")] - public string TemplatePath { get; set; } - - [JsonProperty("domain")] - public string Domain => MixService.GetConfig(MixAppSettingKeywords.Domain); - - [JsonProperty("categories")] - public List Pages { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } // Parent to Modules - - [JsonProperty("mediaNavs")] - public List MediaNavs { get; set; } - - [JsonProperty("moduleNavs")] - public List ModuleNavs { get; set; } - - [JsonProperty("postNavs")] - public List PostNavs { get; set; } - - [JsonProperty("listTag")] - public JArray ListTag { get; set; } = new JArray(); - - [JsonProperty("imageFileStream")] - public FileStreamViewModel ImageFileStream { get; set; } - - [JsonProperty("thumbnailFileStream")] - public FileStreamViewModel ThumbnailFileStream { get; set; } - - [JsonProperty("sysCategories")] - public List SysCategories { get; set; } - - [JsonProperty("sysTags")] - public List SysTags { get; set; } - - #region Template - - [JsonProperty("view")] - public MixTemplates.UpdateViewModel View { get; set; } - - [JsonProperty("templates")] - public List Templates { get; set; }// Post Templates - - [JsonIgnore] - public int ActivedTheme - { - get - { - return MixService.GetConfig(MixAppSettingKeywords.ThemeId, Specificulture); - } - } - - [JsonIgnore] - public string TemplateFolderType - { - get - { - return MixTemplateFolders.Posts; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder - { - get - { - return $"{MixFolders.TemplatesFolder}/" + - $"{MixService.GetConfig(MixAppSettingKeywords.ThemeName, Specificulture)}/" + - $"{MixTemplateFolders.Posts}"; - } - } - - #endregion Template - - [JsonProperty("imageUrl")] - public string ImageUrl - { - get - { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl - { - get - { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("properties")] - public List Properties { get; set; } - - [JsonProperty("detailsUrl")] - public string DetailsUrl { get => Id > 0 ? $"/{Specificulture}/post/{Id}/{SeoName}" : null; } - - [JsonProperty("urlAliases")] - public List UrlAliases { get; set; } - - [JsonProperty("columns")] - public List Columns { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixPost model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Type = string.IsNullOrEmpty(Type) ? MixConstants.MixDatabaseName.ADDITIONAL_FIELD_POST : Type; - - Cultures = LoadCultures(Specificulture, _context, _transaction); - UrlAliases = GetAliases(_context, _transaction); - if (!string.IsNullOrEmpty(this.Tags)) - { - ListTag = JArray.Parse(this.Tags); - } - - LoadAttributes(_context, _transaction); - - //Get Templates - LoadTemplates(_context, _transaction); - - // Load Parent Pages - LoadParentPage(_context, _transaction); - - // Load Parent Modules - LoadParentModules(_context, _transaction); - - // Medias - LoadMedias(_context, _transaction); - - // Related Posts - LoadRelatedPost(_context, _transaction); - } - - public override MixPost ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - LastModified = DateTime.UtcNow; - PublishedDateTime = PublishedDateTime?.ToUniversalTime(); - - // Parsing Extra Fields to json string - var arrField = Columns != null ? JArray.Parse( - Newtonsoft.Json.JsonConvert.SerializeObject(Columns.OrderBy(c => c.Priority).Where( - c => !string.IsNullOrEmpty(c.Name)))) : new JArray(); - ExtraFields = arrField.ToString(Newtonsoft.Json.Formatting.None); - - // Parsing Extra Properties value - if (Properties != null && Properties.Count > 0) - { - JArray arrProperties = new JArray(); - foreach (var p in Properties.Where(p => !string.IsNullOrEmpty(p.Value) && !string.IsNullOrEmpty(p.Name))) - { - arrProperties.Add(JObject.FromObject(p)); - } - ExtraProperties = arrProperties.ToString(Formatting.None)?.Trim(); - } - - Template = View != null ? string.Format(@"{0}/{1}{2}", View.FolderType, View.FileName, View.Extension) : Template; - if (ThumbnailFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ThumbnailFileStream.Name); - bool saveThumbnail = CommonHelper.SaveFileBase64(folder, filename, ThumbnailFileStream.Base64); - if (saveThumbnail) - { - CommonHelper.RemoveFile(Thumbnail); - Thumbnail = $"{folder}/{filename}"; - } - } - if (ImageFileStream != null) - { - string folder = MixCmsHelper.GetUploadFolder(Specificulture); - string filename = CommonHelper.GetRandomName(ImageFileStream.Name); - bool saveImage = CommonHelper.SaveFileBase64(folder, filename, ImageFileStream.Base64); - if (saveImage) - { - CommonHelper.RemoveFile(Image); - Image = $"{folder}/{filename}"; - } - } - - if (!string.IsNullOrEmpty(Image) && Image[0] == '/') { Image = Image.Substring(1); } - if (!string.IsNullOrEmpty(Thumbnail) && Thumbnail[0] == '/') { Thumbnail = Thumbnail.Substring(1); } - Tags = ListTag.ToString(Newtonsoft.Json.Formatting.None); - GenerateSEO(_context, _transaction); - - return base.ParseModel(_context, _transaction); - } - - #region Async Methods - - #region Save Sub Models Async - - public override async Task> SaveSubModelsAsync( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - // Save Template - if (View.Id == 0) - { - var saveTemplate = await View.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - - if (result.IsSucceed) - { - // Save Alias - result = await SaveUrlAliasAsync(parent.Id, _context, _transaction); - } - if (result.IsSucceed && MediaNavs != null) - { - // Save Medias - result = await SaveMediasAsync(parent.Id, _context, _transaction); - } - //if (result.IsSucceed) - //{ - // // Save Sub Modules - // result = await SaveSubModulesAsync(parent.Id, _context, _transaction); - //} - - if (result.IsSucceed) - { - // Save Attributes - result = await SaveAttributeAsync(parent.Id, _context, _transaction); - } - - if (result.IsSucceed && PostNavs != null) - { - // Save related posts - result = await SaveRelatedPostAsync(parent.Id, _context, _transaction); - } - if (result.IsSucceed && Pages != null) - { - // Save Parent Category - result = await SaveParentPagesAsync(parent.Id, _context, _transaction); - } - - if (result.IsSucceed && Modules != null) - { - // Save Parent Modules - result = await SaveParentModulesAsync(parent.Id, _context, _transaction); - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - private async Task> SaveAttributeAsync(int parentId, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - foreach (var item in SysCategories) - { - // Force create new sub models if parent is create new - if (item.ParentId != parentId.ToString()) - { - item.Id = null; - } - if (result.IsSucceed) - { - item.ParentId = parentId.ToString(); - item.ParentType = MixDatabaseParentType.Post; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - - foreach (var item in SysTags) - { - // Force create new sub models if parent is create new - if (item.ParentId != parentId.ToString()) - { - item.Id = null; - } - if (result.IsSucceed) - { - item.ParentId = parentId.ToString(); - item.ParentType = MixDatabaseParentType.Post; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - private async Task> SaveParentModulesAsync(int newPostId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Modules) - { - // Force create new sub models if parent is create new - if (item.PostId != newPostId) - { - item.Id = 0; - } - item.Specificulture = Specificulture; - item.PostId = newPostId; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - if (!_context.MixModulePost.Any(m => m.Specificulture == item.Specificulture && m.PostId == item.PostId && m.ModuleId == item.ModuleId)) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private async Task> SaveParentPagesAsync(int newPostId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Pages) - { - // Force create new sub models if parent is create new - if (item.PostId != newPostId) - { - item.Id = 0; - } - item.Specificulture = Specificulture; - item.PostId = newPostId; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - if (!_context.MixPagePost.Any(m => m.Specificulture == item.Specificulture && m.PostId == item.PostId && m.PageId == item.PageId)) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - private async Task> SaveRelatedPostAsync(int newPostId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in PostNavs) - { - // Force create new sub models if parent is create new - if (item.SourceId != newPostId) - { - item.Id = 0; - } - item.SourceId = newPostId; - item.Status = MixContentStatus.Published; - item.Specificulture = Specificulture; - if (item.IsActived) - { - if (!_context.MixRelatedPost.Any(m => m.Specificulture == item.Specificulture && m.SourceId == item.SourceId && m.DestinationId == item.DestinationId)) - { - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - else - { - var saveResult = await item.RemoveModelAsync(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - } - } - return result; - } - - //private async Task> SaveSubModulesAsync(int id, MixCmsContext _context, IDbContextTransaction _transaction) - //{ - // var result = new RepositoryResponse() { IsSucceed = true }; - // foreach (var navModule in ModuleNavs) - // { - // navModule.PostId = id; - // navModule.Specificulture = Specificulture; - // navModule.Status = MixContentStatus.Published; - // if (navModule.IsActived) - // { - // var saveResult = await navModule.SaveModelAsync(false, _context, _transaction); - // ViewModelHelper.HandleResult(saveResult, ref result); - // } - // else - // { - // var saveResult = await navModule.RemoveModelAsync(false, _context, _transaction); - // ViewModelHelper.HandleResult(saveResult, ref result); - // } - // } - // return result; - //} - - private async Task> SaveMediasAsync(int newPostid, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navMedia in MediaNavs) - { - // Force create new sub models if parent is create new - if (navMedia.PostId != newPostid) - { - navMedia.Id = 0; - } - navMedia.PostId = newPostid; - navMedia.Specificulture = Specificulture; - - if (navMedia.IsActived) - { - if (navMedia.Id == 0) - { - var saveResult = await navMedia.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - else - { - var saveResult = await navMedia.RemoveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - private async Task> SaveUrlAliasAsync(int parentId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in UrlAliases) - { - // Force create new sub models if parent is create new - if (item.SourceId != parentId.ToString()) - { - item.Id = 0; - } - item.SourceId = parentId.ToString(); - item.Type = MixUrlAliasType.Post; - item.Specificulture = Specificulture; - var saveResult = await item.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - } - return result; - } - - #endregion Save Sub Models Async - - public override async Task> RemoveRelatedModelsAsync(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = await _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = await _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = await _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = await _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = await _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToListAsync(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - await _context.SaveChangesAsync(); - return result; - } - - public override Task>> CloneAsync(MixPost model, List cloneCultures, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - return base.CloneAsync(model, cloneCultures, _context, _transaction); - } - - #endregion Async Methods - - #region Sync Methods - - #region Save Sub Models - - public override RepositoryResponse SaveSubModels( - MixPost parent - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - // Save Template - if (View.Id == 0) - { - var saveTemplate = View.SaveModel(true, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - - if (result.IsSucceed) - { - // Save Alias - result = SaveUrlAlias(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Medias - result = SaveMedias(parent.Id, _context, _transaction); - } - //if (result.IsSucceed) - //{ - // // Save Sub Modules - // result = SaveSubModules(parent.Id, _context, _transaction); - //} - - if (result.IsSucceed) - { - // Save Attributes - result = SaveAttribute(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save related posts - result = SaveRelatedPost(parent.Id, _context, _transaction); - } - if (result.IsSucceed) - { - // Save Parent Category - result = SaveParentPages(parent.Id, _context, _transaction); - } - - if (result.IsSucceed) - { - // Save Parent Modules - result = SaveParentModules(parent.Id, _context, _transaction); - } - - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - result.IsSucceed = false; - result.Exception = ex; - return result; - } - } - - private RepositoryResponse SaveAttribute(int parentId, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in SysCategories) - { - if (result.IsSucceed) - { - item.ParentId = parentId.ToString(); - item.ParentType = MixDatabaseParentType.Post; - item.Specificulture = Specificulture; - var saveResult = item.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - - foreach (var item in SysTags) - { - if (result.IsSucceed) - { - item.ParentId = parentId.ToString(); - item.ParentType = MixDatabaseParentType.Post; - item.Specificulture = Specificulture; - var saveResult = item.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - - return result; - } - - private RepositoryResponse SaveParentModules(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Modules) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixModules.ReadListItemViewModel.Repository.RemoveCache(item.Module.Model, _context, _transaction); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixModules.ReadListItemViewModel.Repository.RemoveCache(item.Module.Model, _context, _transaction); - } - } - } - return result; - } - - private RepositoryResponse SaveParentPages(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Pages) - { - item.PostId = id; - item.Description = Title; - item.Image = ThumbnailUrl; - item.Status = MixContentStatus.Published; - if (item.IsActived) - { - var saveResult = item.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixPages.ReadListItemViewModel.Repository.RemoveCache(item.Page.Model, _context, _transaction); - } - } - else - { - var saveResult = item.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixPages.ReadListItemViewModel.Repository.RemoveCache(item.Page.Model, _context, _transaction); - } - } - } - return result; - } - - private RepositoryResponse SaveRelatedPost(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navPost in PostNavs) - { - navPost.SourceId = id; - navPost.Status = MixContentStatus.Published; - navPost.Specificulture = Specificulture; - if (navPost.IsActived) - { - var saveResult = navPost.SaveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixPosts.ReadViewModel.Repository.RemoveCache(navPost.RelatedPost.Model); - } - } - else - { - var saveResult = navPost.RemoveModel(false, _context, _transaction); - result.IsSucceed = saveResult.IsSucceed; - if (!result.IsSucceed) - { - result.Exception = saveResult.Exception; - Errors.AddRange(saveResult.Errors); - } - else - { - MixPosts.ReadViewModel.Repository.RemoveCache(navPost.RelatedPost.Model); - } - } - } - return result; - } - - private RepositoryResponse SaveMedias(int id, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var navMedia in MediaNavs) - { - navMedia.PostId = id; - navMedia.Specificulture = Specificulture; - - if (navMedia.IsActived) - { - var saveResult = navMedia.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var saveResult = navMedia.RemoveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - return result; - } - - private RepositoryResponse SaveUrlAlias(int parentId, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in UrlAliases) - { - item.SourceId = parentId.ToString(); - item.Type = MixUrlAliasType.Post; - item.Specificulture = Specificulture; - var saveResult = item.SaveModel(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - } - return result; - } - - #endregion Save Sub Models - - public override RepositoryResponse RemoveRelatedModels(UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() - { - IsSucceed = true - }; - - if (result.IsSucceed) - { - var navCate = _context.MixPagePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navCate) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navModule = _context.MixModulePost.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navMedia = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navMedia) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - if (result.IsSucceed) - { - var navModule = _context.MixPostModule.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navModule) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navRelated = _context.MixPostMedia.Where(n => n.PostId == Id && n.Specificulture == Specificulture).ToList(); - foreach (var item in navRelated) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - if (result.IsSucceed) - { - var navs = _context.MixUrlAlias.Where(n => n.SourceId == Id.ToString() && n.Type == (int)MixUrlAliasType.Post && n.Specificulture == Specificulture).ToList(); - foreach (var item in navs) - { - _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; - } - } - - result.IsSucceed = (_context.SaveChanges() > 0); - return result; - } - - #endregion Sync Methods - - #endregion Overrides - - #region Expands - - private void LoadRelatedPost(MixCmsContext _context, IDbContextTransaction _transaction) - { - PostNavs = GetRelated(_context, _transaction); - } - - private void LoadMedias(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getPostMedia = MixPostMedias.ReadViewModel.Repository.GetModelListBy(n => n.PostId == Id && n.Specificulture == Specificulture, _context, _transaction); - if (getPostMedia.IsSucceed) - { - MediaNavs = getPostMedia.Data.OrderBy(p => p.Priority).ToList(); - MediaNavs.ForEach(n => { n.Specificulture = Specificulture; n.IsActived = true; }); - } - } - - private void LoadParentModules(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getModulePost = MixModulePosts.ReadViewModel.GetModulePostNavAsync(Id, Specificulture, _context, _transaction); - if (getModulePost.IsSucceed) - { - foreach (var item in getModulePost.Data) - { - item.Description = item.Module?.Title ?? item.Description; - item.Specificulture = Specificulture; - item.Image = item.Module?.ImageUrl ?? item.Image; - } - this.Modules = getModulePost.Data; - this.Modules.ForEach(c => - { - c.IsActived = MixModulePosts.ReadViewModel.Repository.CheckIsExists(n => n.ModuleId == c.ModuleId && n.PostId == Id, _context, _transaction); - }); - } - var otherModules = MixModules.ReadListItemViewModel.Repository.GetModelListBy( - m => (m.Type == (int)MixModuleType.Content || m.Type == (int)MixModuleType.ListPost) - && m.Specificulture == Specificulture - //&& !Modules.Any(n => n.ModuleId == m.Id && n.Specificulture == m.Specificulture) - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, null, 0, _context, _transaction); - if (otherModules.Data != null) - { - foreach (var item in otherModules.Data.Items) - { - if (!Modules.Any(m => m.ModuleId == Id && m.Specificulture == Specificulture)) - { - Modules.Add(new MixModulePosts.ReadViewModel() - { - ModuleId = item.Id, - Image = item.Image, - PostId = Id, - Description = item.Title - }); - } - } - } - } - - private void LoadParentPage(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getPagePost = MixPagePosts.ReadViewModel.GetPagePostNavAsync(Id, Specificulture, _context, _transaction); - if (getPagePost.IsSucceed) - { - this.Pages = getPagePost.Data; - this.Pages.ForEach(c => - { - c.Specificulture = Specificulture; - c.Description = c.Page?.Title ?? c.Description; - c.IsActived = MixPagePosts.ReadViewModel.Repository.CheckIsExists(n => n.PageId == c.PageId && n.PostId == Id, _context, _transaction); - }); - } - } - - private void LoadTemplates(MixCmsContext _context, IDbContextTransaction _transaction) - { - this.Templates = this.Templates ?? MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Id == ActivedTheme && t.FolderType == this.TemplateFolderType, _context, _transaction).Data; - View = MixTemplates.UpdateViewModel.GetTemplateByPath(Template, Specificulture, MixTemplateFolders.Posts, _context, _transaction); - this.Template = $"{this.View?.TemplateFolder}/{this.View?.FolderType}/{this.View?.FileName}{this.View?.Extension}"; - } - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixPost.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - private void LoadAttributes(MixCmsContext _context, IDbContextTransaction _transaction) - { - var getCategories = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_CATEGORY, _context, _transaction); - if (getCategories.IsSucceed) - { - SysCategories = getCategories.Data; - } - - var getTags = MixDatabaseDataAssociations.FormViewModel.Repository.GetModelListBy(m => m.Specificulture == Specificulture - && m.ParentId == Id.ToString() && m.ParentType == MixDatabaseParentType.Post - && m.MixDatabaseName == MixConstants.MixDatabaseName.SYSTEM_TAG, _context, _transaction); - if (getTags.IsSucceed) - { - SysTags = getTags.Data; - } - } - - private void GenerateSEO(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(this.SeoName)) - { - this.SeoName = SeoHelper.GetSEOString(this.Title); - } - int i = 1; - string name = SeoName; - while (UpdateViewModel.Repository.CheckIsExists(a => a.SeoName == name && a.Specificulture == Specificulture && a.Id != Id, _context, _transaction)) - { - name = SeoName + "_" + i; - i++; - } - SeoName = name; - - if (string.IsNullOrEmpty(this.SeoTitle)) - { - this.SeoTitle = this.Title; - } - - if (string.IsNullOrEmpty(this.Excerpt)) - { - this.SeoDescription = this.Excerpt; - } - - if (string.IsNullOrEmpty(this.SeoKeywords)) - { - this.SeoKeywords = SeoHelper.GetSEOString(this.Title); - } - } - - public List GetRelated(MixCmsContext context, IDbContextTransaction transaction) - { - var navs = MixPostPosts.ReadViewModel.Repository.GetModelListBy(n => n.SourceId == Id && n.Specificulture == Specificulture, context, transaction).Data; - navs.ForEach(n => { n.Specificulture = Specificulture; n.IsActived = true; }); - return navs.OrderBy(p => p.Priority).ToList(); - } - - public List GetAliases(MixCmsContext context, IDbContextTransaction transaction) - { - var result = MixUrlAliases.UpdateViewModel.Repository.GetModelListBy(p => p.Specificulture == Specificulture - && p.SourceId == Id.ToString() && p.Type == (int)MixUrlAliasType.Post, context, transaction); - if (result.IsSucceed) - { - return result.Data; - } - else - { - return new List(); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/DeleteViewModel.cs deleted file mode 100644 index 62cdb8f74..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/DeleteViewModel.cs +++ /dev/null @@ -1,144 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } - - [JsonIgnore] - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonIgnore] - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonIgnore] - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - [JsonProperty("templatePath")] - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - //TO DO Ref swastika core MixTemplateViewModel for spa view - - #endregion Views - - #endregion Properties - - #region Contructors - - public DeleteViewModel() - : base() - { - } - - public DeleteViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Common - - public override MixTemplate ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - CreatedDateTime = DateTime.UtcNow; - } - FileFolder = $"{MixFolders.TemplatesFolder}/{ThemeName}/{FolderType}"; - return base.ParseModel(_context, _transaction); - } - - #endregion Common - - #region Async - - public override RepositoryResponse RemoveModel(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.RemoveModel(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - #endregion Async - - #region Async - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ImportViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/ImportViewModel.cs deleted file mode 100644 index 4240ff6ed..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ImportViewModel.cs +++ /dev/null @@ -1,312 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class ImportViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } = ".cshtml"; - - [Required] - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("mobileContent")] - public string MobileContent { get; set; } = "{}"; - - [JsonProperty("spaContent")] - public string SpaContent { get; set; } = ""; - - [JsonProperty("scripts")] - public string Scripts { get; set; } - - [JsonProperty("styles")] - public string Styles { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - [JsonProperty("templatePath")] - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ImportViewModel() - : base() - { - } - - public ImportViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Common - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (!string.IsNullOrEmpty(FileName)) - { - var file = MixFileRepository.Instance.GetFile(FileName, Extension, FileFolder); - if (!string.IsNullOrWhiteSpace(file?.Content)) - { - Content = file.Content; - } - } - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (Id == 0) - { - if (_context.MixTemplate.Any(t => t.FileName == FileName && t.FolderType == FolderType && t.ThemeId == ThemeId)) - { - IsValid = false; - Errors.Add($"{FileName} is existed"); - } - } - if (string.IsNullOrEmpty(ThemeName) && ThemeId > 0) - { - ThemeName = _context.MixTheme.FirstOrDefault(m => m.Id == ThemeId)?.Name; - } - } - } - - public override MixTemplate ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - FileFolder = $"{MixFolders.TemplatesFolder}/{ThemeName}/{FolderType}"; - Content = Content?.Trim(); - Scripts = Scripts?.Trim(); - Styles = Styles?.Trim(); - return base.ParseModel(_context, _transaction); - } - - #endregion Common - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - // Save other themes if not exist - } - return result; - } - - public override RepositoryResponse RemoveModel(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.RemoveModel(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModels(parent, _context, _transaction); - } - - #endregion Async - - #region Async - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override Task> SaveSubModelsAsync(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModelsAsync(parent, _context, _transaction); - } - - #endregion Async - - #endregion Overrides - - #region Expands - - /// - /// Gets the template by path. - /// - /// The path. Ex: "Pages/_Home" - /// - public static RepositoryResponse GetTemplateByPath(string path, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse(); - string[] temp = path?.Split('/'); - if (temp == null || temp.Length < 2) - { - result.IsSucceed = false; - result.Errors.Add("Template Not Found"); - } - else - { - int activeThemeId = MixService.GetConfig( - MixAppSettingKeywords.ThemeId, culture); - string name = temp[1].Split('.')[0]; - result = Repository.GetSingleModel(t => t.FolderType == temp[0] && t.FileName == name && t.ThemeId == activeThemeId - , _context, _transaction); - } - return result; - } - - public static ImportViewModel GetTemplateByPath( - string path, string specificulture, string folderType, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - string templateName = path?.Split('/')[1]; - int themeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture); - string themeName = MixService.GetConfig(MixAppSettingKeywords.ThemeName, specificulture); - var getView = ImportViewModel.Repository.GetSingleModel(t => - t.ThemeId == themeId && t.FolderType == folderType.ToString() - && !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}"), _context, _transaction); - return getView.Data ?? GetDefault(folderType, specificulture); - } - - public static ImportViewModel GetDefault(string folderType, string specificulture) - { - string activedTheme = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, specificulture) - ?? MixService.GetConfig(MixAppSettingKeywords.DefaultTheme); - string folder = $"{MixFolders.TemplatesFolder}/{activedTheme}/{folderType}"; - var defaulTemplate = MixTemplates.ImportViewModel.Repository.GetModelListBy( - t => t.Theme.Name == activedTheme && t.FolderType == folderType.ToString()).Data?.FirstOrDefault(); - return defaulTemplate ?? new ImportViewModel(new MixTemplate() - { - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture), - ThemeName = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, specificulture), - FileName = MixService.GetConfig(MixAppSettingKeywords.DefaultTemplate), - Extension = MixService.GetConfig(MixAppSettingKeywords.TemplateExtension), - Content = MixService.GetConfig(MixAppSettingKeywords.DefaultTemplateContent), - FolderType = folderType.ToString(), - FileFolder = folder.ToString() - }); - } - - public async Task> CopyAsync() - { - var result = await Repository.GetSingleModelAsync(m => m.Id == Id); - result.Data.Id = 0; - result.Data.FileName = $"Copy_{result.Data.FileName}"; - // Not write file to disk - return await result.Data.SaveModelAsync(false); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/InitViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/InitViewModel.cs deleted file mode 100644 index 492978f0a..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/InitViewModel.cs +++ /dev/null @@ -1,195 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class InitViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } - - [Required] - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("mobileContent")] - public string MobileContent { get; set; } = "{}"; - - [JsonProperty("spaContent")] - public string SpaContent { get; set; } = ""; - - [JsonProperty("scripts")] - public string Scripts { get; set; } - - [JsonProperty("styles")] - public string Styles { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - #endregion Views - - #endregion Properties - - #region Contructors - - public InitViewModel() - : base() - { - } - - public InitViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Common - - public override MixTemplate ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - CreatedDateTime = DateTime.UtcNow; - } - FileFolder = $"{MixFolders.TemplatesFolder}/{ThemeName}/{FolderType}"; - Content = Content?.Trim(); - Scripts = Scripts?.Trim(); - Styles = Styles?.Trim(); - return base.ParseModel(_context, _transaction); - } - - #endregion Common - - #region Async - - public override RepositoryResponse RemoveModel(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.RemoveModel(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModels(parent, _context, _transaction); - } - - #endregion Async - - #region Async - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override Task> SaveSubModelsAsync(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModelsAsync(parent, _context, _transaction); - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadListItemViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadListItemViewModel.cs deleted file mode 100644 index 71fd5cff6..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadListItemViewModel.cs +++ /dev/null @@ -1,163 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class ReadListItemViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } - - [JsonProperty("scripts")] - public string Scripts { get; set; } - - [JsonProperty("styles")] - public string Styles { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - [JsonProperty("templatePath")] - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - //TO DO Ref swastika core MixTemplateViewModel for spa view - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadListItemViewModel() - : base() - { - } - - public ReadListItemViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Expands - - /// - /// Gets the template by path. - /// - /// The path. Ex: "Pages/_Home" - /// - public static RepositoryResponse GetTemplateByPath(string path, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse(); - string[] temp = path.Split('/'); - if (temp.Length < 2) - { - result.IsSucceed = false; - result.Errors.Add("Template Not Found"); - } - else - { - int activeThemeId = MixService.GetConfig( - MixAppSettingKeywords.ThemeId, culture); - string name = temp[1].Split('.')[0]; - result = Repository.GetSingleModel(t => t.FolderType == temp[0] && t.FileName == name && t.ThemeId == activeThemeId - , _context, _transaction); - } - return result; - } - - public static ReadListItemViewModel GetTemplateByPath(int themeId, string path, string type, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - string templateName = path?.Split('/')[1]; - var getView = ReadListItemViewModel.Repository.GetSingleModel(t => - t.ThemeId == themeId && t.FolderType == type - && !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}"), _context, _transaction); - return getView.Data; - } - - public static ReadListItemViewModel GetDefault(string activedTemplate, string folderType, string folder, string specificulture) - { - return new ReadListItemViewModel(new MixTemplate() - { - Extension = MixService.GetConfig("TemplateExtension"), - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture), - ThemeName = activedTemplate, - FolderType = folderType, - FileFolder = folder, - FileName = MixService.GetConfig("DefaultTemplate"), - Content = "
" - }); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadViewModel.cs deleted file mode 100644 index dd47c516a..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/ReadViewModel.cs +++ /dev/null @@ -1,283 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("mobileContent")] - public string MobileContent { get; set; } = "{}"; - - [JsonProperty("spaContent")] - public string SpaContent { get; set; } = ""; - - [JsonProperty("scripts")] - public string Scripts { get; set; } - - [JsonProperty("styles")] - public string Styles { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - [JsonProperty("templatePath")] - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - //TO DO Ref swastika core MixTemplateViewModel for spa view - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() - : base() - { - } - - public ReadViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Common - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var file = MixFileRepository.Instance.GetFile(FileName, Extension, FileFolder); - if (!string.IsNullOrWhiteSpace(file?.Content)) - { - Content = file.Content; - } - } - - public override MixTemplate ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - CreatedDateTime = DateTime.UtcNow; - } - FileFolder = $"{MixFolders.TemplatesFolder}/{ThemeName}/{FolderType}"; - Content = Content?.Trim(); - Scripts = Scripts?.Trim(); - Styles = Styles?.Trim(); - return base.ParseModel(_context, _transaction); - } - - #endregion Common - - #region Async - - public override RepositoryResponse RemoveModel(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.RemoveModel(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModels(parent, _context, _transaction); - } - - #endregion Async - - #region Async - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override Task> SaveSubModelsAsync(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModelsAsync(parent, _context, _transaction); - } - - #endregion Async - - #endregion Overrides - - #region Expands - - /// - /// Gets the template by path. - /// - /// The path. Ex: "Pages/_Home" - /// - public static RepositoryResponse GetTemplateByPath(string path, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse(); - string[] temp = path.Split('/'); - if (temp.Length < 2) - { - result.IsSucceed = false; - result.Errors.Add("Template Not Found"); - } - else - { - int activeThemeId = MixService.GetConfig( - MixAppSettingKeywords.ThemeId, culture); - string name = temp[1].Split('.')[0]; - result = Repository.GetSingleModel(t => t.FolderType == temp[0] && t.FileName == name && t.ThemeId == activeThemeId - , _context, _transaction); - } - return result; - } - - /// - /// Gets the template by path. - /// - /// The path. Ex: "Pages/_Home" - /// - public static async Task> GetTemplateByPathAsync(string path, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse(); - string[] temp = path.Split('/'); - if (temp.Length < 2) - { - result.IsSucceed = false; - result.Errors.Add("Template Not Found"); - } - else - { - int activeThemeId = MixService.GetConfig( - MixAppSettingKeywords.ThemeId, culture); - string name = temp[1].Split('.')[0]; - result = await Repository.GetSingleModelAsync(t => t.FolderType == temp[0] && t.FileName == name && t.ThemeId == activeThemeId - , _context, _transaction); - } - return result; - } - - public static ReadViewModel GetTemplateByPath(int themeId, string path, string type, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - string templateName = path?.Split('/')[1]; - var getView = ReadViewModel.Repository.GetSingleModel(t => - t.ThemeId == themeId && t.FolderType == type - && !string.IsNullOrEmpty(templateName) && templateName.Equals($"{t.FileName}{t.Extension}"), _context, _transaction); - return getView.Data; - } - - public static ReadViewModel GetDefault(string activedTemplate, string folderType, string folder, string specificulture) - { - return new ReadViewModel(new MixTemplate() - { - Extension = MixService.GetConfig("TemplateExtension"), - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture), - ThemeName = activedTemplate, - FolderType = folderType, - FileFolder = folder, - FileName = MixService.GetConfig("DefaultTemplate"), - Content = "
" - }); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixTemplates/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixTemplates/UpdateViewModel.cs deleted file mode 100644 index ce86bf323..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixTemplates/UpdateViewModel.cs +++ /dev/null @@ -1,318 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Repositories; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixTemplates -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("themeId")] - public int ThemeId { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - [JsonProperty("folderType")] - public string FolderType { get; set; } - - [JsonProperty("fileFolder")] - public string FileFolder { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } - - [JsonProperty("extension")] - public string Extension { get; set; } = ".cshtml"; - - [Required] - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("mobileContent")] - public string MobileContent { get; set; } = "{}"; - - [JsonProperty("spaContent")] - public string SpaContent { get; set; } = ""; - - [JsonProperty("scripts")] - public string Scripts { get; set; } - - [JsonProperty("styles")] - public string Styles { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("layout")] - public string Layout { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{ThemeName}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{ThemeName}"; - } - } - - [JsonProperty("templatePath")] - public string TemplatePath { - get { - return $"/{FileFolder}/{FileName}{Extension}"; - } - } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() - : base() - { - } - - public UpdateViewModel(MixTemplate model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - #region Common - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (!string.IsNullOrEmpty(FileName)) - { - var file = MixFileRepository.Instance.GetFile(FileName, Extension, FileFolder); - if (!string.IsNullOrWhiteSpace(file?.Content)) - { - Content = file.Content; - } - } - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (Id == 0) - { - if (_context.MixTemplate.Any(t => t.FileName == FileName && t.FolderType == FolderType && t.ThemeId == ThemeId)) - { - IsValid = false; - Errors.Add($"{FileName} is existed"); - } - } - if (string.IsNullOrEmpty(ThemeName) && ThemeId > 0) - { - ThemeName = _context.MixTheme.FirstOrDefault(m => m.Id == ThemeId)?.Name; - } - } - } - - public override MixTemplate ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - } - FileFolder = $"{MixFolders.TemplatesFolder}/{ThemeName}/{FolderType}"; - Content = Content?.Trim(); - Scripts = Scripts?.Trim(); - Styles = Styles?.Trim(); - return base.ParseModel(_context, _transaction); - } - - #endregion Common - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - // Save other themes if not exist - } - return result; - } - - public override RepositoryResponse RemoveModel(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.RemoveModel(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override RepositoryResponse SaveSubModels(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModels(parent, _context, _transaction); - } - - #endregion Async - - #region Async - - public override async Task> RemoveModelAsync(bool isRemoveRelatedModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.RemoveModelAsync(isRemoveRelatedModels, _context, _transaction); - if (result.IsSucceed) - { - TemplateRepository.Instance.DeleteTemplate(FileName, FileFolder); - } - return result; - } - - public override Task> SaveSubModelsAsync(MixTemplate parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - TemplateRepository.Instance.SaveTemplate(new TemplateViewModel() - { - Filename = FileName, - Extension = Extension, - Content = Content, - FileFolder = FileFolder - }); - return base.SaveSubModelsAsync(parent, _context, _transaction); - } - - #endregion Async - - #endregion Overrides - - #region Expands - - /// - /// Gets the template by path. - /// - /// The path. Ex: "Pages/_Home" - /// - public static RepositoryResponse GetTemplateByPath(string path, string culture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse(); - string[] temp = path?.Split('/'); - if (temp == null || temp.Length < 2) - { - result.IsSucceed = false; - result.Errors.Add("Template Not Found"); - } - else - { - int activeThemeId = MixService.GetConfig( - MixAppSettingKeywords.ThemeId, culture); - string name = temp[1].Split('.')[0]; - result = Repository.GetSingleModel(t => t.FolderType == temp[0] && t.FileName == name && t.ThemeId == activeThemeId - , _context, _transaction); - } - return result; - } - - public static UpdateViewModel GetTemplateByPath(string path, string specificulture, string folderType - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - string templateName = !string.IsNullOrEmpty(path) ? path.Substring(path.LastIndexOf('/') + 1) : null; - string filename = templateName?.Substring(0, templateName.LastIndexOf('.')); - string ext = templateName?.Substring(templateName.LastIndexOf('.')); - int themeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture); - string themeName = MixService.GetConfig(MixAppSettingKeywords.ThemeName, specificulture); - var getView = UpdateViewModel.Repository.GetSingleModel(t => - t.ThemeId == themeId && t.FolderType == folderType.ToString() - && !string.IsNullOrEmpty(templateName) && t.FileName == filename && t.Extension == ext - , _context, _transaction); - return getView.Data ?? GetDefault(folderType, specificulture, _context, _transaction); - } - - public static UpdateViewModel GetDefault(string folderType, string specificulture - , MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - string activedTheme = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, specificulture) - ?? MixService.GetConfig(MixAppSettingKeywords.DefaultTheme); - string folder = $"{MixFolders.TemplatesFolder}/{activedTheme}/{folderType}"; - var defaulTemplate = MixTemplates.UpdateViewModel.Repository.GetModelListBy( - t => t.Theme.Name == activedTheme && t.FolderType == folderType.ToString() - , _context, _transaction - ).Data?.FirstOrDefault(); - return defaulTemplate ?? new UpdateViewModel(new MixTemplate() - { - ThemeId = MixService.GetConfig(MixAppSettingKeywords.ThemeId, specificulture), - ThemeName = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, specificulture), - FileName = MixService.GetConfig(MixAppSettingKeywords.DefaultTemplate), - Extension = MixService.GetConfig(MixAppSettingKeywords.TemplateExtension), - Content = MixService.GetConfig(MixAppSettingKeywords.DefaultTemplateContent), - FolderType = folderType.ToString(), - FileFolder = folder.ToString() - }); - } - - public async Task> CopyAsync() - { - var result = await Repository.GetSingleModelAsync(m => m.Id == Id); - result.Data.Id = 0; - result.Data.FileName = $"Copy_{result.Data.FileName}"; - // Not write file to disk - return await result.Data.SaveModelAsync(false); - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixThemes/DeleteViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixThemes/DeleteViewModel.cs deleted file mode 100644 index 219caba28..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixThemes/DeleteViewModel.cs +++ /dev/null @@ -1,178 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixThemes -{ - public class DeleteViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("templateAsset")] - public FileViewModel TemplateAsset { get; set; } - - [JsonProperty("asset")] - public FileViewModel Asset { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.WebRootPath}/{MixFolders.SiteContentAssetsFolder}/{Name}/assets"; - } - } - - public string UploadsFolder { - get { - return $"{MixFolders.WebRootPath}/{MixFolders.SiteContentAssetsFolder}"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{Name}"; - } - } - - public List Templates { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public DeleteViewModel() - : base() - { - } - - public DeleteViewModel(MixTheme model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Templates = MixTemplates.DeleteViewModel.Repository.GetModelListBy(t => t.ThemeId == Id, - _context: _context, _transaction: _transaction).Data; - TemplateAsset = new FileViewModel() { FileFolder = $"{MixFolders.WebRootPath}/{MixFolders.ImportFolder}/{DateTime.UtcNow.ToShortDateString()}/{Name}" }; - Asset = new FileViewModel() { FileFolder = AssetFolder }; - } - - #region Async - - public override async Task> RemoveRelatedModelsAsync(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Templates) - { - if (result.IsSucceed) - { - var tmp = await item.RemoveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(tmp, ref result); - } - } - if (result.IsSucceed) - { - MixFileRepository.Instance.DeleteFolder(AssetFolder); - } - - if (result.IsSucceed) - { - MixFileRepository.Instance.DeleteFolder(TemplateFolder); - } - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixThemes/Helper.cs b/src/Mix.Cms.Lib/ViewModels/MixThemes/Helper.cs deleted file mode 100644 index 51dd9caa0..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixThemes/Helper.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixThemes -{ - public class Helper - { - public static async Task> ExportTheme( - int id, SiteStructureViewModel data, - string culture, string scheme, string host) - { - var getTheme = await ReadViewModel.Repository.GetSingleModelAsync( - theme => theme.Id == id).ConfigureAwait(false); - - //path to temporary folder - string tempPath = $"{MixFolders.WebRootPath}/{MixFolders.ExportFolder}/Themes/{getTheme.Data.Name}/temp"; - string outputPath = $"{MixFolders.ExportFolder}/Themes/{getTheme.Data.Name}"; - data.ThemeName = getTheme.Data.Name; - data.Specificulture = culture; - var result = data.ExportSelectedItemsAsync(); - if (result.IsSucceed) - { - string domain = MixService.GetConfig(MixAppSettingKeywords.Domain); - string accessFolder = $"{MixFolders.SiteContentAssetsFolder}/{getTheme.Data.Name}/assets"; - string content = JObject.FromObject(data).ToString() - .Replace(accessFolder, "[ACCESS_FOLDER]") - .Replace($"/{culture}/", "/[CULTURE]/") - .Replace($"/{data.ThemeName}/", "/[THEME_NAME]/"); - if (!string.IsNullOrEmpty(domain)) - { - content = content.Replace(domain, string.Empty); - } - string filename = $"schema"; - var file = new FileViewModel() - { - Filename = filename, - Extension = MixFileExtensions.Json, - FileFolder = $"{tempPath}/Data", - Content = content - }; - - // Delete Existing folder - MixFileRepository.Instance.DeleteWebFolder(outputPath); - // Copy current templates file - MixFileRepository.Instance.CopyDirectory($"{getTheme.Data.TemplateFolder}", $"{tempPath}/Templates"); - // Copy current assets files - MixFileRepository.Instance.CopyDirectory($"{MixFolders.WebRootPath}/{getTheme.Data.AssetFolder}", $"{tempPath}/Assets"); - // Copy current uploads files - MixFileRepository.Instance.CopyDirectory($"{MixFolders.WebRootPath}/{getTheme.Data.UploadsFolder}", $"{tempPath}/Uploads"); - // Save Site Structures - MixFileRepository.Instance.SaveFile(file); - - // Zip to [theme_name].zip ( wwwroot for web path) - string filePath = MixFileRepository.Instance.ZipFolder($"{tempPath}", outputPath, $"{getTheme.Data.Name}-{Guid.NewGuid()}"); - - // Delete temp folder - MixFileRepository.Instance.DeleteWebFolder($"{outputPath}/Assets"); - MixFileRepository.Instance.DeleteWebFolder($"{outputPath}/Uploads"); - MixFileRepository.Instance.DeleteWebFolder($"{outputPath}/Templates"); - MixFileRepository.Instance.DeleteWebFolder($"{outputPath}/Data"); - - return new RepositoryResponse() - { - IsSucceed = !string.IsNullOrEmpty(outputPath), - Data = $"{scheme}://{host}/{filePath}" - }; - } - else - { - return result; - } - } - - public static async Task> InitTheme(string model, string userName, string culture, IFormFile assets, IFormFile theme) - { - var json = JObject.Parse(model); - var data = json.ToObject(); - if (data != null) - { - data.CreatedBy = userName; - string importFolder = $"{MixFolders.ImportFolder}/" + - $"{DateTime.UtcNow.ToString("dd-MM-yyyy")}"; - if (theme != null) - { - MixFileRepository.Instance.SaveWebFile(theme, $"{importFolder}"); - data.TemplateAsset = new FileViewModel(theme, importFolder); - } - else - { - if (data.IsCreateDefault) - { - data.TemplateAsset = new FileViewModel() - { - Filename = "default", - Extension = MixFileExtensions.Zip, - FileFolder = MixFolders.ImportFolder - }; - } - else - { - data.TemplateAsset = new FileViewModel() - { - Filename = "default_blank", - Extension = MixFileExtensions.Zip, - FileFolder = MixFolders.ImportFolder - }; - } - } - - data.Title = MixService.GetConfig(MixAppSettingKeywords.SiteName, culture); - data.Name = SeoHelper.GetSEOString(data.Title); - data.Specificulture = culture; - var result = await data.SaveModelAsync(true); - if (result.IsSucceed) - { - // MixService.SetConfig(MixAppSettingKeywords.SiteName, _lang, data.Title); - MixService.LoadFromDatabase(); - MixService.SetConfig("InitStatus", 3); - MixService.SetConfig("IsInit", false); - MixService.SaveSettings(); - _ = Mix.Services.MixCacheService.RemoveCacheAsync(); - MixService.Reload(); - } - return result; - } - return new RepositoryResponse(); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixThemes/InitViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixThemes/InitViewModel.cs deleted file mode 100644 index 88ec6c365..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixThemes/InitViewModel.cs +++ /dev/null @@ -1,351 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixConfigurations; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.IO; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixThemes -{ - public class InitViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isCreateDefault")] - public bool IsCreateDefault { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("templateAsset")] - public FileViewModel TemplateAsset { get; set; } - - [JsonProperty("asset")] - public FileViewModel Asset { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/assets"; - } - } - - public string UploadsFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/uploads"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{Name}"; - } - } - - public List Templates { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public InitViewModel() - : base() - { - } - - public InitViewModel(MixTheme model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixTheme ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Id = 1; - Name = SeoHelper.GetSEOString(Title); - CreatedDateTime = DateTime.UtcNow; - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Templates = MixTemplates.InitViewModel.Repository.GetModelListBy(t => t.ThemeId == Id, - _context: _context, _transaction: _transaction).Data; - TemplateAsset = new FileViewModel() { FileFolder = $"{MixFolders.ImportFolder}/{DateTime.UtcNow.ToShortDateString()}/{Name}" }; - Asset = new FileViewModel() { FileFolder = $"{MixFolders.WebRootPath}/{AssetFolder}" }; - } - - #region Async - - public override async Task> SaveSubModelsAsync(MixTheme parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() { IsSucceed = true }; - - if (string.IsNullOrEmpty(TemplateAsset.Filename)) - { - TemplateAsset = new FileViewModel() - { - Filename = "default_blank", - Extension = MixFileExtensions.Zip, - FileFolder = MixFolders.ImportFolder - }; - } - - result = await ImportThemeAsync(parent, _context, _transaction); - - // Actived Theme - if (IsActived) - { - result = await ActivedThemeAsync(_context, _transaction); - } - - return result; - } - - private async Task> ImportThemeAsync(MixTheme parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - string filePath = $"{MixFolders.WebRootPath}/{TemplateAsset.FileFolder}/{TemplateAsset.Filename}{TemplateAsset.Extension}"; - if (File.Exists(filePath)) - { - string outputFolder = $"{MixFolders.WebRootPath}/{TemplateAsset.FileFolder}/Extract"; - MixFileRepository.Instance.DeleteFolder(outputFolder); - MixFileRepository.Instance.CreateDirectoryIfNotExist(outputFolder); - MixFileRepository.Instance.UnZipFile(filePath, outputFolder); - //Move Unzip Asset folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Assets", $"{MixFolders.WebRootPath}/{AssetFolder}"); - //Move Unzip Templates folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Templates", TemplateFolder); - //Move Unzip Uploads folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Uploads", $"{MixFolders.WebRootPath}/{UploadsFolder}"); - // Get SiteStructure - var strSchema = MixFileRepository.Instance.GetFile("schema.json", $"{outputFolder}/Data"); - string parseContent = strSchema.Content.Replace("[ACCESS_FOLDER]", AssetFolder) - .Replace("[CULTURE]", Specificulture) - .Replace("[THEME_NAME]", parent.Name); - var siteStructures = JObject.Parse(parseContent).ToObject(); - siteStructures.CreatedBy = CreatedBy; - MixFileRepository.Instance.DeleteFolder(outputFolder); - //MixFileRepository.Instance.DeleteFile(filePath); - //Import Site Structures - result = await siteStructures.ImportAsync(Specificulture, _context, _transaction); - if (result.IsSucceed) - { - // Save template files to db - var files = MixFileRepository.Instance.GetFilesWithContent(TemplateFolder); - //TODO: Create default asset - foreach (var file in files) - { - MixTemplates.UpdateViewModel template = new MixTemplates.UpdateViewModel( - new MixTemplate() - { - CreatedBy = CreatedBy, - FileFolder = file.FileFolder, - FileName = file.Filename, - Content = file.Content, - Extension = file.Extension, - CreatedDateTime = DateTime.UtcNow, - LastModified = DateTime.UtcNow, - ThemeId = parent.Id, - ThemeName = parent.Name, - FolderType = file.FolderName, - ModifiedBy = CreatedBy - }, _context, _transaction); - var saveResult = await template.SaveModelAsync(true, _context, _transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors.AddRange(saveResult.Errors); - break; - } - } - } - } - return result; - } - - private async Task> ActivedThemeAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - SystemConfigurationViewModel config = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeName && c.Specificulture == Specificulture - , _context, _transaction)).Data; - if (config == null) - { - config = new SystemConfigurationViewModel() - { - Keyword = MixAppSettingKeywords.ThemeName, - Specificulture = Specificulture, - Category = "Site", - DataType = MixDataType.Text, - Description = "Cms Theme", - Value = Name - }; - } - else - { - config.Value = Name; - } - var saveConfigResult = await config.SaveModelAsync(false, _context, _transaction); - if (saveConfigResult.IsSucceed) - { - SystemConfigurationViewModel configFolder = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeFolder && c.Specificulture == Specificulture - , _context, _transaction)).Data; - configFolder.Value = Name; - - saveConfigResult = await configFolder.SaveModelAsync(false, _context, _transaction); - } - - ViewModelHelper.HandleResult(saveConfigResult, ref result); - - if (result.IsSucceed) - { - SystemConfigurationViewModel configId = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeId && c.Specificulture == Specificulture, _context, _transaction)).Data; - if (configId == null) - { - configId = new SystemConfigurationViewModel() - { - Keyword = MixAppSettingKeywords.ThemeId, - Specificulture = Specificulture, - Category = "Site", - DataType = MixDataType.Text, - Description = "Cms Theme Id", - Value = Model.Id.ToString() - }; - } - else - { - configId.Value = Model.Id.ToString(); - } - var saveResult = await configId.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - return result; - } - - private async Task> CreateDefaultThemeTemplatesAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - string defaultFolder = $"{MixService.GetConfig(MixAppSettingKeywords.DefaultBlankTemplateFolder) }"; - - bool copyResult = MixFileRepository.Instance.CopyDirectory(defaultFolder, TemplateFolder); - - var files = MixFileRepository.Instance.GetFilesWithContent(TemplateFolder); - var id = _context.MixTemplate.Count() + 1; - //TODO: Create default asset - foreach (var file in files) - { - MixTemplates.InitViewModel template = new MixTemplates.InitViewModel( - new MixTemplate() - { - Id = id, - FileFolder = file.FileFolder, - FileName = file.Filename, - Content = file.Content, - Extension = file.Extension, - CreatedDateTime = DateTime.UtcNow, - LastModified = DateTime.UtcNow, - ThemeId = Model.Id, - ThemeName = Model.Name, - FolderType = file.FolderName, - ModifiedBy = CreatedBy - }, _context, _transaction); - var saveResult = await template.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - else - { - id += 1; - } - } - return result; - } - - #endregion Async - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixThemes/ReadViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixThemes/ReadViewModel.cs deleted file mode 100644 index edaf5839d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixThemes/ReadViewModel.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Lib.ViewModels.MixThemes -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("asset")] - public IFormFile Asset { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/assets"; - } - } - - public string UploadsFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/uploads"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{Name}"; - } - } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() - : base() - { - } - - public ReadViewModel(MixTheme model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixThemes/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixThemes/UpdateViewModel.cs deleted file mode 100644 index 9e036f749..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixThemes/UpdateViewModel.cs +++ /dev/null @@ -1,454 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Lib.ViewModels.MixConfigurations; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels.MixThemes -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [Required] - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("image")] - public string Image { get; set; } - - [JsonProperty("thumbnail")] - public string Thumbnail { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("isCloneFromCurrentTheme")] - public bool IsCloneFromCurrentTheme { get; set; } - - [JsonProperty("domain")] - public string Domain { get { return MixService.GetConfig(MixAppSettingKeywords.Domain); } } - - [JsonProperty("imageUrl")] - public string ImageUrl { - get { - if (!string.IsNullOrEmpty(Image) && (Image.IndexOf("http") == -1) && Image[0] != '/') - { - return $"{Domain}/{Image}"; - } - else - { - return Image; - } - } - } - - [JsonProperty("thumbnailUrl")] - public string ThumbnailUrl { - get { - if (Thumbnail != null && Thumbnail.IndexOf("http") == -1 && Thumbnail[0] != '/') - { - return $"{Domain}/{Thumbnail}"; - } - else - { - return string.IsNullOrEmpty(Thumbnail) ? ImageUrl : Thumbnail; - } - } - } - - [JsonProperty("isActived")] - public bool IsActived { get; set; } - - [JsonProperty("templateAsset")] - public FileViewModel TemplateAsset { get; set; } - - [JsonProperty("asset")] - public FileViewModel Asset { get; set; } - - [JsonProperty("assetFolder")] - public string AssetFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/assets"; - } - } - - public string UploadsFolder { - get { - return $"{MixFolders.SiteContentAssetsFolder}/{Name}/uploads"; - } - } - - [JsonProperty("templateFolder")] - public string TemplateFolder { - get { - return $"{MixFolders.TemplatesFolder}/{Name}"; - } - } - - public List Templates { get; set; } - - #endregion Views - - #endregion Properties - - #region Contructors - - public UpdateViewModel() - : base() - { - } - - public UpdateViewModel(MixTheme model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixTheme ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = Repository.Max(m => m.Id, _context, _transaction).Data + 1; - Name = SeoHelper.GetSEOString(Title); - CreatedDateTime = DateTime.UtcNow; - //Import From existing Theme (zip) - if (string.IsNullOrEmpty(TemplateAsset.Filename)) - { - TemplateAsset = new FileViewModel() - { - Filename = "default_blank", - Extension = MixFileExtensions.Zip, - FileFolder = MixFolders.ImportFolder - }; - } - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Templates = MixTemplates.UpdateViewModel.Repository.GetModelListBy(t => t.ThemeId == Id, - _context: _context, _transaction: _transaction).Data; - TemplateAsset = new FileViewModel() { FileFolder = $"{MixFolders.ImportFolder}/{DateTime.UtcNow.ToShortDateString()}/{Name}" }; - Asset = new FileViewModel() { FileFolder = AssetFolder }; - } - - #region Async - - public override async Task> SaveSubModelsAsync(MixTheme parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - RepositoryResponse result = new RepositoryResponse() { IsSucceed = true }; - - if (IsCloneFromCurrentTheme) - { - if (result.IsSucceed) - { - RepositoryResponse saveTemplate = await SaveTemplatesAsync(parent, TemplateFolder, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - } - // Import Assets - if (result.IsSucceed && !string.IsNullOrEmpty(Asset.Filename)) - { - result = ImportAssetsAsync(_context, _transaction); - } - - if (result.IsSucceed && !string.IsNullOrEmpty(TemplateAsset.Filename)) - { - result = await ImportThemeAsync(parent, _context, _transaction); - } - - //// New themes without import existing theme => create from default folder - //if (result.IsSucceed && !Directory.Exists(TemplateFolder) && string.IsNullOrEmpty(TemplateAsset.Filename)) - //{ - // result = await CreateDefaultThemeTemplatesAsync(_context, _transaction); - //} - - // Actived Theme - if (IsActived) - { - result = await ActivedThemeAsync(_context, _transaction); - } - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expand - - private async Task> ImportThemeAsync(MixTheme parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - string filePath = $"{MixFolders.WebRootPath}/{TemplateAsset.FileFolder}/{TemplateAsset.Filename}{TemplateAsset.Extension}"; - if (File.Exists(filePath)) - { - string outputFolder = $"{MixFolders.WebRootPath}/{TemplateAsset.FileFolder}/Extract"; - MixFileRepository.Instance.DeleteFolder(outputFolder); - MixFileRepository.Instance.CreateDirectoryIfNotExist(outputFolder); - MixFileRepository.Instance.UnZipFile(filePath, outputFolder); - //Move Unzip Asset folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Assets", $"{MixFolders.WebRootPath}/{AssetFolder}"); - //Move Unzip Templates folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Templates", TemplateFolder); - //Move Unzip Uploads folder - MixFileRepository.Instance.CopyDirectory($"{outputFolder}/Uploads", $"{MixFolders.WebRootPath}/{UploadsFolder}"); - // Get SiteStructure - var strSchema = MixFileRepository.Instance.GetFile("schema.json", $"{outputFolder}/Data"); - string parseContent = strSchema.Content.Replace("[ACCESS_FOLDER]", AssetFolder) - .Replace("[CULTURE]", Specificulture) - .Replace("[THEME_NAME]", parent.Name); - var siteStructures = JObject.Parse(parseContent).ToObject(); - MixFileRepository.Instance.DeleteFolder(outputFolder); - //MixFileRepository.Instance.DeleteFile(filePath); - //Import Site Structures - result = await siteStructures.ImportAsync(Specificulture, _context, _transaction); - if (result.IsSucceed) - { - RepositoryResponse saveTemplate = await SaveTemplatesAsync(parent, TemplateFolder, _context, _transaction); - ViewModelHelper.HandleResult(saveTemplate, ref result); - } - } - return result; - } - - private async Task> SaveTemplatesAsync(MixTheme parent, string themeName, MixCmsContext context, IDbContextTransaction transaction) - { - RepositoryResponse result = new RepositoryResponse() { IsSucceed = true }; - // Save template files to db - var files = MixFileRepository.Instance.GetFilesWithContent(TemplateFolder); - //TODO: Create default asset - foreach (var file in files) - { - string content = file.Content.Replace($"{MixFolders.SiteContentAssetsFolder}/{themeName}/", - $"{MixFolders.SiteContentAssetsFolder}/{Name}/"); - MixTemplates.UpdateViewModel template = new MixTemplates.UpdateViewModel( - new MixTemplate() - { - FileFolder = file.FileFolder, - FileName = file.Filename, - Content = file.Content, - Extension = file.Extension, - CreatedDateTime = DateTime.UtcNow, - LastModified = DateTime.UtcNow, - ThemeId = parent.Id, - ThemeName = parent.Name, - FolderType = file.FolderName, - ModifiedBy = CreatedBy - }, context, transaction); - var saveResult = await template.SaveModelAsync(true, context, transaction); - result.IsSucceed = result.IsSucceed && saveResult.IsSucceed; - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors.AddRange(saveResult.Errors); - break; - } - } - return result; - } - - private async Task> ActivedThemeAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - SystemConfigurationViewModel config = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeName && c.Specificulture == Specificulture - , _context, _transaction)).Data; - if (config == null) - { - config = new SystemConfigurationViewModel() - { - Keyword = MixAppSettingKeywords.ThemeName, - Specificulture = Specificulture, - Category = "Site", - DataType = MixDataType.Text, - Description = "Cms Theme", - Value = Name - }; - } - else - { - config.Value = Name; - } - var saveConfigResult = await config.SaveModelAsync(false, _context, _transaction); - if (saveConfigResult.IsSucceed) - { - SystemConfigurationViewModel configFolder = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeFolder && c.Specificulture == Specificulture - , _context, _transaction)).Data; - configFolder.Value = Name; - - saveConfigResult = await configFolder.SaveModelAsync(false, _context, _transaction); - } - - ViewModelHelper.HandleResult(saveConfigResult, ref result); - - if (result.IsSucceed) - { - SystemConfigurationViewModel configId = (await SystemConfigurationViewModel.Repository.GetSingleModelAsync( - c => c.Keyword == MixAppSettingKeywords.ThemeId && c.Specificulture == Specificulture, _context, _transaction)).Data; - if (configId == null) - { - configId = new SystemConfigurationViewModel() - { - Keyword = MixAppSettingKeywords.ThemeId, - Specificulture = Specificulture, - Category = "Site", - DataType = MixDataType.Text, - Description = "Cms Theme Id", - Value = Model.Id.ToString() - }; - } - else - { - configId.Value = Model.Id.ToString(); - } - var saveResult = await configId.SaveModelAsync(false, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - return result; - } - - private async Task> CreateDefaultThemeTemplatesAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - string defaultFolder = $"{MixService.GetConfig(MixAppSettingKeywords.DefaultBlankTemplateFolder) }"; - - //CommonHelper.GetFullPath(new string[] { - // MixFolders.TemplatesFolder, - // MixService.GetConfig(MixAppSettingKeywords.DefaultTemplateFolder) }); - bool copyResult = MixFileRepository.Instance.CopyDirectory(defaultFolder, TemplateFolder); - - var files = MixFileRepository.Instance.GetFilesWithContent(TemplateFolder); - var id = _context.MixTemplate.Count() + 1; - //TODO: Create default asset - foreach (var file in files) - { - MixTemplates.InitViewModel template = new MixTemplates.InitViewModel( - new MixTemplate() - { - Id = id, - FileFolder = file.FileFolder, - FileName = file.Filename, - Content = file.Content, - Extension = file.Extension, - CreatedDateTime = DateTime.UtcNow, - LastModified = DateTime.UtcNow, - ThemeId = Model.Id, - ThemeName = Model.Name, - FolderType = file.FolderName, - ModifiedBy = CreatedBy - }, _context, _transaction); - var saveResult = await template.SaveModelAsync(true, _context, _transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - if (!result.IsSucceed) - { - break; - } - else - { - id += 1; - } - } - return result; - } - - private RepositoryResponse ImportAssetsAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse(); - string fullPath = $"{MixFolders.WebRootPath}/{Asset.FileFolder}/{Asset.Filename}{Asset.Extension}"; - if (File.Exists(fullPath)) - { - MixFileRepository.Instance.UnZipFile(fullPath, $"{MixFolders.WebRootPath}/{Asset.FileFolder}"); - //InitAssetStyle(); - result.IsSucceed = true; - } - else - { - result.Errors.Add("Cannot saved asset file"); - } - - return result; - } - - private async Task InitAssetStyleAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var files = MixFileRepository.Instance.GetWebFiles($"{MixFolders.WebRootPath}/{AssetFolder}"); - StringBuilder strStyles = new StringBuilder(); - - foreach (var css in files.Where(f => f.Extension == ".css")) - { - strStyles.Append($" "); - } - StringBuilder strScripts = new StringBuilder(); - foreach (var js in files.Where(f => f.Extension == ".js")) - { - strScripts.Append($" "); - } - var layout = MixTemplates.InitViewModel.Repository.GetSingleModel( - t => t.FileName == "_Layout" && t.ThemeId == Model.Id - , _context, _transaction); - layout.Data.Content = layout.Data.Content.Replace("" - , string.Format(@"{0}" - , strStyles)); - layout.Data.Content = layout.Data.Content.Replace("" - , string.Format(@"{0}" - , strScripts)); - - await layout.Data.SaveModelAsync(true, _context, _transaction); - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/MixUrlAliases/UpdateViewModel.cs b/src/Mix.Cms.Lib/ViewModels/MixUrlAliases/UpdateViewModel.cs deleted file mode 100644 index 9b6c49a6d..000000000 --- a/src/Mix.Cms.Lib/ViewModels/MixUrlAliases/UpdateViewModel.cs +++ /dev/null @@ -1,143 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.ViewModels.MixCultures; -using Mix.Domain.Core.Models; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; - -namespace Mix.Cms.Lib.ViewModels.MixUrlAliases -{ - public class UpdateViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public int Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("cultures")] - public List Cultures { get; set; } - - [JsonProperty("sourceId")] - public string SourceId { get; set; } - - [JsonProperty("type")] - public MixUrlAliasType Type { get; set; } - - [JsonProperty("description")] - public string Description { get; set; } - - [Required] - [JsonProperty("alias")] - public string Alias { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("modifiedBy")] - public string ModifiedBy { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("status")] - public MixContentStatus Status { get; set; } - - #endregion Models - - #endregion Properties - - #region Contructors - - public UpdateViewModel() : base() - { - } - - public UpdateViewModel(MixUrlAlias model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override MixUrlAlias ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (Id == 0) - { - Id = UpdateViewModel.Repository.Max(c => c.Id, _context, _transaction).Data + 1; - CreatedDateTime = DateTime.UtcNow; - Cultures = Cultures ?? LoadCultures(Specificulture, _context, _transaction); - Cultures.ForEach(c => c.IsSupported = true); - } - return base.ParseModel(_context, _transaction); - } - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - Cultures = LoadCultures(Specificulture, _context, _transaction); - } - - public override void Validate(MixCmsContext _context, IDbContextTransaction _transaction) - { - base.Validate(_context, _transaction); - if (IsValid) - { - if (Repository.CheckIsExists(o => - o.Alias == Alias && o.Specificulture == Specificulture && o.Id != Id)) - { - Errors.Add("Alias Existed"); - IsValid = false; - } - } - } - - #endregion Overrides - - #region Expand - - private List LoadCultures(string initCulture = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getCultures = SystemCultureViewModel.Repository.GetModelList(_context, _transaction); - var result = new List(); - if (getCultures.IsSucceed) - { - foreach (var culture in getCultures.Data) - { - result.Add( - new SupportedCulture() - { - Icon = culture.Icon, - Specificulture = culture.Specificulture, - Alias = culture.Alias, - FullName = culture.FullName, - Description = culture.FullName, - Id = culture.Id, - Lcid = culture.Lcid, - IsSupported = culture.Specificulture == initCulture || _context.MixUrlAlias.Any(p => p.Id == Id && p.Specificulture == culture.Specificulture) - }); - } - } - return result; - } - - #endregion Expand - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/ViewModels/SiteStructureViewModel.cs b/src/Mix.Cms.Lib/ViewModels/SiteStructureViewModel.cs deleted file mode 100644 index 8103b2d0b..000000000 --- a/src/Mix.Cms.Lib/ViewModels/SiteStructureViewModel.cs +++ /dev/null @@ -1,910 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Lib.ViewModels -{ - public class SiteStructureViewModel - { - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("pages")] - public List Pages { get; set; } - - [JsonProperty("modules")] - public List Modules { get; set; } - - [JsonProperty("mixDatabases")] - public List MixDatabases { get; set; } - - [JsonProperty("configurations")] - public List Configurations { get; set; } - - [JsonProperty("languages")] - public List Languages { get; set; } - - [JsonProperty("relatedData")] - public List RelatedData { get; set; } = new List(); - - [JsonProperty("pagePostNavs")] - public List PagePostNavs { get; set; } = new List(); - - [JsonProperty("pageModuleNavs")] - public List PageModuleNavs { get; set; } = new List(); - - [JsonProperty("modulePostNavs")] - public List ModulePostNavs { get; set; } = new List(); - - [JsonProperty("posts")] - public List Posts { get; set; } = new List(); - - [JsonProperty("moduleDatas")] - public List ModuleDatas { get; set; } = new List(); - - [JsonProperty("mixDatabaseDatas")] - public List MixDatabaseDatas { get; set; } = new List(); - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("themeName")] - public string ThemeName { get; set; } - - public SiteStructureViewModel() - { - } - - public async Task InitAsync(string culture) - { - Pages = (await MixPages.ImportViewModel.Repository.GetModelListByAsync(p => p.Specificulture == culture)).Data; - Modules = (await MixModules.ImportViewModel.Repository.GetModelListByAsync(p => p.Specificulture == culture)).Data; - MixDatabases = (await ViewModels.MixDatabases.ImportViewModel.Repository.GetModelListAsync()).Data; - } - - #region Export - - public RepositoryResponse ExportSelectedItemsAsync() - { - UnitOfWorkHelper.InitTransaction(null, null, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - var result = new RepositoryResponse() { IsSucceed = true }; - try - { - Configurations = MixConfigurations.ImportViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture, context, transaction).Data; - Languages = MixLanguages.ImportViewModel.Repository.GetModelListBy( - m => m.Specificulture == Specificulture, context, transaction).Data; - - ExportPages(context, transaction); - ExportModules(context, transaction); - ExportMixDatabasesAsync(context, transaction); - ExportDatas(context, transaction); - return result; - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = ex; - return result; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private void ExportDatas(MixCmsContext context, IDbContextTransaction transaction) - { - ExportMixDatabaseData(context, transaction); - ExportRelatedDatas(context, transaction); - } - - private void ExportMixDatabasesAsync(MixCmsContext context, IDbContextTransaction transaction) - { - foreach (var item in MixDatabases) - { - item.Fields = MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(a => a.MixDatabaseId == item.Id, context, transaction).Data?.OrderBy(a => a.Priority).ToList(); - // Filter list reference field => Add to Export Data if not exist - var refFields = item.Fields.Where(f => f.DataType == MixDataType.Reference); - - foreach (var field in refFields) - { - var refSet = MixDatabases.FirstOrDefault(m => m.Name == field.MixDatabaseName); - if (refSet == null) - { - var getSet = ViewModels.MixDatabases.ImportViewModel.Repository.GetSingleModel(m => m.Name == field.MixDatabaseName, context, transaction); - if (getSet.IsSucceed) - { - refSet = getSet.Data; - refSet.IsExportData = refSet.IsExportData || item.IsExportData; - MixDatabases.Add(refSet); - } - } - else - { - refSet.IsExportData = refSet.IsExportData || item.IsExportData; - } - } - // Load export data if checked and did not process - if (item.IsExportData && item.Data != null) - { - } - } - } - - #region Export Page - - private void ExportPages(MixCmsContext context, IDbContextTransaction transaction) - { - foreach (var item in Pages) - { - if (item.IsExportData) - { - ExportPageModuleNav(item, context, transaction); - ExportPagePostNav(item, context, transaction); - ExportAdditionalData(item.Id.ToString(), MixDatabaseParentType.Page, context, transaction); - item.UrlAliases = item.GetAliases(context, transaction); - } - } - } - - private void ExportPageModuleNav(MixPages.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) - { - PageModuleNavs.AddRange(item.GetModuleNavs(context, transaction) - .Where(m => !PageModuleNavs.Any(n => n.ModuleId == m.ModuleId && n.PageId == m.PageId))); - foreach (var nav in PageModuleNavs) - { - if (!Modules.Any(m => m.Id == nav.ModuleId && m.Specificulture == Specificulture)) - { - Modules.Add(nav.Module); - } - } - } - - private void ExportPagePostNav(MixPages.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) - { - PagePostNavs.AddRange(item.GetPostNavs(context, transaction) - .Where(m => !PagePostNavs.Any(n => n.PostId == m.PostId && n.PageId == m.PageId))); - foreach (var nav in PagePostNavs) - { - if (!Posts.Any(m => m.Id == nav.Post.Id && m.Specificulture == Specificulture)) - { - Posts.Add(nav.Post); - } - } - } - - #endregion Export Page - - #region Export Modules - - private void ExportModules(MixCmsContext context, IDbContextTransaction transaction) - { - foreach (var item in Modules) - { - if (item.IsExportData) - { - ExportModuleDatas(item, context, transaction); - ExportModulePostNavs(item, context, transaction); - } - ExportAdditionalData(item.Id.ToString(), MixDatabaseParentType.Module, context, transaction); - } - } - - private void ExportModuleDatas(MixModules.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) - { - var getDataResult = MixModuleDatas.ImportViewModel.Repository - .GetModelListBy(m => m.ModuleId == item.Id - && m.Specificulture == item.Specificulture - , context, transaction); - - if (getDataResult.IsSucceed) - { - ModuleDatas.AddRange(getDataResult.Data); - } - } - - private void ExportModulePostNavs(MixModules.ImportViewModel item, MixCmsContext context, IDbContextTransaction transaction) - { - ModulePostNavs.AddRange(item.GetPostNavs(context, transaction) - .Where(m => !ModulePostNavs.Any(n => n.PostId == m.PostId && n.ModuleId == m.ModuleId))); - foreach (var nav in ModulePostNavs) - { - if (!Posts.Any(m => m.Id == nav.Post.Id && m.Specificulture == Specificulture)) - { - Posts.Add(nav.Post); - } - } - } - - #endregion Export Modules - - private void ExportAdditionalData(string id, MixDatabaseParentType type, MixCmsContext context, IDbContextTransaction transaction) - { - if (!RelatedData.Any(m => m.ParentId == id && m.ParentType == type)) - { - var getRelatedData = MixDatabaseDataAssociations.ImportViewModel.Repository.GetSingleModel( - m => m.Specificulture == Specificulture && m.ParentType == type - && m.ParentId == id, context, transaction); - if (getRelatedData.IsSucceed) - { - RelatedData.Add(getRelatedData.Data); - } - } - } - - private void ExportMixDatabaseData(MixCmsContext context, IDbContextTransaction transaction) - { - MixDatabaseDatas = new List(); - // Load MixDatabase data - foreach (var item in MixDatabases) - { - if (item.IsExportData) - { - var getData = ViewModels.MixDatabaseDatas.ImportViewModel.Repository.GetModelListBy( - a => a.Specificulture == Specificulture && a.MixDatabaseId == item.Id, context, transaction) - .Data?.OrderBy(a => a.Priority).ToList(); - if (getData != null) - { - MixDatabaseDatas.AddRange(getData); - } - } - } - // Load Related Data - RelatedData.AddRange(Posts.Where(p => p.RelatedData != null).Select(p => p.RelatedData)); - RelatedData.AddRange(Pages.Where(p => p.RelatedData != null).Select(p => p.RelatedData)); - RelatedData.AddRange(Modules.Where(p => p.RelatedData != null).Select(p => p.RelatedData)); - foreach (var item in RelatedData) - { - if (!MixDatabaseDatas.Any(m => m.Id == item.Id)) - { - var getData = ViewModels.MixDatabaseDatas.ImportViewModel.Repository.GetSingleModel( - m => m.Id == item.Id, context, transaction); - if (getData.IsSucceed) - { - MixDatabaseDatas.Add(getData.Data); - } - } - } - } - - private void ExportRelatedDatas(MixCmsContext context, IDbContextTransaction transaction) - { - foreach (var item in MixDatabaseDatas) - { - var getDataResult = MixDatabaseDataAssociations.ImportViewModel.Repository - .GetModelListBy(m => m.ParentId == item.Id && m.Specificulture == item.Specificulture - , context, transaction); - - if (getDataResult.IsSucceed && getDataResult.Data.Count > 0) - { - var data = getDataResult.Data.Where(m => - MixDatabaseDatas.Any(d => d.Id == m.DataId) - && !RelatedData.Any(r => r.ParentId == item.Id && r.DataId == m.DataId)) - .ToList(); - RelatedData.AddRange(data); - } - } - } - - #endregion Export - - #region Import - - private Dictionary dicConfigurationIds = new Dictionary(); - private Dictionary dicLanguageIds = new Dictionary(); - private Dictionary dicModuleIds = new Dictionary(); - private Dictionary dicPostIds = new Dictionary(); - private Dictionary dicPageIds = new Dictionary(); - private Dictionary dicFieldIds = new Dictionary(); - private Dictionary dicMixDatabaseIds = new Dictionary(); - - public async Task> ImportAsync(string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - if (Configurations != null && Configurations.Count > 0) - { - result = await ImportConfigurationsAsync(destCulture, context, transaction); - } - if (result.IsSucceed && Languages != null && Languages.Count > 0) - { - result = await ImportLanguagesAsync(destCulture, context, transaction); - } - if (result.IsSucceed && Pages != null && Pages.Count > 0) - { - result = await ImportPagesAsync(destCulture, context, transaction); - } - if (result.IsSucceed && Modules != null && Modules.Count > 0) - { - result = await ImportModulesAsync(destCulture, context, transaction); - } - - if (result.IsSucceed && ModuleDatas.Count > 0) - { - result = await ImportModuleDatas(destCulture, context, transaction); - } - if (result.IsSucceed && Posts != null && Posts.Count > 0) - { - result = await ImportPostsAsync(destCulture, context, transaction); - } - if (result.IsSucceed && MixDatabases != null && MixDatabases.Count > 0) - { - result = await ImportMixDatabasesAsync(context, transaction); - } - if (result.IsSucceed && MixDatabaseDatas.Count > 0) - { - result = await ImportMixDatabaseDatas(destCulture, context, transaction); - } - if (result.IsSucceed && RelatedData.Count > 0) - { - result = await ImportRelatedDatas(destCulture, context, transaction); - } - - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - private async Task> ImportModulesAsync(string destCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - var startId = context.MixModule.Any() ? context.MixModule.Max(m => m.Id) : 0; - foreach (var module in Modules) - { - var oldId = module.Id; - module.CreatedBy = CreatedBy; - - if (result.IsSucceed) - { - if (!context.MixModule.Any(m => m.Name == module.Name && m.Specificulture == destCulture)) - { - startId++; - module.Id = startId; - module.Specificulture = destCulture; - module.CreatedDateTime = DateTime.UtcNow; - var saveResult = await module.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - if (!dicModuleIds.Any(m => m.Key == oldId)) - { - // update new id to related attribute data - dicModuleIds.Add(oldId, module.Id); - } - } - else - { - break; - } - } - - return result; - } - - private async Task> ImportPostsAsync(string destCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - var startId = context.MixPost.Any() ? context.MixPost.Max(m => m.Id) : 0; - foreach (var post in Posts) - { - var oldId = post.Id; - post.CreatedBy = CreatedBy; - - if (result.IsSucceed) - { - if (!context.MixPost.Any(m => m.SeoName == post.SeoName && m.Specificulture == destCulture)) - { - startId++; - post.Id = startId; - post.Specificulture = destCulture; - post.CreatedDateTime = DateTime.UtcNow; - var saveResult = await post.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - // update new id to related attribute data - if (!dicPostIds.Any(m => m.Key == oldId)) - { - dicPostIds.Add(oldId, post.Id); - } - } - else - { - break; - } - } - - return result; - } - - private async Task> ImportMixDatabasesAsync(MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (MixDatabases != null) - { - var startId = ViewModels.MixDatabases.ImportViewModel.Repository.Max(m => m.Id, context, transaction).Data; - var startFieldId = MixDatabaseColumns.UpdateViewModel.Repository.Max(m => m.Id, context, transaction).Data; - var mixDatabaseColumns = new List(); - foreach (var set in MixDatabases) - { - set.CreatedBy = CreatedBy; - if (result.IsSucceed) - { - if (!context.MixDatabase.Any(m => m.Name == set.Name)) - { - startId++; - set.Id = startId; - set.CreatedDateTime = DateTime.UtcNow; - mixDatabaseColumns.AddRange(set.Fields - .Where(m => !mixDatabaseColumns.Any(n => n.Id == m.Id)) - .ToList()); - var saveResult = await set.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - if (!dicMixDatabaseIds.Any(m => m.Key == set.Id)) - { - dicMixDatabaseIds.Add(set.Id, startId); - } - } - else - { - break; - } - } - // save fields - if (result.IsSucceed) - { - foreach (var field in mixDatabaseColumns) - { - if (result.IsSucceed) - { - field.CreatedBy = CreatedBy; - var setId = dicMixDatabaseIds.FirstOrDefault(m => m.Key == field.MixDatabaseId); - field.MixDatabaseId = setId.Value; - if (field.ReferenceId != null) - { - var refId = dicMixDatabaseIds.FirstOrDefault(m => m.Key == field.ReferenceId); - field.ReferenceId = refId.Value; - } - if (dicFieldIds.ContainsKey(field.Id)) - { - field.Id = dicFieldIds[field.Id]; - field.CreatedDateTime = DateTime.UtcNow; - } - else - { - startFieldId++; - dicFieldIds.Add(field.Id, startFieldId); - field.Id = startFieldId; - field.CreatedDateTime = DateTime.UtcNow; - } - var saveResult = await field.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - result.Errors.Add($"Cannot Import {field.Name} - {field.Id}"); - break; - } - } - } - } - return result; - } - - private async Task> ImportConfigurationsAsync(string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - int startId = MixConfigurations.UpdateViewModel.ModelRepository.Max(m => m.Id, context, transaction).Data; - foreach (var item in Configurations) - { - var oldId = item.Id; - item.CreatedBy = CreatedBy; - if (!context.MixConfiguration.Any(p => p.Keyword == item.Keyword)) - { - startId++; - item.Id = startId; - - item.CreatedDateTime = DateTime.UtcNow; - - item.Specificulture = destCulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - if (!dicConfigurationIds.Any(m => m.Key == item.Id)) - { - dicConfigurationIds.Add(oldId, startId); - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - private async Task> ImportLanguagesAsync(string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - int startId = MixLanguages.UpdateViewModel.ModelRepository.Max(m => m.Id, context, transaction).Data; - foreach (var item in Languages) - { - var oldId = item.Id; - item.CreatedBy = CreatedBy; - if (!context.MixLanguage.Any(p => p.Keyword == item.Keyword)) - { - startId++; - item.Id = startId; - - item.CreatedDateTime = DateTime.UtcNow; - - item.Specificulture = destCulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - if (!dicLanguageIds.Any(m => m.Key == item.Id)) - { - dicLanguageIds.Add(oldId, startId); - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - private async Task> ImportPagesAsync(string destCulture, - MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixCmsContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - int startId = MixPages.UpdateViewModel.ModelRepository.Max(m => m.Id, context, transaction).Data; - int startModuleId = MixModules.UpdateViewModel.ModelRepository.Max(m => m.Id, context, transaction).Data; - //var pages = MixFileRepository.Instance.GetFile(MixConstants.CONST_FILE_PAGES, MixFolders.JsonDataFolder, true, "{}"); - //var obj = JObject.Parse(pages.Content); - //var initPages = obj["data"].ToObject(); - foreach (var item in Pages) - { - // store old id => update to related data if save success - var oldId = item.Id; - item.CreatedBy = CreatedBy; - // TODO: Id > 7 => not system init page - if (!context.MixPage.Any(p => p.SeoName == item.SeoName)) - { - startId++; - item.Id = startId; - - item.CreatedDateTime = DateTime.UtcNow; - item.ThemeName = ThemeName; - - item.Specificulture = destCulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - if (!saveResult.IsSucceed) - { - result.IsSucceed = false; - result.Exception = saveResult.Exception; - result.Errors = saveResult.Errors; - break; - } - } - if (!dicPageIds.Any(m => m.Key == item.Id)) - { - dicPageIds.Add(oldId, startId); - } - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - } - catch (Exception ex) // TODO: Add more specific exeption types instead of Exception only - { - var error = UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - result.IsSucceed = false; - result.Errors = error.Errors; - result.Exception = error.Exception; - } - finally - { - //if current Context is Root - if (isRoot) - { - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - return result; - } - - private async Task> ImportMixDatabaseDatas(string destCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in MixDatabaseDatas) - { - item.CreatedBy = CreatedBy; - if (result.IsSucceed) - { - item.CreatedBy = CreatedBy; - if (!context.MixDatabaseData.Any(m => m.Id == item.Id && m.Specificulture == item.Specificulture)) - { - item.Specificulture = destCulture; - item.CreatedDateTime = DateTime.UtcNow; - // update new Id if not system attribute - if (item.MixDatabaseName.IndexOf("sys_") != 0 && dicMixDatabaseIds.ContainsKey(item.MixDatabaseId)) - { - item.MixDatabaseId = dicMixDatabaseIds[item.MixDatabaseId]; - } - item.Fields = item.Fields ?? MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy( - m => m.MixDatabaseId == item.MixDatabaseId, context, transaction).Data; - foreach (var field in item.Fields) - { - field.Specificulture = destCulture; - var newSet = MixDatabases.FirstOrDefault(m => m.Name == field.MixDatabaseName); - var newField = newSet?.Fields.FirstOrDefault(m => m.Name == field.Name); - if (newField != null) - { - field.Id = newField.Id; - field.MixDatabaseId = newSet.Id; - field.MixDatabaseName = newSet.Name; - field.CreatedDateTime = DateTime.UtcNow; - } - } - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - } - else - { - break; - } - } - return result; - } - - private async Task> ImportRelatedDatas(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = await ImportRelatedMixDatabaseDatas(desCulture, context, transaction); - if (result.IsSucceed) - { - result = await ImportPagePostNavs(desCulture, context, transaction); - } - - if (result.IsSucceed) - { - result = await ImportPageModuleNavs(desCulture, context, transaction); - } - if (result.IsSucceed) - { - result = await ImportModulePostNavs(desCulture, context, transaction); - } - return result; - } - - private async Task> ImportPagePostNavs(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in PagePostNavs) - { - if (result.IsSucceed) - { - item.CreatedBy = CreatedBy; - item.Specificulture = desCulture; - item.PageId = dicPageIds[item.PageId]; - item.PostId = dicPostIds[item.PostId]; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> ImportPageModuleNavs(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in PageModuleNavs) - { - if (result.IsSucceed) - { - item.CreatedBy = CreatedBy; - item.Specificulture = desCulture; - item.PageId = dicPageIds[item.PageId]; - item.ModuleId = dicModuleIds[item.ModuleId]; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> ImportModulePostNavs(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in ModulePostNavs) - { - if (result.IsSucceed) - { - item.CreatedBy = CreatedBy; - item.Specificulture = desCulture; - item.ModuleId = dicModuleIds[item.ModuleId]; - item.PostId = dicPostIds[item.PostId]; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> ImportModuleDatas(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in ModuleDatas) - { - item.CreatedBy = CreatedBy; - if (result.IsSucceed) - { - item.Specificulture = desCulture; - item.ModuleId = dicModuleIds[item.ModuleId]; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> ImportRelatedMixDatabaseDatas(string desCulture, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in RelatedData) - { - item.CreatedBy = CreatedBy; - item.Id = Guid.NewGuid().ToString(); - item.Specificulture = desCulture; - switch (item.ParentType) - { - case MixDatabaseParentType.Set: - item.MixDatabaseId = dicMixDatabaseIds[item.MixDatabaseId]; - break; - - case MixDatabaseParentType.Post: - break; - - case MixDatabaseParentType.Page: - if (dicPageIds.TryGetValue(int.Parse(item.ParentId), out int pageId)) - { - item.ParentId = pageId.ToString(); - } - else - { - continue; - } - break; - - case MixDatabaseParentType.Module: - if (dicModuleIds.TryGetValue(int.Parse(item.ParentId), out int moduleId)) - { - item.ParentId = moduleId.ToString(); - } - else - { - continue; - } - break; - - default: - break; - } - if (result.IsSucceed) - { - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - return result; - } - - #endregion Import - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Lib/default.appsettings.json b/src/Mix.Cms.Lib/default.appsettings.json deleted file mode 100644 index e9b69f36c..000000000 --- a/src/Mix.Cms.Lib/default.appsettings.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "ConnectionStrings": { - "MixAccountConnection": null, - "MixCmsConnection": null, - "MixMessengerConnection": null - }, - "MixConfigurations": { - "IsCache": true, - "MixCacheFolder": "MixContent/cache", - "JsonDataFolder": "MixContent/data", - "MixLogsFolder": "MixContent/logs" - }, - "Authentication": { - "ClockSkew": 20, - "CookieExpiration": 20, - "RefreshTokenExpiration": 120, - "ValidateIssuer": false, - "ValidateAudience": false, - "ValidateLifetime": true, - "ValidateIssuerSigningKey": true, - "TokenType": "Bearer", - "Audience": "mix-core", - "SecretKey": "mixcore-secret-key", - "Issuer": "mix-core", - "Issuers": "mix-core", - "Audiences": "mix-core", - "AllowedIps": "" - }, - "IpSecuritySettings": { - "IsRetrictIp": true, - "AllowedPortalIps": [], - "AllowedIps": [], - "ExceptIps": [] - }, - "Cloudflare": { - "ApiToken": "", - "ApiKey": { - "GlobalKey": "", - "OriginKey": "" - } - }, - "Translator": {}, - "LocalSettings": { - "en-us": { - "ContactAddress": "", - "ContactEmail": "", - "ContactPhone": "", - "Facebook": "", - "FacebookAppId": "", - "Favicon": "", - "LanguageVersion": "1", - "Logo": "", - "SettingVersion": "1", - "Theme": "Default", - "ThemeId": "1" - } - }, - "GlobalSettings": { - "IsInit": true, - "InitStatus": 0, - "IsMaintenance": false, - "IsRewrite": true, - "IsHttps": false, - "IsCache": true, - "IsRegistration": true, - "MaxPageSize": 100, - "ImageSize": 2000, - "DefaultAvatar": "/mix-app/assets/img/user.png", - "DefaultCulture": "en-us", - "DefaultTemplate": "_Blank", - "DefaultTemplateContent": "
", - "DefaultTheme": "Default_Blank", - "DefaultContentStatus": "Published", - "DefaultBlankTemplateFolder": "Themes/Default_Blank", - "DefaultTemplateFolder": "Themes/Default", - "DefaultTemplateLayout": "_Layout", - "DefaultPostAttr": "[]", - "OrderBy": "Priority", - "OrderDirection": "0", - "Language": "en-us", - "UploadFolder": "Content/Uploads", - "ThemeId": "1", - "Domain": "", - "TemplateExtension": ".cshtml", - "TagPageSize": "20", - "SearchPageSize": "20", - "IsEncryptApi": true, - "LastUpdateConfiguration": null, - "DatabaseProvider": "MSSQL", - "AllowedHosts": [], - "Smtp": { - "Server": "", - "Port": 587, - "SSL": true, - "User": "", - "Password": "", - "From": "support@mixcore.org", - "FromName": "mix-core" - }, - "PortalThemeSettings": { - "primaryColorHue": 90, - "primaryColorSaturation": 35, - "primaryColorBrightness": 50, - "bgColor": "#fbfbfb", - "textColor": "#404040", - "primaryColor": "#47c5d1", - "bgColorHover": "#d1e0de", - "borderColor": "#d1e0de", - "borderColorHover": "#e0e4e7", - "linkColor": "#47c5d1", - "linkColorHover": "#404040", - "linkColorActive": "#404040", - "textColorHover": "#008b8b", - "fontFamily": "", - "fontSizeH1": "16", - "fontSize": "12" - } - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "JWTSettings": { - "SecretKey": "sw-cms-secret-key", - "Issuer": "sw-cms", - "Audience": "sw-client" - }, - "Language": "en-us", - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" //The license context used - } - }, - "Quartz": { - "quartz.scheduler.instanceName": "Mixcore Cms Scheduler" - } -} diff --git a/src/Mix.Cms.Schedule/Jobs/PublishScheduledPostsJob.cs b/src/Mix.Cms.Schedule/Jobs/PublishScheduledPostsJob.cs deleted file mode 100644 index 9ff58f229..000000000 --- a/src/Mix.Cms.Schedule/Jobs/PublishScheduledPostsJob.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Quartz; -using System.Threading.Tasks; - -namespace Mix.Cms.Schedule.Jobs -{ - public class PublishScheduledPostsJob : IJob - { - public async Task Execute(IJobExecutionContext context) - { - await Lib.ViewModels.MixPosts.Helper.PublishScheduledPosts(); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Schedule/Mix.Cms.Schedule.csproj b/src/Mix.Cms.Schedule/Mix.Cms.Schedule.csproj deleted file mode 100644 index 01f65946b..000000000 --- a/src/Mix.Cms.Schedule/Mix.Cms.Schedule.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net5.0 - - - - - - - - - - - - - diff --git a/src/Mix.Cms.Schedule/ServiceCollectionExtensions.cs b/src/Mix.Cms.Schedule/ServiceCollectionExtensions.cs deleted file mode 100644 index 4f273874d..000000000 --- a/src/Mix.Cms.Schedule/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Mix.Cms.Lib.Services; -using Mix.Cms.Schedule.Jobs; -using Quartz; -using Quartz.Impl; -using Quartz.Impl.Calendar; -using Quartz.Logging; -using System; -using System.Threading.Tasks; - -namespace Mix.Cms.Schedule -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddMixScheduler(this IServiceCollection services, IConfiguration configuration) - { - // base configuration from appsettings.json - services.Configure(configuration.GetSection("Quartz")); - - services.AddQuartz(q => - { - // we could leave DI configuration intact and then jobs need - // to have public no-arg constructor - // the MS DI is expected to produce transient job instances - // this WONT'T work with scoped services like EF Core's DbContext - q.UseMicrosoftDependencyInjectionJobFactory(options => - { - // if we don't have the job in DI, allow fallback - // to configure via default constructor - options.AllowDefaultConstructor = true; - }); - - // or for scoped service support like EF Core DbContext - // q.UseMicrosoftDependencyInjectionScopedJobFactory(); - - // these are the defaults - q.UseSimpleTypeLoader(); - q.UseInMemoryStore(); - q.UseDefaultThreadPool(tp => - { - tp.MaxConcurrency = 10; - }); - - if (!MixService.GetConfig("IsInit")) - { - // here's a known job for triggers - var jobKey = new JobKey("PublishScheduledPostsJob", "Publish Scheduled Posts Job"); - q.AddJob(jobKey, j => j - .WithDescription("Publish Scheduled Posts Job") - ); - - q.AddTrigger(t => t - .WithIdentity("PublishScheduledPostsTrigger") - .ForJob(jobKey) - .StartAt(DateTime.UtcNow.AddSeconds(10)) - .WithSimpleSchedule(x => x.WithIntervalInMinutes(1) - .RepeatForever()) - .WithDescription("Publish Scheduled Posts trigger") - ); - } - }); - // ASP.NET Core hosting - services.AddQuartzServer(options => - { - // when shutting down we want jobs to complete gracefully - options.WaitForJobsToComplete = true; - }); - return services; - } - - public static IApplicationBuilder UseMixScheduler(this IApplicationBuilder app) - { - return app; - } - - public static async Task StartScheduler() - { - LogProvider.SetCurrentLogProvider(new ConsoleLogProvider()); - - // Grab the Scheduler instance from the Factory - StdSchedulerFactory factory = new StdSchedulerFactory(); - IScheduler scheduler = await factory.GetScheduler(); - - // and start it off - await scheduler.Start(); - - // define the job and tie it to our HelloJob class - IJobDetail job = JobBuilder.Create() - .WithIdentity("job1", "group1") - .Build(); - - // Trigger the job to run now, and then repeat every 10 seconds - ITrigger trigger = TriggerBuilder.Create() - .WithIdentity("trigger1", "group1") - .StartNow() - .WithSimpleSchedule(x => x - .WithIntervalInSeconds(10) - .RepeatForever()) - .Build(); - HolidayCalendar holidayCalendar = new HolidayCalendar(); - // Tell quartz to schedule the job using our trigger - await scheduler.ScheduleJob(job, trigger); - } - - // simple log provider to get something to the console - private class ConsoleLogProvider : ILogProvider - { - public Logger GetLogger(string name) - { - return (level, func, exception, parameters) => - { - if (level >= LogLevel.Info && func != null) - { - Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters); - } - return true; - }; - } - - public IDisposable OpenNestedContext(string message) - { - throw new NotImplementedException(); - } - - public IDisposable OpenMappedContext(string key, string value) - { - throw new NotImplementedException(); - } - - public IDisposable OpenMappedContext(string key, object value, bool destructure = false) - { - throw new NotImplementedException(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Constants.cs b/src/Mix.Cms.Service.SignalR/Constants.cs deleted file mode 100644 index 38b5cc03e..000000000 --- a/src/Mix.Cms.Service.SignalR/Constants.cs +++ /dev/null @@ -1,130 +0,0 @@ -namespace Mix.Cms.Service.SignalR -{ - public class Constants - { - public const string DefaultDevice = "website"; - - public class HubMethods - { - public const string ReceiveMethod = "receive_message"; - public const string SendMessage = "send_message"; - public const string SendGroupMessage = "send_group_message"; - public const string SendPrivateMessage = "send_private_message"; - public const string SaveData = "save_data"; - public const string JoinGroup = "join_group"; - public const string NewMessage = "new_message"; - public const string NewNotification = "new_notification"; - public const string NewMember = "new_member"; - } - - public class HubMessages - { - public const string HubMemberName = "hub_member"; - public const string HubMemberFieldName = "hub_name"; - public const string UnknowErrorMsg = "Unknow"; - } - - public class Enums - { - public enum MessageReponseKey - { - NewMessage, - NewGroupMessage, - NewInvite, - NewRequest, - RemovedTeam, - RemovedMember, - MemberOffline, - NewTeam, - NewMember, - Connect, - ConnectSuccess, - ConnectFailed, - ConnectInitData, - GetTeam, - GetTeamMessages, - PreviousMessages, - SendMessage, - GetTeamNotifications, - NotMembered, - CancelRequest, - RejectInvite, - Error - } - - public enum ApiResponseKey - { - Succeed, - Failed - } - - public enum TeamResponseKey - { - GetTeamsSucceed, - GetTeamsFailed, - - SaveTeamSucceed, - SaveTeamFailed, - InvalidModel, - NameExisted, - NameRequired, - CountryRequired, - - SearchTeamMembersSucceed, - SearchTeamMembersFailed, - - SetMemberStatusSucceed, - SetMemberStatusFailed, - UnAuthorized, - TeamFulled - } - - public enum OnlineStatus - { - Disconnected = 0, - Connected = 1 - } - - public enum MemberStatus - { - Requested = 0, - Invited = 1, - AdminRejected = 2, - MemberRejected = 3, - Banned = 4, - Membered = 5, - AdminRemoved = 6, - MemberCanceled = 7, - Guest = 8, - MemberAccepted = 9, - MemberLeft = 10 - } - - public enum MessageType - { - String = 0, - Notification = 1, - Image = 2, - File = 3, - Voice = 4, - Location = 5, - Html = 6 - } - - public enum NotificationType - { - NewMessage = 0, - Join = 1, - Left = 2 - } - - public enum DeviceStatus - { - Deactived = 0, - Actived = 1, - Banned = 2, - Disconnected = 3 - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/BaseSignalRHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/BaseSignalRHub.cs deleted file mode 100644 index b78ff03b7..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/BaseSignalRHub.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.SignalR; -using Mix.Domain.Core.Models; -using Mix.Domain.Core.ViewModels; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR -{ - /// - /// Base SignalR Hub - /// - /// - public abstract class BaseSignalRHub : Microsoft.AspNetCore.SignalR.Hub - { - /// - /// The users - /// - protected static readonly List Users = new List(); - - /// - /// Called when [connected asynchronous]. - /// - /// - public override Task OnConnectedAsync() - { - UpdateGroupConnection(); - return base.OnConnectedAsync(); - } - - /// - /// Called when [disconnected asynchronous]. - /// - /// The exception. - /// - public override Task OnDisconnectedAsync(Exception exception) - { - // Remove the user - Users.RemoveAll(u => u.ConnectionId == Context.ConnectionId); - return base.OnDisconnectedAsync(exception); - } - - /// - /// Updates the group connection. - /// - public virtual void UpdateGroupConnection() - { - var user = Users.Find(p => p.ConnectionId == Context.ConnectionId); - if (user != null) - { - // Loop Group to Update UserId - //player.ConnectionId = Context.ConnectionId; - } - } - - /// - /// Updates the player connection identifier asynchronous. - /// - /// The player identifier. - public virtual void UpdatePlayerConnectionIdAsync(string playerId) - { - // TODO: is Async method? If not => Remove Async from method name! - var player = Users.Find(p => p.UserId == playerId); - if (player != null && player.ConnectionId != Context.ConnectionId) - { - //Missing Update current groups user connId - - player.ConnectionId = Context.ConnectionId; - //player.SaveModel(); - } - } - - /// - /// Fails the result. - /// - /// The object data. - /// The error MSG. - private void FailResult(dynamic objData, string errorMsg)//AccessTokenViewModel accessToken - { - const string responseKey = "Failed"; - const int status = 0; - ApiResult result = new ApiResult() - { - ResponseKey = responseKey, - Status = status, - Data = objData, - //authData = accessToken, - }; - Clients.Client(Context.ConnectionId).SendAsync("receiveMessage", result); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/InitCmsHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/InitCmsHub.cs deleted file mode 100644 index c037f43df..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/InitCmsHub.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.SignalR; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR.Hubs -{ - public class InitCmsHub : BaseSignalRHub - { - public async Task SendMessage(string message) - { - await Clients.All.SendAsync(Constants.HubMethods.ReceiveMethod, message).ConfigureAwait(false); - } - - public Task SendMessageToCaller(string message) - { - return Clients.Caller.SendAsync(Constants.HubMethods.ReceiveMethod, message); - } - - public Task SendMessageToGroups(string message) - { - List groups = new List() { "SignalR Users" }; - return Clients.Groups(groups).SendAsync(Constants.HubMethods.ReceiveMethod, message); - } - - public override async Task OnConnectedAsync() - { - await Groups.AddToGroupAsync(Context.ConnectionId, "SignalR Users").ConfigureAwait(true); - await base.OnConnectedAsync().ConfigureAwait(false); - } - - public override async Task OnDisconnectedAsync(Exception exception) - { - await Groups.RemoveFromGroupAsync(Context.ConnectionId, "SignalR Users").ConfigureAwait(true); - - await base.OnDisconnectedAsync(exception).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/MixChatHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/MixChatHub.cs deleted file mode 100644 index c0ae5aa89..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/MixChatHub.cs +++ /dev/null @@ -1,546 +0,0 @@ -using Microsoft.AspNetCore.SignalR; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Service.SignalR; -using Mix.Cms.Service.SignalR.Models; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using static Mix.Cms.Service.SignalR.Constants; -using static Mix.Cms.Service.SignalR.Constants.Enums; - -namespace Mix.Cms.Lib.Hubs -{ - public class MixChatHub : BaseSignalRHub - { - private const string defaultRoom = "public"; - private const string defaultDevice = "website"; - - public void Join(HubRequest request) - { - // Set connection Id - request.Data.ConnectionId = Context.ConnectionId; - request.Data.DeviceId = request.Data.DeviceId ?? defaultDevice; - // Mapping connecting user to db models - var user = new Service.SignalR.ViewModels.MixMessengerUsers.ConnectViewModel(request.Data); - - user.CreatedDate = DateTime.UtcNow; - // Save user and current device to db - var result = user.Join(); - - // save success - if (result.IsSucceed) - { - // Send success msg to caller - var getAvailableUsers = Service.SignalR.ViewModels.MixMessengerUsers.DefaultViewModel.Repository.GetModelListBy(u => u.Status == MixContentStatus.Published.ToString()); - SendToCaller(getAvailableUsers.Data, MessageReponseKey.ConnectSuccess); - // Announce every one there's new member - SendToAll(user, MessageReponseKey.NewMember, false); - } - else - { - // Send failed msg to caller - SendToConnection(result, MessageReponseKey.ConnectFailed, Context.ConnectionId, false); - } - } - - public void SendMessage(JObject request) - { - var data = request.ToObject>(); - data.Data.CreatedDate = DateTime.UtcNow; - SendToAll(data.Data, MessageReponseKey.NewMessage, true); - } - - public Task SendMessageToCaller(string message) - { - return Clients.Caller.SendAsync(HubMethods.ReceiveMethod, message); - } - - public Task SendMessageToGroups(string message) - { - List groups = new List() { "SignalR Users" }; - return Clients.Groups(groups).SendAsync(HubMethods.ReceiveMethod, message); - } - - private void SendToConnection(T message, MessageReponseKey action, string connectionId, bool isMySelf) - { - if (!string.IsNullOrEmpty(connectionId)) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - Clients.Client(connectionId).SendAsync(HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - else - { - Clients.OthersInGroup(connectionId).SendAsync(HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - } - } - - private void SendToCaller(T message, MessageReponseKey action) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - Clients.Caller.SendAsync(HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - - private void SendToGroup(T message, MessageReponseKey action, string groupName, bool isMySelf) - { - if (!string.IsNullOrEmpty(groupName)) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - Clients.Group(groupName).SendAsync(HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - else - { - Clients.OthersInGroup(groupName).SendAsync(HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - } - } - - private void SendToAll(T message, MessageReponseKey action, bool isMySelf) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - Clients.All.SendAsync(HubMethods.ReceiveMethod, result); - } - else - { - Clients.Others.SendAsync(HubMethods.ReceiveMethod, result); - } - } - - private string GetResponseKey(T e) - { - return Enum.GetName(typeof(T), e); - } - - #region Team - TODO Write these functions - - /* - [HubMethodName("getTeam")] - public async System.Threading.Tasks.Task GetTeam(JObject request) - { - string errorMsg = string.Empty; - int status = 0; - MessengerHubResponse result = null; - string action = Enum.GetName(typeof(TeamMessageReponseKey), TeamMessageReponseKey.GetTeam); - //PaginationModel currentMessages = new PaginationModel(); - try - { - if (TTXTeamMemberRepository.Instance.CheckIsExists(m => m.TeamId == request.TeamId && m.MemberId == request.UserId && m.Status == (int)MemberStatus.Membered)) - { - ChatTeamViewModel team = await TTXTeamRepository.Instance.GetSingleModelAsync(t => t.Id == request.TeamId); - - team.IsNewMessage = TTXTeamMessageRepository.Instance.CountUnseenMessage(team.Id, request.UserId) > 0; - - if (team != null) - { - team.IsAdmin = request.UserId == team.HostId; - if (team.IsAdmin) - { - team.TotalRequest = TTXTeamMemberRepository.Instance.CountRequests(request.TeamId); - } - - result = new MessengerHubResponse() - { - status = 1, - responseKey = string.Format("{0}", action), - data = team, - errors = null - }; - } - else - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = TeamMessageReponseKey.NotMembered.ToString(), - data = null, - errors = null - }; - } - } - else - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = GameResponseKey.NotAuthorized.ToString(), - data = null, - errors = new List() { "You are not membered of this team" } - }; - Clients.Caller.receiveMessage(result); - } - } - catch (Exception ex) - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = string.Format("{0}", action), - data = null, - error = ex.StackTrace - }; - } - finally - { - Clients.Caller.receiveMessage(result); - UpdatePlayerConnectionIdAsync(request.UserId); - } - } - - [HubMethodName("getTeamMessages")] - public async System.Threading.Tasks.Task GetTeamMessages(ApiGetTeamMemberViewMdoel request) - { - string errorMsg = string.Empty; - int status = 0; - MessengerHubResponse result = null; - string action = Enum.GetName(typeof(TeamMessageReponseKey), TeamMessageReponseKey.GetTeamMessages); - //PaginationModel currentMessages = new PaginationModel(); - try - { - if (TTXTeamMemberRepository.Instance.CheckIsExists(m => m.TeamId == request.TeamId && m.MemberId == request.UserId && m.Status == (int)MemberStatus.Membered)) - { - //var messages = await TTXTeamRepository.Instance.GetModelListByAsync(m => m.Id == request.TeamId, m => m.CreatedDate, "desc", 0, 10); - ChatTeamViewModel team = await TTXTeamRepository.Instance.GetSingleModelAsync - (t => t.Id == request.TeamId); - TTXTeamMemberRepository.Instance.UpdateLastSeenMessages(request.UserId, request.TeamId); - result = new MessengerHubResponse() - { - status = 1, - responseKey = string.Format("{0}", action), - data = team, - errors = null - }; - } - else - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = GameResponseKey.NotAuthorized.ToString(), - data = null, - errors = new List() { "You are not membered of this team" } - }; - Clients.Caller.receiveMessage(result); - } - } - catch (Exception ex) - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = string.Format("{0}", action), - data = null, - error = ex.StackTrace - }; - } - finally - { - Clients.Caller.receiveMessage(result); - UpdatePlayerConnectionIdAsync(request.UserId); - } - } - - [HubMethodName("seenTeamMessages")] - public async Task LeaveTeamMessagesAsync(ApiGetTeamMemberViewMdoel request) - { - if (TTXTeamMemberRepository.Instance.CheckIsExists(m => m.TeamId == request.TeamId && m.MemberId == request.UserId && m.Status == (int)MemberStatus.Membered)) - { - TTXTeamMemberRepository.Instance.UpdateLastSeenMessages(request.UserId, request.TeamId); - MessengerHubResponse result = new MessengerHubResponse() - { - status = 1, - responseKey = Enum.GetName(typeof(ApiResponseKey), ApiResponseKey.Succeed), - data = true - }; - Clients.Caller.receiveMessage(result); - } - UpdatePlayerConnectionIdAsync(request.UserId); - } - - [HubMethodName("getTeamNotifications")] - public async System.Threading.Tasks.Task GetTeamNotifications(ApiGetTeamMemberViewMdoel request) - { - string errorMsg = string.Empty; - string action = Enum.GetName(typeof(TeamMessageReponseKey), TeamMessageReponseKey.GetTeamNotifications); - try - { - switch (request.MemberStatus) - { - case MemberStatus.Requested: - var requests = await TTXTeamMemberRepository.Instance.GetModelListByAsync(m => m.TTX_Team.HostId == request.UserId && m.TeamId == request.TeamId && m.Status == (int)MemberStatus.Requested); - if (requests.Count > 0) - { - var lastSeenTeamRequest = DAL.TTXApp.TTXUserLogDAL.Instance.GetSingleModel(l => l.UserId == request.UserId - && l.Action == TTXUserLogActions.LastSeenTeamRequest.ToString()); - requests.ForEach(i => i.IsNew = lastSeenTeamRequest == null || lastSeenTeamRequest.LastUpdate.Value < i.CreatedDate); - - if (lastSeenTeamRequest == null) - { - lastSeenTeamRequest = new TTX_User_Log() - { - Id = Guid.NewGuid(), - Action = TTXUserLogActions.LastSeenTeamRequest.ToString(), - UserId = request.UserId, - CreatedDate = DateTime.UtcNow, - LastUpdate = DateTime.UtcNow - }; - } - else - { - lastSeenTeamRequest.LastUpdate = DateTime.UtcNow; - } - TTXUserLogDAL.Instance.SaveModel(lastSeenTeamRequest); - } - - MessengerHubResponse> result = new MessengerHubResponse>() - { - status = 1, - responseKey = string.Format("{0}", action), - data = requests.OrderByDescending(r => r.CreatedDate).ToList(), - errors = null - }; - - Clients.Caller.receiveMessage(result); - - break; - - case MemberStatus.Invited: - var invitations = await TTXTeamMemberRepository.Instance.GetModelListByAsync(m => m.MemberId == request.UserId && m.Status == (int)MemberStatus.Invited); - var lastSeenTeamInvitation = DAL.TTXApp.TTXUserLogDAL.Instance.GetSingleModel(l => l.UserId == request.UserId - && l.Action == TTXUserLogActions.LastSeenTeamInvitation.ToString()); - invitations.ForEach(i => i.IsNew = lastSeenTeamInvitation == null || lastSeenTeamInvitation.LastUpdate.Value < i.CreatedDate); - - if (lastSeenTeamInvitation == null) - { - lastSeenTeamInvitation = new TTX_User_Log() - { - Id = Guid.NewGuid(), - Action = TTXUserLogActions.LastSeenTeamInvitation.ToString(), - UserId = request.UserId, - CreatedDate = DateTime.UtcNow, - LastUpdate = DateTime.UtcNow - }; - } - else - { - lastSeenTeamInvitation.LastUpdate = DateTime.UtcNow; - } - TTXUserLogDAL.Instance.SaveModel(lastSeenTeamInvitation); - - MessengerHubResponse> inviteResult = new MessengerHubResponse>() - { - status = 1, - responseKey = string.Format("{0}", action), - data = invitations.OrderByDescending(r => r.CreatedDate).ToList(), - errors = null - }; - - Clients.Caller.receiveMessage(inviteResult); - - break; - - case MemberStatus.AdminRejected: - break; - - case MemberStatus.MemberRejected: - break; - - case MemberStatus.Banned: - break; - - case MemberStatus.Membered: - break; - - case MemberStatus.AdminRemoved: - break; - - case MemberStatus.MemberCanceled: - break; - - case MemberStatus.Guest: - break; - - default: - break; - } - } - catch (Exception ex) - { - } - finally - { - UpdatePlayerConnectionIdAsync(request.UserId); - } - } - - [HubMethodName("getMyTeams")] - public async System.Threading.Tasks.Task GetMyTeams(RequestPaging request) - { - string errorMsg = string.Empty; - int status = 0; - MessengerHubResponse> result = null; - string action = "GetMyTeams"; - //PaginationModel currentMessages = new PaginationModel(); - try - { - PaginationModel teams = await TTXTeamRepository.Instance.GetModelListByAsync( - t => t.TTX_Team_Member.Count(m => m.MemberId == request.UserId && m.Status == (int)MemberStatus.Membered) > 0, - t => t.CreatedDate, "desc", request.PageIndex, request.PageSize - ); - result = new MessengerHubResponse>() - { - status = 1, - responseKey = string.Format("{0}", action), - data = teams, - errors = null - }; - } - catch (Exception ex) - { - result = new MessengerHubResponse>() - { - status = 0, - responseKey = action, - data = null, - error = ex.StackTrace - }; - } - finally - { - Clients.Caller.receiveMessage(result); - UpdatePlayerConnectionIdAsync(request.UserId); - } - } - - [HubMethodName("removeTeam")] - public async System.Threading.Tasks.Task RemoveTeam(ApiGetTeamMemberViewMdoel request) - { - string errorMsg = string.Empty; - int status = 0; - MessengerHubResponse result = null; - string action = Enum.GetName(typeof(TeamMessageReponseKey), TeamMessageReponseKey.RemovedTeam); - //PaginationModel currentMessages = new PaginationModel(); - try - { - if (TTXTeamMemberRepository.Instance.CheckIsExists(m => m.TeamId == request.TeamId && m.MemberId == request.UserId && m.Status == (int)MemberStatus.Membered)) - { - var removeResult = await TTXTeamRepository.Instance.RemoveModelAsync(t => t.Id == request.TeamId); - - if (removeResult.IsSucceed) - { - result = new MessengerHubResponse() - { - status = 1, - responseKey = string.Format("{0}", action), - data = removeResult.IsSucceed, - errors = null - }; - } - else - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = TeamMessageReponseKey.NotMembered.ToString(), - data = false, - errors = null - }; - } - } - else - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = GameResponseKey.NotAuthorized.ToString(), - data = false, - errors = new List() { "You are not membered of this team" } - }; - Clients.Caller.receiveMessage(result); - } - } - catch (Exception ex) - { - result = new MessengerHubResponse() - { - status = 0, - responseKey = string.Format("{0}", action), - data = false, - error = ex.StackTrace - }; - } - finally - { - Clients.Caller.receiveMessage(result); - UpdatePlayerConnectionIdAsync(request.UserId); - } - } - */ - - #endregion Team - TODO Write these functions - - #region Overrides - - public override async Task OnConnectedAsync() - { - await Groups.AddToGroupAsync(Context.ConnectionId, defaultRoom); - await base.OnConnectedAsync(); - } - - public override Task OnDisconnectedAsync(Exception exception) - { - // Get current disconnected device - var getUserDevice = Service.SignalR.ViewModels.MixMessengerUserDevices.DefaultViewModel.Repository.GetSingleModel(u => u.ConnectionId == Context.ConnectionId); - if (getUserDevice.IsSucceed) - { - getUserDevice.Data.Status = DeviceStatus.Disconnected; - var countOnlineDevice = Service.SignalR.ViewModels.MixMessengerUserDevices.DefaultViewModel.Repository.Count(d => d.UserId == getUserDevice.Data.UserId && d.DeviceId != getUserDevice.Data.DeviceId && d.Status == 1).Data; - if (countOnlineDevice == 0) - { - SendToAll(getUserDevice.Data.UserId, MessageReponseKey.MemberOffline, false); - } - var getUser = Service.SignalR.ViewModels.MixMessengerUsers.DefaultViewModel.Repository.GetSingleModel(u => u.Id == getUserDevice.Data.UserId); - if (getUser.IsSucceed) - { - getUser.Data.Status = OnlineStatus.Disconnected; - getUser.Data.SaveModel(); - SendToAll(getUserDevice.Data.UserId, MessageReponseKey.MemberOffline, false); - } - } - //SendToAll(user, MessageReponseKey.RemoveMember, false); - - return base.OnDisconnectedAsync(exception); - } - - #endregion Overrides - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/PortalHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/PortalHub.cs deleted file mode 100644 index bf6408d7c..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/PortalHub.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.SignalR; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR.Hubs -{ - public class PortalHub : BaseSignalRHub - { - public async Task SendMessage(string message) - { - await Clients.All.SendAsync(Constants.HubMethods.ReceiveMethod, message).ConfigureAwait(false); - } - - public Task SendMessageToCaller(string message) - { - return Clients.Caller.SendAsync(Constants.HubMethods.ReceiveMethod, message); - } - - public Task SendMessageToGroups(string message) - { - List groups = new List() { "SignalR Users" }; - return Clients.Groups(groups).SendAsync(Constants.HubMethods.ReceiveMethod, message); - } - - public override async Task OnConnectedAsync() - { - await Groups.AddToGroupAsync(Context.ConnectionId, "SignalR Users").ConfigureAwait(true); - await base.OnConnectedAsync().ConfigureAwait(false); - } - - public override async Task OnDisconnectedAsync(Exception exception) - { - await Groups.RemoveFromGroupAsync(Context.ConnectionId, "SignalR Users").ConfigureAwait(true); - - await base.OnDisconnectedAsync(exception).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/ServiceHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/ServiceHub.cs deleted file mode 100644 index 6360ac80a..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/ServiceHub.cs +++ /dev/null @@ -1,238 +0,0 @@ -using Microsoft.AspNetCore.SignalR; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Messenger.Models.Data; -using Mix.Cms.Service.SignalR.Models; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR.Hubs -{ - public class ServiceHub : BaseSignalRHub - { - private readonly MixChatServiceContext _context; - private readonly MixCmsContext _msgContext; - - public ServiceHub(MixChatServiceContext context, MixCmsContext msgContext) : base() - { - _context = context; - _msgContext = msgContext; - } - - #region Hub Methods - - // TODO Handle Join/Leave group - public Task HandleRequest(string data) - { - var request = JObject.Parse(data).ToObject>(); - switch (request.Action) - { - case Constants.HubMethods.SaveData: - return SaveData(request); - - case Constants.HubMethods.JoinGroup: - return JoinGroup(request); - - case Constants.HubMethods.SendMessage: - return SendToAll(request, Constants.Enums.MessageReponseKey.NewMessage, request.IsMySelf); - - case Constants.HubMethods.SendGroupMessage: - if (request.IsSave) - { - _ = SaveData(request); - } - return SendToGroup(request, Constants.Enums.MessageReponseKey.NewMessage, request.Room, request.IsMySelf); - - default: - return SendToCaller(Constants.HubMessages.UnknowErrorMsg, Constants.Enums.MessageReponseKey.Error); - } - } - - #endregion Hub Methods - - #region Handler - - private async Task SaveData(HubRequest request) - { - var data = new Lib.ViewModels.MixDatabaseDatas.FormViewModel() - { - Specificulture = request.Specificulture, - MixDatabaseName = request.Room, - Obj = request.Data, - CreatedBy = request.Uid - }; - var saveData = await data.SaveModelAsync(true); - } - - private async Task JoinGroup(HubRequest request) - { - var connection = request.Data.ToObject(); - // Set connection Id - connection.ConnectionId = Context.ConnectionId; - connection.DeviceId = connection.DeviceId ?? Constants.DefaultDevice; - - // Add User to group connections - await Groups.AddToGroupAsync(Context.ConnectionId, request.Room); - // Announce Other Group member there is new user - await SendToGroup(connection, Constants.Enums.MessageReponseKey.NewMember, request.Room); - - // Get Online users - var getAvailableUsers = ViewModels.MixMessengerUsers.DefaultViewModel.Repository.GetModelListBy( - u => u.Status == Constants.Enums.OnlineStatus.Connected.ToString()); - if (getAvailableUsers.IsSucceed) - { - // Announce User Connected to Group and list available users - await SendToCaller(getAvailableUsers.Data, Constants.Enums.MessageReponseKey.ConnectSuccess); - } - var getPreviousMsgs = Mix.Cms.Service.SignalR.ViewModels.MixDatabaseDatas.ReadViewModel.Repository.GetModelListBy( - m => m.MixDatabaseName == request.Room && m.Specificulture == request.Specificulture - , "CreatedDateTime", Heart.Enums.MixHeartEnums.DisplayDirection.Desc, 10, 0); - // Get previous messages - if (getPreviousMsgs.IsSucceed) - { - getPreviousMsgs.Data.Items = getPreviousMsgs.Data.Items.OrderBy(m => m.CreatedDateTime).ToList(); - await SendToCaller(getPreviousMsgs.Data, Constants.Enums.MessageReponseKey.PreviousMessages); - } - var groupMembers = GetGroupMembersAsync(request); - - var result = new RepositoryResponse(); - // Mapping connecting user to db models - var user = new ViewModels.MixMessengerUsers.ConnectViewModel(connection) - { - CreatedDate = DateTime.UtcNow - }; - result = user.Join(); - } - - private async Task GetGroupMembersAsync(HubRequest request) - { - Expression> predicate = m => m.Specificulture == request.Specificulture - && m.MixDatabaseName == Constants.HubMessages.HubMemberName && m.MixDatabaseColumnName == request.Room; - var data = await Lib.ViewModels.MixDatabaseDatas.Helper.FilterByKeywordAsync( - request.Specificulture, request.Room, null, null); - return data; - } - - #region Send Methods - - private Task SendToConnection(T message, Constants.Enums.MessageReponseKey action, string connectionId, bool isMySelf) - { - if (!string.IsNullOrEmpty(connectionId)) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - return Clients.Client(connectionId).SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - else - { - return Clients.OthersInGroup(connectionId).SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result)); - } - } - else - { - return SendToCaller(Constants.HubMessages.UnknowErrorMsg, Constants.Enums.MessageReponseKey.Error); - } - } - - private async Task SendToCaller(T message, Constants.Enums.MessageReponseKey action) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - await Clients.Caller.SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result).ToString(Newtonsoft.Json.Formatting.None)); - } - - private async Task SendToGroup(T message, Constants.Enums.MessageReponseKey action, string groupName, bool isMySelf = false) - { - if (!string.IsNullOrEmpty(groupName)) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - await Clients.Group(groupName).SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result).ToString(Newtonsoft.Json.Formatting.None)); - } - else - { - await Clients.OthersInGroup(groupName).SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result).ToString(Newtonsoft.Json.Formatting.None)); - } - } - else - { - await SendToCaller(Constants.HubMessages.UnknowErrorMsg, Constants.Enums.MessageReponseKey.Error); - } - } - - private async Task SendToAll(T message, Constants.Enums.MessageReponseKey action, bool isMySelf) - { - HubResponse result = new HubResponse() - { - IsSucceed = true, - Data = message, - ResponseKey = GetResponseKey(action) - }; - - if (isMySelf) - { - await Clients.All.SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result).ToString(Newtonsoft.Json.Formatting.None)); - } - else - { - await Clients.Others.SendAsync(Constants.HubMethods.ReceiveMethod, JObject.FromObject(result).ToString(Newtonsoft.Json.Formatting.None)); - } - } - - private string GetResponseKey(T e) - { - return Enum.GetName(typeof(T), e); - } - - #endregion Send Methods - - public override Task OnConnectedAsync() - { - return base.OnConnectedAsync(); - } - - public override Task OnDisconnectedAsync(Exception exception) - { - var getDevice = ViewModels.MixMessengerUserDevices.DefaultViewModel.Repository.GetSingleModel(m => m.ConnectionId == Context.ConnectionId); - if (getDevice.IsSucceed) - { - getDevice.Data.Status = Constants.Enums.DeviceStatus.Disconnected; - getDevice.Data.SaveModel(false); - var getUser = ViewModels.MixMessengerUsers.DefaultViewModel.Repository.GetSingleModel(m => m.Id == getDevice.Data.UserId); - if (getUser.IsSucceed) - { - if (ViewModels.MixMessengerUserDevices.DefaultViewModel.Repository.Count(m => m.UserId == getUser.Data.Id && m.Status == (int)Constants.Enums.DeviceStatus.Actived).Data == 0) - { - getUser.Data.Status = Constants.Enums.OnlineStatus.Disconnected; - getUser.Data.SaveModel(false); - } - } - } - - return base.OnDisconnectedAsync(exception); - } - - #endregion Handler - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Hubs/VideoChatHub.cs b/src/Mix.Cms.Service.SignalR/Hubs/VideoChatHub.cs deleted file mode 100644 index 9673bac48..000000000 --- a/src/Mix.Cms.Service.SignalR/Hubs/VideoChatHub.cs +++ /dev/null @@ -1,217 +0,0 @@ -using Microsoft.AspNetCore.SignalR; -using Mix.Cms.Service.SignalR.Models.VideoChat; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR.Hubs -{ - public class VideoChatHub : BaseSignalRHub - { - // Client API: - // - // updateUserList(List userList) - // callAccepted(User acceptingUser) - // callDeclined(User decliningUser, string reason) - // incomingCall(User callingUser) - // receiveSignal(User signalingUser, string signal) - - private new static readonly List Users = new List(); - private static readonly List UserCalls = new List(); - private static readonly List CallOffers = new List(); - - public async Task Join(string username) - { - // Add the new user - Users.Add(new User - { - Username = username, - ConnectionId = Context.ConnectionId - }); - - // Send down the new list to all clients - await SendUserListUpdateAsync(); - } - - #region Overrides - - public override Task OnDisconnectedAsync(Exception exception) - { - // Hang up any calls the user is in - _ = HangUp(); // Gets the user from "Context" which is available in the whole hub - // Send down the new user list to all clients - _ = SendUserListUpdateAsync(); - // Remove the user - Users.RemoveAll(u => u.ConnectionId == Context.ConnectionId); - return base.OnDisconnectedAsync(exception); - } - - #endregion Overrides - - public async Task CallUser(string targetConnectionId) - { - var callingUser = Users.SingleOrDefault(u => u.ConnectionId == Context.ConnectionId); - var targetUser = Users.SingleOrDefault(u => u.ConnectionId == targetConnectionId); - - // Make sure the person we are trying to call is still here - if (targetUser == null) - { - // If not, let the caller know - await Clients.Caller.SendAsync("callDeclined", targetConnectionId, "The user you called has left."); - } - - // And that they aren't already in a call - if (GetUserCall(targetUser.ConnectionId) != null) - { - await Clients.Caller.SendAsync("callDeclined", targetConnectionId, string.Format("{0} is already in a call.", targetUser.Username)); - return; - } - - // They are here, so tell them someone wants to talk - await Clients.Client(targetConnectionId).SendAsync("incomingCall", JObject.FromObject(callingUser).ToString(Newtonsoft.Json.Formatting.None)); - - // Create an offer - CallOffers.Add(new CallOffer - { - Caller = callingUser, - Callee = targetUser - }); - } - - public async Task AnswerCall(bool acceptCall, string targetConnectionId) - { - var callingUser = Users.SingleOrDefault(u => u.ConnectionId == Context.ConnectionId); - var targetUser = Users.SingleOrDefault(u => u.ConnectionId == targetConnectionId); - - // This can only happen if the server-side came down and clients were cleared, while the user - // still held their browser session. - if (callingUser == null) - { - return; - } - - // Make sure the original caller has not left the page yet - if (targetUser == null) - { - await Clients.Caller.SendAsync("callEnded", targetConnectionId, "The other user in your call has left."); - return; - } - - // Send a decline message if the callee said no - if (acceptCall == false) - { - await Clients.Client(targetConnectionId).SendAsync("callDeclined", callingUser, string.Format("{0} did not accept your call.", callingUser.Username)); - return; - } - - // Make sure there is still an active offer. If there isn't, then the other use hung up before the Callee answered. - var offerCount = CallOffers.RemoveAll(c => c.Callee.ConnectionId == callingUser.ConnectionId - && c.Caller.ConnectionId == targetUser.ConnectionId); - if (offerCount < 1) - { - await Clients.Caller.SendAsync("callEnded", targetConnectionId, string.Format("{0} has already hung up.", targetUser.Username)); - return; - } - - // And finally... make sure the user hasn't accepted another call already - if (GetUserCall(targetUser.ConnectionId) != null) - { - // And that they aren't already in a call - await Clients.Caller.SendAsync("callDeclined", targetConnectionId, string.Format("{0} chose to accept someone elses call instead of yours :(", targetUser.Username)); - return; - } - - // Remove all the other offers for the call initiator, in case they have multiple calls out - CallOffers.RemoveAll(c => c.Caller.ConnectionId == targetUser.ConnectionId); - - // Create a new call to match these folks up - UserCalls.Add(new UserCall - { - Users = new List { callingUser, targetUser } - }); - - // Tell the original caller that the call was accepted - await Clients.Client(targetConnectionId).SendAsync("callAccepted", JObject.FromObject(callingUser).ToString(Newtonsoft.Json.Formatting.None)); - - // Update the user list, since thes two are now in a call - await SendUserListUpdateAsync(); - } - - public async Task HangUp() - { - var callingUser = Users.SingleOrDefault(u => u.ConnectionId == Context.ConnectionId); - - if (callingUser == null) - { - return; - } - - var currentCall = GetUserCall(callingUser.ConnectionId); - - // Send a hang up message to each user in the call, if there is one - if (currentCall != null) - { - foreach (var user in currentCall.Users.Where(u => u.ConnectionId != callingUser.ConnectionId)) - { - await Clients.Client(user.ConnectionId).SendAsync("callEnded", callingUser.ConnectionId, - string.Format("{0} has hung up.", callingUser.Username)); - } - - // Remove the call from the list if there is only one (or none) person left. This should - // always trigger now, but will be useful when we implement conferencing. - currentCall.Users.RemoveAll(u => u.ConnectionId == callingUser.ConnectionId); - if (currentCall.Users.Count < 2) - { - UserCalls.Remove(currentCall); - } - } - - // Remove all offers initiating from the caller - CallOffers.RemoveAll(c => c.Caller.ConnectionId == callingUser.ConnectionId); - - await SendUserListUpdateAsync(); - } - - // WebRTC Signal Handler - public async Task SendSignal(string signal, string targetConnectionId) - { - var callingUser = Users.SingleOrDefault(u => u.ConnectionId == Context.ConnectionId); - var targetUser = Users.SingleOrDefault(u => u.ConnectionId == targetConnectionId); - - // Make sure both users are valid - if (callingUser == null || targetUser == null) - { - return; - } - - // Make sure that the person sending the signal is in a call - var userCall = GetUserCall(callingUser.ConnectionId); - - // ...and that the target is the one they are in a call with - if (userCall != null && userCall.Users.Exists(u => u.ConnectionId == targetUser.ConnectionId)) - { - // These folks are in a call together, let's let em talk WebRTC - await Clients.Client(targetConnectionId).SendAsync("receiveSignal", JObject.FromObject(callingUser).ToString(Newtonsoft.Json.Formatting.None), signal); - } - } - - #region Private Helpers - - private async Task SendUserListUpdateAsync() - { - Users.ForEach(u => u.InCall = (GetUserCall(u.ConnectionId) != null)); - await Clients.All.SendAsync("updateUserList", JArray.FromObject(Users).ToString(Newtonsoft.Json.Formatting.None)); - } - - private UserCall GetUserCall(string connectionId) - { - var matchingCall = - UserCalls.SingleOrDefault(uc => uc.Users.SingleOrDefault(u => u.ConnectionId == connectionId) != null); - return matchingCall; - } - - #endregion Private Helpers - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Mix.Cms.Service.SignalR.csproj b/src/Mix.Cms.Service.SignalR/Mix.Cms.Service.SignalR.csproj deleted file mode 100644 index a9ca33f9c..000000000 --- a/src/Mix.Cms.Service.SignalR/Mix.Cms.Service.SignalR.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net5.0 - false - - - - - - - - - - - - - - - - - - diff --git a/src/Mix.Cms.Service.SignalR/Models/HubModels.cs b/src/Mix.Cms.Service.SignalR/Models/HubModels.cs deleted file mode 100644 index c1b8ff053..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/HubModels.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Service.SignalR.Models -{ - public class MessengerConnection - { - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("connectionId")] - public string ConnectionId { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("avatar")] - public string Avatar { get; set; } - - [JsonProperty("deviceId")] - public string DeviceId { get; set; } - } - - public class HubMessage - { - //From Connection - [JsonProperty("connection")] - public MessengerConnection Connection { get; set; } - - [JsonProperty("content")] - public string Content { get; set; } - - [JsonProperty("createdDate")] - public DateTime CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Models/HubRequest.cs b/src/Mix.Cms.Service.SignalR/Models/HubRequest.cs deleted file mode 100644 index d31b34a0b..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/HubRequest.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Service.SignalR.Models -{ - public class HubRequest - { - [JsonProperty("uid")] - public string Uid { get; set; } - - [JsonProperty("connection")] - public MessengerConnection Connection { get; set; } - - [JsonProperty("from")] - public string From { get; set; } - - [JsonProperty("to")] - public string To { get; set; } - - [JsonProperty("attributeSetName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("action")] - public string Action { get; set; } - - [JsonProperty("data")] - public T Data { get; set; } - - [JsonProperty("requestDate")] - public DateTime RequestDate { get { return DateTime.UtcNow; } } - - [JsonProperty("room")] - public string Room { get; set; } - - [JsonProperty("isMyself")] - public bool IsMySelf { get; set; } - - [JsonProperty("isSave")] - public bool IsSave { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Models/HubResponse.cs b/src/Mix.Cms.Service.SignalR/Models/HubResponse.cs deleted file mode 100644 index ecabef59d..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/HubResponse.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Service.SignalR.Models -{ - public class HubResponse - { - [JsonProperty("isSucceed")] - public bool IsSucceed { get; set; } - - [JsonProperty("responseKey")] - public string ResponseKey { get; set; } - - [JsonProperty("errors")] - public List Errors { get; set; } = new List(); - - [JsonProperty("exception")] - public Exception Exception { get; set; } - - [JsonProperty("data")] - public T Data { get; set; } - - [JsonProperty("renderDate")] - public DateTime RenderDate { get { return DateTime.UtcNow; } } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Models/VideoChat/CallOffer.cs b/src/Mix.Cms.Service.SignalR/Models/VideoChat/CallOffer.cs deleted file mode 100644 index 218c63bed..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/VideoChat/CallOffer.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Mix.Cms.Service.SignalR.Models.VideoChat -{ - public class CallOffer - { - public User Caller; - public User Callee; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Models/VideoChat/User.cs b/src/Mix.Cms.Service.SignalR/Models/VideoChat/User.cs deleted file mode 100644 index 2ed439ce7..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/VideoChat/User.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Mix.Cms.Service.SignalR.Models.VideoChat -{ - public class User - { - public string Username; - public string ConnectionId; - public bool InCall; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/Models/VideoChat/UserCall.cs b/src/Mix.Cms.Service.SignalR/Models/VideoChat/UserCall.cs deleted file mode 100644 index 11586816e..000000000 --- a/src/Mix.Cms.Service.SignalR/Models/VideoChat/UserCall.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace Mix.Cms.Service.SignalR.Models.VideoChat -{ - public class UserCall - { - public List Users; - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ServiceCollectionExtensions.cs b/src/Mix.Cms.Service.SignalR/ServiceCollectionExtensions.cs deleted file mode 100644 index 37c6e56e8..000000000 --- a/src/Mix.Cms.Service.SignalR/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Mix.Cms.Service.SignalR.Hubs; - -namespace Mix.Cms.Service.SignalR -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddMixSignalR(this IServiceCollection services) - { - services.AddSignalR() - .AddJsonProtocol(options => - { - options.PayloadSerializerOptions.PropertyNamingPolicy = null; - }) - .AddMessagePackProtocol(); - return services; - } - - public static IApplicationBuilder UseMixSignalR(this IApplicationBuilder app) - { - app.UseEndpoints(endpoints => - { - endpoints.MapHub("/portalHub"); - endpoints.MapHub("/serviceHub"); - endpoints.MapHub("/videoChatHub"); - }); - return app; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/FormViewModel.cs b/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/FormViewModel.cs deleted file mode 100644 index 26b17c6d7..000000000 --- a/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/FormViewModel.cs +++ /dev/null @@ -1,538 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using Mix.Services; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Service.SignalR.ViewModels.MixDatabaseDatas -{ - public class FormViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("attributeSetId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("attributeSetName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("status")] - public string Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("data")] - public JObject Data { get; set; } - - [JsonProperty("relatedData")] - [JsonIgnore] - public List RelatedData { get; set; } = new List(); - - [JsonIgnore] - public List Values { get; set; } - - [JsonIgnore] - public List Fields { get; set; } - - [JsonIgnore] - public List RefData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public FormViewModel() : base() - { - } - - public FormViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getValues = Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction); - if (getValues.IsSucceed) - { - Fields = Lib.ViewModels.MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - Values = getValues.Data.OrderBy(a => a.Priority).ToList(); - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - Priority = field.Priority - }; - Values.Add(val); - } - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - } - - ParseData(); - } - } - - public override MixDatabaseData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - if (string.IsNullOrEmpty(Id)) - { - Id = Guid.NewGuid().ToString(); - CreatedDateTime = DateTime.UtcNow; - Priority = Repository.Count(m => m.MixDatabaseName == MixDatabaseName && m.Specificulture == Specificulture, _context, _transaction).Data + 1; - } - - if (string.IsNullOrEmpty(MixDatabaseName)) - { - MixDatabaseName = _context.MixDatabase.First(m => m.Id == MixDatabaseId)?.Name; - } - if (MixDatabaseId == 0) - { - MixDatabaseId = _context.MixDatabase.First(m => m.Name == MixDatabaseName)?.Id ?? 0; - } - Values = Values ?? Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction).Data.OrderBy(a => a.Priority).ToList(); - Fields = Lib.ViewModels.MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - StringValue = field.DefaultValue, - Priority = field.Priority, - Field = field - }; - Values.Add(val); - } - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - if (Data[val.MixDatabaseColumnName] != null) - { - if (val.Field.DataType == MixDataType.Reference) - { - var arr = Data[val.MixDatabaseColumnName].Value(); - if (arr != null) - { - foreach (JObject objData in arr) - { - string id = objData["id"]?.Value(); - // if have id => update data, else add new - if (!string.IsNullOrEmpty(id)) - { - //var getData = Repository.GetSingleModel(m => m.Id == id && m.Specificulture == Specificulture, _context, _transaction); - //if (getData.IsSucceed) - //{ - // getData.Data.Data = objData; - // RefData.Add(getData.Data); - //} - } - else - { - RefData.Add(new FormViewModel() - { - Specificulture = Specificulture, - MixDatabaseId = field.ReferenceId.Value, - Data = objData - }); - } - } - } - } - else - { - ParseModelValue(Data[val.MixDatabaseColumnName], val); - } - } - else - { - Data.Add(ParseValue(val)); - } - } - - // Save Edm html - var getAttrSet = Mix.Cms.Lib.ViewModels.MixDatabases.ReadViewModel.Repository.GetSingleModel(m => m.Name == MixDatabaseName, _context, _transaction); - var getEdm = Lib.ViewModels.MixTemplates.UpdateViewModel.GetTemplateByPath(getAttrSet.Data.EdmTemplate, Specificulture); - var edmField = Values.FirstOrDefault(f => f.MixDatabaseColumnName == "edm"); - if (edmField != null && getEdm.IsSucceed && !string.IsNullOrEmpty(getEdm.Data.Content)) - { - string body = getEdm.Data.Content; - foreach (var prop in Data.Properties()) - { - body = body.Replace($"[[{prop.Name}]]", Data[prop.Name].Value()); - } - var edmFile = new FileViewModel() - { - Content = body, - Extension = ".html", - FileFolder = "edms", - Filename = $"{getAttrSet.Data.EdmSubject}-{Id}" - }; - if (MixFileRepository.Instance.SaveWebFile(edmFile)) - { - Data["edm"] = edmFile.WebPath; - edmField.StringValue = edmFile.WebPath; - } - } - //End save edm - return base.ParseModel(_context, _transaction); ; - } - - #region Async - - public override async Task> SaveModelAsync(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = await base.SaveModelAsync(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - ParseData(); - } - return result; - } - - public override RepositoryResponse SaveModel(bool isSaveSubModels = false, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var result = base.SaveModel(isSaveSubModels, _context, _transaction); - if (result.IsSucceed) - { - ParseData(); - } - return result; - } - - public override async Task> SaveSubModelsAsync(MixDatabaseData parent, MixCmsContext _context, IDbContextTransaction _transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - if (result.IsSucceed) - { - RepositoryResponse saveValues = await SaveValues(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveValues, ref result); - } - // Save Ref Data - if (result.IsSucceed) - { - RepositoryResponse saveRefData = await SaveRefDataAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveRefData, ref result); - } - - // Save Related Data - if (result.IsSucceed) - { - RepositoryResponse saveRelated = await SaveRelatedDataAsync(parent, _context, _transaction); - ViewModelHelper.HandleResult(saveRelated, ref result); - } - - return result; - } - - private async Task> SaveValues(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in Values) - { - if (result.IsSucceed) - { - if (Fields.Any(f => f.Id == item.MixDatabaseColumnId)) - { - item.Priority = item.Field.Priority; - item.DataId = parent.Id; - item.Specificulture = parent.Specificulture; - var saveResult = await item.SaveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - var delResult = await item.RemoveModelAsync(false, context, transaction); - ViewModelHelper.HandleResult(delResult, ref result); - } - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRefDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - foreach (var item in RefData) - { - if (result.IsSucceed) - { - item.Specificulture = Specificulture; - var saveRef = await item.SaveModelAsync(true, context, transaction); - if (saveRef.IsSucceed) - { - RelatedData.Add(new Lib.ViewModels.MixDatabaseDataAssociations.UpdateViewModel() - { - Id = saveRef.Data.Id, - ParentId = Id, - ParentType = MixDatabaseParentType.Set, - MixDatabaseId = saveRef.Data.MixDatabaseId, - MixDatabaseName = saveRef.Data.MixDatabaseName, - CreatedDateTime = DateTime.UtcNow, - Specificulture = Specificulture - }); - } - ViewModelHelper.HandleResult(saveRef, ref result); - } - else - { - break; - } - } - return result; - } - - private async Task> SaveRelatedDataAsync(MixDatabaseData parent, MixCmsContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - - foreach (var item in RelatedData) - { - if (result.IsSucceed) - { - // Current data is child data - if (string.IsNullOrEmpty(item.Id)) - { - item.MixDatabaseId = parent.MixDatabaseId; - item.MixDatabaseName = parent.MixDatabaseName; - item.Id = parent.Id; - } - // Current data is parent data - else if (string.IsNullOrEmpty(item.ParentId)) - { - item.ParentId = parent.Id; - } - item.Priority = Lib.ViewModels.MixDatabaseDataAssociations.UpdateViewModel.Repository.Count( - m => m.ParentId == Id && m.Specificulture == Specificulture, context, transaction).Data + 1; - item.Specificulture = Specificulture; - item.CreatedDateTime = DateTime.UtcNow; - var saveResult = await item.SaveModelAsync(true, context, transaction); - ViewModelHelper.HandleResult(saveResult, ref result); - } - else - { - break; - } - } - - return result; - } - - #endregion Async - - #endregion Overrides - - #region Expands - - private JProperty ParseValue(Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.DataType) - { - case MixDataType.DateTime: - return new JProperty(item.MixDatabaseColumnName, item.DateTimeValue); - - case MixDataType.Date: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Time: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Double: - return (new JProperty(item.MixDatabaseColumnName, item.DoubleValue)); - - case MixDataType.Boolean: - return (new JProperty(item.MixDatabaseColumnName, item.BooleanValue)); - - case MixDataType.Integer: - return (new JProperty(item.MixDatabaseColumnName, item.IntegerValue)); - - case MixDataType.Reference: - //string url = $"/api/v1/odata/en-us/related-attribute-set-data/mobile/parent/set/{Id}/{item.Field.ReferenceId}"; - return (new JProperty(item.MixDatabaseColumnName, new JArray())); - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Upload: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - return (new JProperty(item.MixDatabaseColumnName, item.StringValue)); - } - } - - private void ParseModelValue(JToken property, Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.Field.DataType) - { - case MixDataType.DateTime: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Date: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Time: - item.DateTimeValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Double: - item.DoubleValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Boolean: - item.BooleanValue = property.Value(); - item.StringValue = property.Value().ToLower(); - break; - - case MixDataType.Integer: - item.IntegerValue = property.Value(); - item.StringValue = property.Value(); - break; - - case MixDataType.Reference: - item.StringValue = property.Value(); - break; - - case MixDataType.Upload: - string mediaData = property.Value(); - if (mediaData.IsBase64()) - { - Lib.ViewModels.MixMedias.UpdateViewModel media = new Lib.ViewModels.MixMedias.UpdateViewModel() - { - Specificulture = Specificulture, - Status = MixContentStatus.Published, - MediaFile = new FileViewModel() - { - FileStream = mediaData, - Extension = ".png", - Filename = Guid.NewGuid().ToString(), - FileFolder = "Attributes" - } - }; - var saveMedia = media.SaveModel(true); - if (saveMedia.IsSucceed) - { - item.StringValue = saveMedia.Data.FullPath; - Data[item.MixDatabaseColumnName] = item.StringValue; - } - } - else - { - item.StringValue = mediaData; - } - break; - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - item.StringValue = property.Value(); - break; - } - } - - public override async Task GenerateCache(MixDatabaseData model, FormViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - ParseData(); - await base.GenerateCache(model, view, _context, _transaction).ConfigureAwait(false); - } - - private void ParseData() - { - Data = new JObject(); - foreach (var item in Values.OrderBy(v => v.Priority)) - { - item.MixDatabaseColumnName = item.Field.Name; - Data.Add(ParseValue(item)); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/ReadViewModel.cs b/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/ReadViewModel.cs deleted file mode 100644 index 9b93e9725..000000000 --- a/src/Mix.Cms.Service.SignalR/ViewModels/MixAttributeSetDatas/ReadViewModel.cs +++ /dev/null @@ -1,198 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Service.SignalR.Models; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mix.Cms.Service.SignalR.ViewModels.MixDatabaseDatas -{ - public class ReadViewModel - : ViewModelBase - { - #region Properties - - #region Models - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("specificulture")] - public string Specificulture { get; set; } - - [JsonProperty("priority")] - public int Priority { get; set; } - - [JsonProperty("attributeSetId")] - public int MixDatabaseId { get; set; } - - [JsonProperty("attributeSetName")] - public string MixDatabaseName { get; set; } - - [JsonProperty("createdDateTime")] - public DateTime CreatedDateTime { get; set; } - - [JsonProperty("createdBy")] - public string CreatedBy { get; set; } - - [JsonProperty("status")] - public string Status { get; set; } - - #endregion Models - - #region Views - - [JsonProperty("data")] - public JObject Data { get; set; } - - [JsonProperty("connection")] - public MessengerConnection Connection { get; set; } - - [JsonProperty("relatedData")] - [JsonIgnore] - public List RelatedData { get; set; } = new List(); - - [JsonIgnore] - public List Values { get; set; } - - [JsonIgnore] - public List Fields { get; set; } - - [JsonIgnore] - public List RefData { get; set; } = new List(); - - #endregion Views - - #endregion Properties - - #region Contructors - - public ReadViewModel() : base() - { - } - - public ReadViewModel(MixDatabaseData model, MixCmsContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructors - - #region Overrides - - public override void ExpandView(MixCmsContext _context = null, IDbContextTransaction _transaction = null) - { - var getValues = Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel - .Repository.GetModelListBy(a => a.DataId == Id && a.Specificulture == Specificulture, _context, _transaction); - if (getValues.IsSucceed) - { - Values = getValues.Data.OrderBy(a => a.Priority).ToList(); - ParseValueData(_context, _transaction); - } - var getUser = ViewModels.MixMessengerUsers.DefaultViewModel.Repository.GetSingleModel(m => m.Id == CreatedBy); - if (getUser.IsSucceed) - { - Connection = new MessengerConnection() - { - Id = getUser.Data.Id, - Avatar = getUser.Data.Avatar, - Name = getUser.Data.Name - }; - } - } - - #endregion Overrides - - #region Expands - - private void ParseValueData(MixCmsContext _context, IDbContextTransaction _transaction) - { - Fields = Lib.ViewModels.MixDatabaseColumns.UpdateViewModel.Repository.GetModelListBy(f => f.MixDatabaseId == MixDatabaseId, _context, _transaction).Data; - foreach (var field in Fields.OrderBy(f => f.Priority)) - { - var val = Values.FirstOrDefault(v => v.MixDatabaseColumnId == field.Id); - if (val == null) - { - val = new Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel( - new MixDatabaseDataValue() - { - MixDatabaseColumnId = field.Id, - MixDatabaseColumnName = field.Name, - } - , _context, _transaction) - { - Priority = field.Priority - }; - Values.Add(val); - } - val.Priority = field.Priority; - val.MixDatabaseName = MixDatabaseName; - } - - ParseData(); - } - - private JProperty ParseValue(Lib.ViewModels.MixDatabaseDataValues.UpdateViewModel item) - { - switch (item.DataType) - { - case MixDataType.DateTime: - return new JProperty(item.MixDatabaseColumnName, item.DateTimeValue); - - case MixDataType.Date: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Time: - return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue)); - - case MixDataType.Double: - return (new JProperty(item.MixDatabaseColumnName, item.DoubleValue)); - - case MixDataType.Boolean: - return (new JProperty(item.MixDatabaseColumnName, item.BooleanValue)); - - case MixDataType.Integer: - return (new JProperty(item.MixDatabaseColumnName, item.IntegerValue)); - - case MixDataType.Reference: - //string url = $"/api/v1/odata/en-us/related-attribute-set-data/mobile/parent/set/{Id}/{item.Field.ReferenceId}"; - return (new JProperty(item.MixDatabaseColumnName, new JArray())); - - case MixDataType.Custom: - case MixDataType.Duration: - case MixDataType.PhoneNumber: - case MixDataType.Text: - case MixDataType.Html: - case MixDataType.MultilineText: - case MixDataType.EmailAddress: - case MixDataType.Password: - case MixDataType.Url: - case MixDataType.ImageUrl: - case MixDataType.CreditCard: - case MixDataType.PostalCode: - case MixDataType.Upload: - case MixDataType.Color: - case MixDataType.Icon: - case MixDataType.VideoYoutube: - case MixDataType.TuiEditor: - default: - return (new JProperty(item.MixDatabaseColumnName, item.StringValue)); - } - } - - private void ParseData() - { - Data = new JObject(); - foreach (var item in Values.OrderBy(v => v.Priority)) - { - item.MixDatabaseColumnName = item.Field.Name; - Data.Add(ParseValue(item)); - } - } - - #endregion Expands - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUserDevices/DefaultViewModel.cs b/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUserDevices/DefaultViewModel.cs deleted file mode 100644 index 8b4cbf157..000000000 --- a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUserDevices/DefaultViewModel.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Messenger.Models.Data; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Service.SignalR.ViewModels.MixMessengerUserDevices -{ - public class DefaultViewModel : ViewModelBase - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("userId")] - public string UserId { get; set; } - - [JsonProperty("connectionId")] - public string ConnectionId { get; set; } - - [JsonProperty("deviceId")] - public string DeviceId { get; set; } - - [JsonProperty("status")] - public Constants.Enums.DeviceStatus Status { get; set; } - - [JsonProperty("startDate")] - public DateTime StartDate { get; set; } - - [JsonProperty("endDate")] - public DateTime? EndDate { get; set; } - - #endregion Properties - - public DefaultViewModel() - { - } - - public DefaultViewModel(MixMessengerUserDevice model, MixChatServiceContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/ConnectViewModel.cs b/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/ConnectViewModel.cs deleted file mode 100644 index 33c0fa0d4..000000000 --- a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/ConnectViewModel.cs +++ /dev/null @@ -1,167 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Messenger.Models.Data; -using Mix.Cms.Service.SignalR.Models; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json; -using System; - -namespace Mix.Cms.Service.SignalR.ViewModels.MixMessengerUsers -{ - public class ConnectViewModel - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("avatar")] - public string Avatar { get; set; } - - [JsonProperty("device")] - public MixMessengerUserDevice Device { get; set; } - - [JsonProperty("createdDate")] - public DateTime CreatedDate { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("isJoin")] - public bool IsJoin { get; set; } - - #endregion Properties - - #region Contructor - - public ConnectViewModel(MessengerConnection connection) - { - Id = connection.Id; - Name = connection.Name; - Avatar = connection.Avatar; - Device = new MixMessengerUserDevice() - { - UserId = connection.Id, - ConnectionId = connection.ConnectionId, - DeviceId = connection.DeviceId, - }; - // TODO - verify cnn before add/update connections - } - - private bool CheckIsJoin() - { - var getUser = MixMessengerUsers.DefaultViewModel.Repository.GetSingleModel(u => u.Id == Id); - if (getUser.IsSucceed) - { - return getUser.Data.Status == Constants.Enums.OnlineStatus.Connected; - } - else - { - return false; - } - } - - #endregion Contructor - - #region Override - - #region Async - - // Cannot use asyn method for signalr hub - public RepositoryResponse Join(MixChatServiceContext _context = null, IDbContextTransaction _transaction = null) - { - var result = new RepositoryResponse() { IsSucceed = true }; - UnitOfWorkHelper.InitTransaction(_context, _transaction, out MixChatServiceContext context, out IDbContextTransaction transaction, out bool isRoot); - try - { - result = UpdateUser(context, transaction); - - if (result.IsSucceed) - { - result = UpdateDevice(context, transaction); - } - UnitOfWorkHelper.HandleTransaction(result.IsSucceed, isRoot, transaction); - return result; - } - catch (Exception ex) - { - return UnitOfWorkHelper.HandleException(ex, isRoot, transaction); - } - finally - { - if (isRoot) - { - //if current Context is Root - transaction.Dispose(); - UnitOfWorkHelper.CloseDbContext(ref context, ref transaction); - } - } - } - - private RepositoryResponse UpdateUser(MixChatServiceContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - // Load User from db - var getUser = MixMessengerUsers.DefaultViewModel.Repository.GetSingleModel(m => m.Id == Id, context, transaction); - if (getUser.IsSucceed) - { - // if existed => update status = connected - if (getUser.Data.Status == Constants.Enums.OnlineStatus.Disconnected) - { - getUser.Data.Status = Constants.Enums.OnlineStatus.Connected; - var saveUser = getUser.Data.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveUser, ref result); - } - } - else - { - // if not existed => add new with status = connected - var user = new MixMessengerUsers.DefaultViewModel() - { - Id = Id, - FacebookId = Id, - Avatar = Avatar, - CreatedDate = DateTime.UtcNow, - Name = Name, - Status = Constants.Enums.OnlineStatus.Connected - }; - var saveUser = user.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveUser, ref result); - } - return result; - } - - private RepositoryResponse UpdateDevice(MixChatServiceContext context, IDbContextTransaction transaction) - { - var result = new RepositoryResponse() { IsSucceed = true }; - if (Device != null) - { - var getDevice = MixMessengerUserDevices.DefaultViewModel.Repository.GetSingleModel(c => c.UserId == Device.UserId && c.DeviceId == Device.DeviceId, context, transaction); - if (getDevice.IsSucceed) - { - getDevice.Data.Status = Constants.Enums.DeviceStatus.Actived; - getDevice.Data.StartDate = DateTime.UtcNow; - getDevice.Data.ConnectionId = Device.ConnectionId; - var saveDevice = getDevice.Data.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveDevice, ref result); - } - else - { - Device.Status = (int)Constants.Enums.DeviceStatus.Actived; - Device.StartDate = DateTime.UtcNow; - var dv = new MixMessengerUserDevices.DefaultViewModel(Device, context, transaction); - var saveDevice = dv.SaveModel(false, context, transaction); - ViewModelHelper.HandleResult(saveDevice, ref result); - } - } - return result; - } - - #endregion Async - - #endregion Override - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/DefaultViewModel.cs b/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/DefaultViewModel.cs deleted file mode 100644 index ed3640e65..000000000 --- a/src/Mix.Cms.Service.SignalR/ViewModels/MixMessengerUsers/DefaultViewModel.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Cms.Messenger.Models.Data; -using Mix.Domain.Data.ViewModels; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Mix.Cms.Service.SignalR.ViewModels.MixMessengerUsers -{ - public class DefaultViewModel : ViewModelBase - { - #region Properties - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("facebookId")] - public string FacebookId { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("avatar")] - public string Avatar { get; set; } - - [JsonProperty("connections")] - private List Connections { get; set; } - - [JsonProperty("createdDate")] - public DateTime CreatedDate { get; set; } - - [JsonProperty("lastModified")] - public DateTime? LastModified { get; set; } - - [JsonProperty("status")] - public Constants.Enums.OnlineStatus Status { get; set; } - - #endregion Properties - - #region Contructor - - public DefaultViewModel() - { - } - - public DefaultViewModel(MixMessengerUser model, MixChatServiceContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction) - { - } - - #endregion Contructor - - #region Override - - #region Sync - - public override void ExpandView(MixChatServiceContext _context = null, IDbContextTransaction _transaction = null) - { - this.Connections = MixMessengerUserDevices.DefaultViewModel.Repository.GetModelListBy(m => m.UserId == this.Id).Data; - } - - #endregion Sync - - #endregion Override - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Service.SignalR/libman.json b/src/Mix.Cms.Service.SignalR/libman.json deleted file mode 100644 index be09e8d8d..000000000 --- a/src/Mix.Cms.Service.SignalR/libman.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0", - "defaultProvider": "unpkg", - "libraries": [ - { - "library": "@microsoft/signalr@3.1.2", - "destination": "lib/@microsoft/signalr/", - "files": [ - "dist/browser/signalr.min.js" - ] - } - ] -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/ApacheModRewrite.txt b/src/Mix.Cms.Web/ApacheModRewrite.txt deleted file mode 100644 index 8ad33f94a..000000000 --- a/src/Mix.Cms.Web/ApacheModRewrite.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Rewrite path with additional sub directory -# RewriteRule ^([a-z]{2}[-][a-z]{2})$ /$1/home [L,R=302] - -# ref https://aloneonahill.com/blog/url-rewriting-for-beginners -#RewriteRule ^(init|security|portal|api|page|post|module|error|swagger|graphql)(.*){0,}$ [NC,L] -#RewriteRule \.(xml|json|html|css|js|jpg|png|gif|jpeg|svg|map|ico|webmanifest|woff|woff2|ttf|eot)$ [NC,L] -RewriteRule ^admin(.*)$ backend/$1 -#RewriteRule ^(.*)$ /?alias=$1 -RewriteRule ^(.*)\.((vue)$) /vue$1 - -# RewriteRule ^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))/post(\/(.*)){1,8}$ undefined -# RewriteRule ^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))$ /$1/ -# RewriteRule ^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))\/\w$ /$1/alias?alias=$5 -# RewriteRule ^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))\/(.*)\/(\d+)\/(\d+)$ /$1/alias?alias=$5&pageSize=$6&pageIndex=$7 -# RewriteRule ^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))\/(.*)$ /$1/alias?alias=$5 \ No newline at end of file diff --git a/src/Mix.Cms.Web/App_Start/Startup.Auth.cs b/src/Mix.Cms.Web/App_Start/Startup.Auth.cs deleted file mode 100644 index b0d6d3340..000000000 --- a/src/Mix.Cms.Web/App_Start/Startup.Auth.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Licensed to the mixcore Foundation under one or more agreements. -// The mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.IdentityModel.Tokens; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Services; -using Mix.Identity.Models; -using System; -using System.Text; - -namespace Mix.Cms.Web -{ - //Ref: https://www.blinkingcaret.com/2017/09/06/secure-web-api-in-asp-net-core/ - public static class AuthServiceCollectionExtensions - { - public static IServiceCollection AddMixAuthorize(this IServiceCollection services, IConfiguration Configuration) - { - PasswordOptions pOpt = new PasswordOptions() - { - RequireDigit = false, - RequiredLength = 6, - RequireLowercase = false, - RequireNonAlphanumeric = false, - RequireUppercase = false - }; - - services.AddIdentity(options => - { - options.Password = pOpt; - }) - .AddEntityFrameworkStores() - .AddDefaultTokenProviders() - .AddUserManager>() - - ; - - services.AddAuthorization(); - - services.AddAuthentication("Bearer") - .AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options => - { - options.RequireHttpsMetadata = false; - options.SaveToken = true; - options.TokenValidationParameters = - new TokenValidationParameters - { - ClockSkew = TimeSpan.Zero,//.FromMinutes(MixService.GetAuthConfig("ClockSkew")), //x minute tolerance for the expiration date - ValidateIssuer = MixService.GetAuthConfig("ValidateIssuer"), - ValidateAudience = MixService.GetAuthConfig("ValidateAudience"), - ValidateLifetime = MixService.GetAuthConfig("ValidateLifetime"), - ValidateIssuerSigningKey = MixService.GetAuthConfig("ValidateIssuerSigningKey"), - //ValidIssuer = MixService.GetAuthConfig("Issuer"), - //ValidAudience = MixService.GetAuthConfig("Audience"), - ValidIssuers = MixService.GetAuthConfig("Issuers").Split(','), - ValidAudiences = MixService.GetAuthConfig("Audiences").Split(','), - IssuerSigningKey = JwtSecurityKey.Create(MixService.GetAuthConfig("SecretKey")) - }; - // TODO Handle Custom Auth - //options.Events = new JwtBearerEvents - //{ - // OnAuthenticationFailed = context => - // { - // Console.WriteLine("OnAuthenticationFailed: " + context.Exception.Message); - // return Task.CompletedTask; - // }, - // OnTokenValidated = context => - // { - // Console.WriteLine("OnTokenValidated: " + context.SecurityToken); - // return Task.CompletedTask; - // }, - - //}; - }); - services.ConfigureApplicationCookie(options => - { - options.Cookie.HttpOnly = true; - options.Cookie.MaxAge = TimeSpan.FromMinutes(MixService.GetAuthConfig("CookieExpiration")); - options.ExpireTimeSpan = TimeSpan.FromMinutes(MixService.GetAuthConfig("CookieExpiration")); - //options.Cookie.Expiration = TimeSpan.FromMinutes(MixService.GetAuthConfig("CookieExpiration")); - options.LoginPath = "/security/login"; // If the LoginPath is not set here, ASP.NET Core will default to /Account/Login - options.LogoutPath = "/"; // If the LogoutPath is not set here, ASP.NET Core will default to /Account/Logout - options.AccessDeniedPath = "/security/login"; // If the MixConstants.Default.DefaultCulture is not set here, ASP.NET Core will default to /Account/AccessDenied - options.SlidingExpiration = true; - }); - return services; - } - - public static IApplicationBuilder UseMixAuthorize(this IApplicationBuilder app) - { - return app; - } - - protected static class JwtSecurityKey - { - public static SymmetricSecurityKey Create(string secret) - { - return new SymmetricSecurityKey(Encoding.ASCII.GetBytes(secret)); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/App_Start/Startup.Route.cs b/src/Mix.Cms.Web/App_Start/Startup.Route.cs deleted file mode 100644 index 0fe82ff75..000000000 --- a/src/Mix.Cms.Web/App_Start/Startup.Route.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the mixcore Foundation under one or more agreements. -// The mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Rewrite; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using RewriteRules; -using System.IO; - -namespace Mix.Cms.Web -{ - public static class MixRoutesServiceCollectionExtensions - { - public static IApplicationBuilder UseMixRoutes(this IApplicationBuilder app) - { - if (MixService.GetConfig("IsRewrite")) - { - using (StreamReader apacheModRewriteStreamReader = - File.OpenText("ApacheModRewrite.txt")) - using (StreamReader iisUrlRewriteStreamReader = - File.OpenText("IISUrlRewrite.xml")) - { - var options = new RewriteOptions() - .AddApacheModRewrite(apacheModRewriteStreamReader) - .AddIISUrlRewrite(iisUrlRewriteStreamReader) - .Add(MethodRules.RedirectXMLRequests); - //.Add(new RedirectImageRequests(".png", "/png-images")) - //.Add(new RedirectImageRequests(".jpg", "/jpg-images")); - - app.UseRewriter(options); - } - // app.Run(context => context.Response.WriteAsync( - //$"Rewritten or Redirected Url: " + - //$"{context.Request.Path + context.Request.QueryString}")); - } - app.UseEndpoints(routes => - { - routes.MapControllerRoute( - name: "default", - pattern: "{controller=Home}/{alias}"); - routes.MapControllerRoute( - name: "page", - pattern: "{controller=Page}/{culture=" + MixService.GetConfig(MixAppSettingKeywords.DefaultCulture) + "}/{seoName}"); routes.MapControllerRoute( - name: "vue", - pattern: "{controller=Vue}/{culture=" + MixService.GetConfig(MixAppSettingKeywords.DefaultCulture) + "}/{seoName}"); - routes.MapControllerRoute( - name: "file", - pattern: "{culture=" + MixService.GetConfig(MixAppSettingKeywords.DefaultCulture) + "}/portal/file"); - routes.MapControllerRoute( - name: "post", - pattern: "{culture=" + MixService.GetConfig(MixAppSettingKeywords.DefaultCulture) + "}/post/{id}/{seoName}"); - }); - return app; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/App_Start/Startup.SignalR.cs b/src/Mix.Cms.Web/App_Start/Startup.SignalR.cs deleted file mode 100644 index a85579a3e..000000000 --- a/src/Mix.Cms.Web/App_Start/Startup.SignalR.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the mixcore Foundation under one or more agreements. -// The mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -//using Messenger.Lib.SignalR.Hubs; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; - -namespace Mix.Cms.Web -{ - public partial class Startup - { - public void ConfigureSignalRServices(IServiceCollection services) - { - //services.BuildServiceProvider(); - //services.AddSignalR(); - } - - public void ConfigurationSignalR(IApplicationBuilder app) - { - //app.UseSignalR(routes => routes.MapHub("Messenger")); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/App_Start/Validattors/CookieValidator.cs b/src/Mix.Cms.Web/App_Start/Validattors/CookieValidator.cs deleted file mode 100644 index bcc7785f1..000000000 --- a/src/Mix.Cms.Web/App_Start/Validattors/CookieValidator.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.AspNetCore.Authentication.Cookies; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Mvc.App_Start.Validattors -{ - public class CookieValidator - { - public static async Task ValidateAsync(CookieValidatePrincipalContext context) - { - // Do sth before process request with current principal - // context.RejectPrincipal(); - await Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/App_Start/Validattors/JwtValidator.cs b/src/Mix.Cms.Web/App_Start/Validattors/JwtValidator.cs deleted file mode 100644 index fd4765b6a..000000000 --- a/src/Mix.Cms.Web/App_Start/Validattors/JwtValidator.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.AspNetCore.Authentication.JwtBearer; -using System; - -namespace Mix.Cms.Web.Mvc.App_Start.Validattors -{ - public class JwtValidator - { - public static void ValidateAsync(TokenValidatedContext context) - { - // Do sth before process request with current principal - // context.RejectPrincipal(); - Console.WriteLine("OnTokenValidated: " + context.SecurityToken); - } - - public static void ValidateFail(AuthenticationFailedContext context) - { - // Do sth when validate failed request with current principal - // context.RejectPrincipal(); - Console.WriteLine("OnAuthenticationFailed: " + context.Exception.Message); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/BaseController.cs b/src/Mix.Cms.Web/Controllers/BaseController.cs deleted file mode 100644 index f81927309..000000000 --- a/src/Mix.Cms.Web/Controllers/BaseController.cs +++ /dev/null @@ -1,398 +0,0 @@ -using AutoMapper.Configuration; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Mvc.Rendering; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Enums; -using Mix.Cms.Lib.Helpers; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Domain.Core.ViewModels; -using Newtonsoft.Json.Linq; -using System; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - public class BaseController : Controller - { - protected string domain; - protected bool forbidden = false; - protected bool isValid = true; - protected string _redirectUrl; - - protected bool _forbiddenPortal - { - get - { - var allowedIps = MixService.GetIpConfig("AllowedPortalIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - return forbidden || ( - // add in allowedIps "::1" to allow localhost - allowedIps.Count > 0 && - !allowedIps.Any(t => t["text"].Value() == remoteIp) - ); - } - } - - protected IConfiguration _configuration; - - public BaseController() - { - if (!MixService.GetConfig("IsInit")) - { - LoadCulture(); - } - } - - private void LoadCulture() - { - if (RouteData?.Values["culture"]?.ToString().ToLower() is not null) - { - culture = RouteData?.Values["culture"]?.ToString().ToLower(); - } - if (!MixService.Instance.CheckValidCulture(culture)) - { - culture = MixService.GetConfig(MixAppSettingKeywords.DefaultCulture); - } - - // Set CultureInfo - var cultureInfo = new CultureInfo(culture); - CultureInfo.DefaultThreadCurrentCulture = cultureInfo; - CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; - } - - public ViewContext ViewContext { get; set; } - private string _culture; - - public string culture - { - get - { - return _culture; - } - set { _culture = value; } - } - - public override void OnActionExecuting(ActionExecutingContext context) - { - ValidateRequest(); - - ViewBag.culture = culture; - if (!string.IsNullOrEmpty(culture)) - { - ViewBag.assetFolder = MixCmsHelper.GetAssetFolder(culture); - } - domain = string.Format("{0}://{1}", Request.Scheme, Request.Host); - if (MixService.GetIpConfig("IsRetrictIp")) - { - var allowedIps = MixService.GetIpConfig("AllowedIps") ?? new JArray(); - var exceptIps = MixService.GetIpConfig("ExceptIps") ?? new JArray(); - string remoteIp = Request.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if ( - // To allow localhost remove below comment - //remoteIp != "::1" && - allowedIps.Count > 0 && - !allowedIps.Any(t => t["text"].Value() == remoteIp) || - ( - exceptIps.Count > 0 && - exceptIps.Any(t => t["text"].Value() == remoteIp) - ) - ) - { - forbidden = true; - } - } - } - - protected virtual void ValidateRequest() - { - // If IP retricted in appsettings - if (forbidden) - { - isValid = false; - _redirectUrl = $"/403"; - } - - // If mode Maintenance enabled in appsettings - if (MixService.GetConfig("IsMaintenance") && Request.RouteValues["seoName"].ToString() != "maintenance") - { - isValid = false; - _redirectUrl = $"/maintenance"; - } - } - - #region Helper - - protected async Task AliasAsync(string seoName) - { - // Home Page - - // If page name is null => return home page - if (string.IsNullOrEmpty(seoName)) - { - return await Page(seoName); - } - else - { - RepositoryResponse getAlias = null; - - Expression> predicate; - - predicate = p => - p.Alias == seoName - && p.Status == MixContentStatus.Published && p.Specificulture == culture; - - getAlias = await Lib.ViewModels.MixUrlAliases.UpdateViewModel.Repository.GetFirstModelAsync(predicate); - if (getAlias.IsSucceed)// && getPage.Data.View != null - { - switch (getAlias.Data.Type) - { - case MixUrlAliasType.Page: - return await Page(int.Parse(getAlias.Data.SourceId)); - - case MixUrlAliasType.Post: - return await Post(int.Parse(getAlias.Data.SourceId)); - - case MixUrlAliasType.Module: // TODO: Create view for module - case MixUrlAliasType.ModuleData: // TODO: Create view for module data - default: - return await Page(0); - } - } - else - { - return await Page(seoName); - } - } - } - - protected async System.Threading.Tasks.Task Page(string seoName, string keyword = null) - { - // Home Page - int maxPageSize = MixService.GetConfig("MaxPageSize"); - string orderBy = MixService.GetConfig("OrderBy"); - int orderDirection = MixService.GetConfig("OrderDirection"); - int.TryParse(Request.Query["page"], out int page); - int.TryParse(Request.Query["pageSize"], out int pageSize); - if (keyword is not null) - { - ViewData["keyword"] = keyword; - } - RepositoryResponse getPage = null; - Expression> predicate; - - if (string.IsNullOrEmpty(seoName)) - { - predicate = p => - p.Type == MixPageType.Home - && p.Status == MixContentStatus.Published && p.Specificulture == culture; - } - else - { - predicate = p => - p.SeoName == seoName - && p.Status == MixContentStatus.Published && p.Specificulture == culture; - } - - getPage = await Lib.ViewModels.MixPages.ReadMvcViewModel.Repository.GetFirstModelAsync(predicate); - - if (getPage.IsSucceed) - { - if (getPage.Data != null) - { - maxPageSize = getPage.Data.PageSize.HasValue ? getPage.Data.PageSize.Value : maxPageSize; - pageSize = (pageSize > 0 && pageSize < maxPageSize) ? pageSize : maxPageSize; - getPage.Data.LoadData(pageSize: pageSize, pageIndex: page - 1); - } - GeneratePageDetailsUrls(getPage.Data); - } - - if (getPage.IsSucceed) - { - ViewData["Title"] = getPage.Data.SeoTitle; - ViewData["Description"] = getPage.Data.SeoDescription; - ViewData["Keywords"] = getPage.Data.SeoKeywords; - ViewData["Image"] = getPage.Data.ImageUrl; - ViewData["BodyClass"] = getPage.Data.CssClass; - ViewData["ViewMode"] = MixMvcViewMode.Page; - getPage.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return View(getPage.Data); - } - else - { - if (seoName != "404") - { - return Redirect($"/{culture}/404"); - } - else - { - return NotFound(); - } - } - } - - protected async System.Threading.Tasks.Task Page(int pageId) - { - // Home Page - int? pageSize = MixService.GetConfig("TagPageSize"); - string orderBy = MixService.GetConfig("OrderBy"); - int orderDirection = MixService.GetConfig("OrderDirection"); - int.TryParse(Request.Query["page"], out int page); - RepositoryResponse getPage = null; - - Expression> predicate; - - predicate = p => - p.Id == pageId - && p.Status == MixContentStatus.Published && p.Specificulture == culture; - - getPage = await Lib.ViewModels.MixPages.ReadMvcViewModel.Repository.GetFirstModelAsync(predicate); - if (getPage.IsSucceed) - { - getPage.Data.LoadData(pageIndex: page - 1, pageSize: pageSize); - GeneratePageDetailsUrls(getPage.Data); - } - - if (getPage.IsSucceed) - { - ViewData["Title"] = getPage.Data.SeoTitle; - ViewData["Description"] = getPage.Data.SeoDescription; - ViewData["Keywords"] = getPage.Data.SeoKeywords; - ViewData["Image"] = getPage.Data.ImageUrl; - ViewData["Layout"] = getPage.Data.Layout ?? "Masters/_Layout"; - ViewData["BodyClass"] = getPage.Data.CssClass; - ViewData["ViewMode"] = MixMvcViewMode.Page; - - ViewBag.viewMode = MixMvcViewMode.Page; - getPage.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return View(getPage.Data); - } - else - { - return Redirect($"/{culture}/404"); - } - } - - protected async System.Threading.Tasks.Task Post(int id) - { - Expression> predicate; - predicate = p => - p.Id == id - && p.Status == MixContentStatus.Published - && p.Specificulture == culture; - - RepositoryResponse getPost = - await Lib.ViewModels.MixPosts.ReadMvcViewModel.Repository.GetFirstModelAsync(predicate); - - if (getPost.IsSucceed) - { - ViewData["Title"] = getPost.Data.SeoTitle; - ViewData["Description"] = getPost.Data.SeoDescription; - ViewData["Keywords"] = getPost.Data.SeoKeywords; - ViewData["Image"] = getPost.Data.ImageUrl; - ViewData["BodyClass"] = getPost.Data.BodyClass; - ViewData["ViewMode"] = MixMvcViewMode.Post; - - ViewBag.viewMode = MixMvcViewMode.Post; - getPost.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return View(getPost.Data); - } - else - { - return Redirect($"/{culture}/404"); - } - } - - protected async System.Threading.Tasks.Task Data(string attributeSetName, string seoName) - { - var getData = await Lib.ViewModels.MixDatabaseDatas.Helper.FilterByKeywordAsync( - culture, attributeSetName, "equal", "seo_url", seoName); - - if (getData.IsSucceed && getData.Data.Count > 0) - { - getData.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return View(getData.Data.FirstOrDefault()); - } - else - { - return Redirect($"/{culture}/404"); - } - } - - protected async System.Threading.Tasks.Task Module(int id) - { - // Home Page - int? pageSize = MixService.GetConfig("TagPageSize"); - string orderBy = MixService.GetConfig("OrderBy"); - int orderDirection = MixService.GetConfig("OrderDirection"); - int.TryParse(Request.Query["page"], out int page); - RepositoryResponse getData = null; - - Expression> predicate; - - predicate = p => - p.Id == id - && p.Status == MixContentStatus.Published && p.Specificulture == culture; - - getData = await Lib.ViewModels.MixModules.ReadMvcViewModel.Repository.GetFirstModelAsync(predicate); - if (getData.IsSucceed) - { - getData.Data.LoadData(pageIndex: page - 1, pageSize: pageSize); - getData.Data.DetailsUrl = GenerateDetailsUrl( - new { culture = culture, seoName = getData.Data.Name } - ); - GenerateDetailsUrls(getData.Data); - //_ = MixCacheService.SetAsync(cacheKey, getPage); - } - - if (getData.IsSucceed) - { - ViewData["Title"] = getData.Data.Title; - ViewData["Description"] = getData.Data.Description; - ViewData["Keywords"] = getData.Data.Title; - ViewData["Image"] = getData.Data.ImageUrl; - getData.LastUpdateConfiguration = MixService.GetConfig("LastUpdateConfiguration"); - return View(getData.Data); - } - else - { - return Redirect($"/{culture}/404"); - } - } - - protected void GeneratePageDetailsUrls(Lib.ViewModels.MixPages.ReadMvcViewModel page) - { - if (page.Modules != null) - { - foreach (var nav in page.Modules) - { - GenerateDetailsUrls(nav.Module); - } - } - } - - protected void GenerateDetailsUrls(Lib.ViewModels.MixModules.ReadMvcViewModel module) - { - module.DetailsUrl = GenerateDetailsUrl( - new { action = "module", culture = culture, id = module.Id, seoName = module.Name } - ); - } - - protected string GenerateDetailsUrl(object routeValues) - { - return MixCmsHelper.GetRouterUrl(routeValues, Request, Url); - } - - public async System.Threading.Tasks.Task Error(string page = "404") - { - return await Page(page); - } - - #endregion Helper - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/DataController.cs b/src/Mix.Cms.Web/Controllers/DataController.cs deleted file mode 100644 index 83bfda8da..000000000 --- a/src/Mix.Cms.Web/Controllers/DataController.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class DataController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [Route("data/{attributeSetName}/{seoName}")] - [Route("data/{culture}/{attributeSetName}/{seoName}")] - public async Task Index(string attributeSetName, string seoName) - { - if (isValid) - { - return await Data(attributeSetName, seoName); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/HomeController.cs b/src/Mix.Cms.Web/Controllers/HomeController.cs deleted file mode 100644 index 03f37aded..000000000 --- a/src/Mix.Cms.Web/Controllers/HomeController.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Services; -using Mix.Services; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class HomeController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [HttpGet] - [Route("")] - [Route("{seoName}")] - [Route("{seoName}/{keyword}")] - [Route("{culture}/{seoName}/{keyword}")] - public async Task Index(string seoName, string keyword) - { - if (isValid) - { - seoName = seoName ?? Request.Query["alias"]; - if (!string.IsNullOrEmpty(seoName)) - { - if (CheckIsVueRoute(seoName)) - { - var staticFile = MixFileRepository.Instance.GetFile(seoName, MixFolders.WebRootPath); - if (staticFile != null) - { - return Ok(staticFile.Content); - } - else - { - var getModule = await Mix.Cms.Lib.ViewModels.MixModules.ReadMvcViewModel.Repository.GetSingleModelAsync( - m => m.Name == seoName && m.Specificulture == culture); - if (getModule.IsSucceed) - { - var myViewData = new ViewDataDictionary(new Microsoft.AspNetCore.Mvc.ModelBinding.EmptyModelMetadataProvider(), - new Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary()) { { "ModuleViewModel", - getModule.Data} }; - myViewData.Model = getModule.Data; - - PartialViewResult result = new PartialViewResult() - { - ViewName = "VueComponent", - ViewData = myViewData, - }; - - return result; - } - else - { - return NotFound(); - } - } - } - else - { - HandleSeoName(ref seoName, ref keyword); - } - } - ViewData["Layout"] = "Masters/_Layout"; - ViewData["keyword"] = keyword; - return await AliasAsync(seoName); - } - else - { - return Redirect(_redirectUrl); - } - } - - private void HandleSeoName(ref string seoName, ref string keyword) - { - // Check url is end with '/' or '?' - // Ex: en-us/page-name/ => seoName = en-us/page-name - string regex = @"(.*)[(\/|\?|#)]$"; - System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(regex, RegexOptions.IgnoreCase); - Match m = r.Match(seoName); - if (m.Success) - { - seoName = m.Groups[1].Value; - } - - // Check first group is culture - // Ex: en-us/page-name => culture = en-us , seoName = page-name - regex = @"^([A-Za-z]{1,8}|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})|[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})(-[A-Za-z0-9]{1,8}))\/(.*)$"; - r = new System.Text.RegularExpressions.Regex(regex, RegexOptions.IgnoreCase); - m = r.Match(seoName); - if (m.Success) - { - if (MixService.Instance.CheckValidCulture(m.Groups[1].Value)) - { - culture = m.Groups[1].Value; - seoName = m.Groups[5].Value; - } - } - - if (MixService.Instance.CheckValidCulture(seoName)) - { - culture = seoName; - seoName = keyword; - keyword = string.Empty; - } - } - - protected bool CheckIsVueRoute(string seoName) - { - // Check if seoname is vue route - var regex = @"^(.*)\.((vue)$)"; - var r = new System.Text.RegularExpressions.Regex(regex, RegexOptions.IgnoreCase); - var m = r.Match(seoName); - return m.Success; - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/InitController.cs b/src/Mix.Cms.Web/Controllers/InitController.cs deleted file mode 100644 index 2ed8d0a7d..000000000 --- a/src/Mix.Cms.Web/Controllers/InitController.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class InitController : BaseController - { - [HttpGet] - [Route("init")] - [Route("init/{page}")] - public IActionResult Index(string page) - { - if (!MixService.GetConfig("IsInit")) - { - return Redirect("/"); - } - else - { - page = page ?? ""; - var initStatus = MixService.GetConfig("InitStatus"); - switch (initStatus) - { - case 0: - if (page.ToLower() != "") - { - return Redirect($"/init"); - } - break; - - case 1: - if (page.ToLower() != "step2") - { - return Redirect($"/init/step2"); - } - break; - - case 2: - if (page.ToLower() != "step3") - { - return Redirect($"/init/step3"); - } - break; - - case 3: - if (page.ToLower() != "step4") - { - return Redirect($"/init/step4"); - } - break; - - case 4: - if (page.ToLower() != "step5") - { - return Redirect($"/init/step5"); - } - break; - } - return View(); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/ModuleController.cs b/src/Mix.Cms.Web/Controllers/ModuleController.cs deleted file mode 100644 index a69f68f6c..000000000 --- a/src/Mix.Cms.Web/Controllers/ModuleController.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class ModuleController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [Route("module/{id}/{seoName}")] - [Route("{culture}/module/{id}/{seoName}")] - public async Task Index(int id, string culture, string seoName) - { - if (isValid) - { - return await Module(id); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/PageController.cs b/src/Mix.Cms.Web/Controllers/PageController.cs deleted file mode 100644 index de94edc82..000000000 --- a/src/Mix.Cms.Web/Controllers/PageController.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class PageController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [Route("page/{seoName}")] - [Route("page/{seoName}/{keyword}")] - [Route("{culture}/page/{seoName}")] - [Route("{culture}/page/{seoName}/{keyword}")] - public async Task Index(string culture, string seoName, string keyword) - { - if (isValid) - { - return await Page(seoName, keyword); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/PortalController.cs b/src/Mix.Cms.Web/Controllers/PortalController.cs deleted file mode 100644 index 1c6bcfeeb..000000000 --- a/src/Mix.Cms.Web/Controllers/PortalController.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class PortalController : BaseController - { - #region overrides - - protected override void ValidateRequest() - { - // If IP retricted in appsettings - if (_forbiddenPortal) - { - isValid = false; - _redirectUrl = $"/error/403"; - } - - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion overrides - - #region Routes - - [HttpGet] - [Authorize] - [Route("portal")] - [Route("admin")] - [Route("portal/page/{type}")] - [Route("portal/post/{type}")] - [Route("portal/{pageName}")] - [Route("portal/{pageName}/{type}")] - [Route("portal/{pageName}/{type}/{param}")] - [Route("portal/{pageName}/{type}/{param}/{param1}")] - [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}")] - [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}/{param3}")] - [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}/{param3}/{param4}")] - public IActionResult Index(string page) - { - if (isValid) - { - return View(); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/PostController.cs b/src/Mix.Cms.Web/Controllers/PostController.cs deleted file mode 100644 index afd9ea280..000000000 --- a/src/Mix.Cms.Web/Controllers/PostController.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class PostController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [Route("post/{id}")] - [Route("post/{id}/{seoName}")] - [Route("{culture}/post/{id}")] - [Route("{culture}/post/{id}/{seoName}")] - public async Task Index(int id, string culture, string seoName) - { - if (isValid) - { - return await Post(id); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/SecurityController.cs b/src/Mix.Cms.Web/Controllers/SecurityController.cs deleted file mode 100644 index ad2fb7b3d..000000000 --- a/src/Mix.Cms.Web/Controllers/SecurityController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class SecurityController : BaseController - { - #region overrides - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion overrides - - #region Routes - - [HttpGet] - [Route("security/{page}")] - public IActionResult Index(string page) - { - if (isValid) - { - return View(); - } - else - { - return Redirect(_redirectUrl); - } - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Controllers/VueController.cs b/src/Mix.Cms.Web/Controllers/VueController.cs deleted file mode 100644 index 1fe52eea4..000000000 --- a/src/Mix.Cms.Web/Controllers/VueController.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using Mix.Cms.Lib; -using Mix.Cms.Lib.Services; -using System.Threading.Tasks; - -namespace Mix.Cms.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class VueController : BaseController - { - #region contructor - - protected override void ValidateRequest() - { - base.ValidateRequest(); - - // If this site has not been inited yet - if (MixService.GetConfig("IsInit")) - { - isValid = false; - if (string.IsNullOrEmpty(MixService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) - { - _redirectUrl = $"Init"; - } - else - { - var status = MixService.GetConfig("InitStatus"); - _redirectUrl = $"/init/step{status}"; - } - } - } - - #endregion contructor - - #region Routes - - [Route("vue/{seoName}")] - [Route("vue/{culture}/{seoName}")] - public async Task Index(string culture, string seoName) - { - var getModule = await Mix.Cms.Lib.ViewModels.MixModules.ReadMvcViewModel.Repository.GetSingleModelAsync( - m => m.Name == seoName && m.Specificulture == culture); - if (getModule.IsSucceed) - { - var myViewData = new ViewDataDictionary(new Microsoft.AspNetCore.Mvc.ModelBinding.EmptyModelMetadataProvider(), - new Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary()) { { "ModuleViewModel", - getModule.Data} }; - myViewData.Model = getModule.Data; - - PartialViewResult result = new PartialViewResult() - { - ViewName = "VueComponent", - ViewData = myViewData, - }; - - return result; - } - return null; - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/IISUrlRewrite.xml b/src/Mix.Cms.Web/IISUrlRewrite.xml deleted file mode 100644 index 850adc97b..000000000 --- a/src/Mix.Cms.Web/IISUrlRewrite.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/MixContent/data/attribute_sets.json b/src/Mix.Cms.Web/MixContent/data/attribute_sets.json deleted file mode 100644 index ec9881c5b..000000000 --- a/src/Mix.Cms.Web/MixContent/data/attribute_sets.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "data": [ - { - "id": 1, - "type": 0, - "title": "Menu Item", - "name": "sys_menu_item", - "description": null, - "formTemplate": null, - "edmTemplate": null, - "edmSubject": null, - "edmFrom": null, - "edmAutoSend": null, - "createdDateTime": "2019-12-05T05:54:56.813", - "status": "Published", - "fields": [ - { - "id": 1, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Title", - "dataType": 7, - "defaultValue": null, - "options": null, - "name": "title", - "isRequire": true, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-02T04:54:35.07", - "isClone": false, - "cultures": null, - "priority": 0, - "specificulture": null - }, - { - "id": 3, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Uri", - "dataType": 7, - "defaultValue": null, - "options": null, - "name": "uri", - "isRequire": true, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-02T04:54:35.07", - "isClone": false, - "cultures": null, - "priority": 0, - "specificulture": null - }, - { - "id": 27, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Icon", - "dataType": 19, - "defaultValue": null, - "options": [], - "name": "icon", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-12-21T08:18:12.13", - "isClone": false, - "cultures": null, - "priority": 2, - "specificulture": null - }, - { - "id": 13, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Type", - "dataType": 7, - "defaultValue": "Uri", - "options": [ - { - "value": "Uri", - "dataType": 7 - }, - { - "value": "Page", - "dataType": 7 - }, - { - "value": "Post", - "dataType": 7 - } - ], - "name": "type", - "isRequire": false, - "isEncrypt": false, - "isSelect": true, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-09T05:56:45.447", - "isClone": false, - "cultures": null, - "priority": 3, - "specificulture": null - }, - { - "id": 10, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Target", - "dataType": 7, - "defaultValue": "_top", - "options": [ - { - "value": "_blank", - "dataType": 7 - }, - { - "value": "_self", - "dataType": 7 - }, - { - "value": "_parent", - "dataType": 7 - }, - { - "value": "_top", - "dataType": 7 - }, - { - "value": "framename", - "dataType": 7 - } - ], - "name": "target", - "isRequire": false, - "isEncrypt": false, - "isSelect": true, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-09T04:59:07.743", - "isClone": false, - "cultures": null, - "priority": 4, - "specificulture": null - }, - { - "id": 11, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "classes", - "dataType": 7, - "defaultValue": null, - "options": null, - "name": "classes", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-09T04:59:07.793", - "isClone": false, - "cultures": null, - "priority": 5, - "specificulture": null - }, - { - "id": 12, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": null, - "regex": null, - "title": "Description", - "dataType": 9, - "defaultValue": null, - "options": null, - "name": "description", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-11-09T04:59:07.83", - "isClone": false, - "cultures": null, - "priority": 6, - "specificulture": null - }, - { - "id": 24, - "attributeSetId": 1, - "attributeSetName": "sys_menu_item", - "referenceId": 1, - "regex": null, - "title": "Menu Items", - "dataType": 23, - "defaultValue": null, - "options": null, - "name": "menu_items", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-12-17T13:29:02.05", - "isClone": false, - "cultures": null, - "priority": 7, - "specificulture": null - } - ] - }, - { - "id": 2, - "title": "Navigation", - "name": "sys_navigation", - "fields": [ - { - "attributeSetId": 2, - "attributeSetName": "sys_navigation", - "title": "Title", - "dataType": 7, - "name": "title", - "options": [], - "isRequire": true, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "priority": 1, - "status": "Published" - }, - { - "id": 23, - "attributesetId": 2, - "attributeSetName": "sys_navigation", - "referenceId": null, - "regex": null, - "title": "Name", - "dataType": 7, - "defaultValue": null, - "name": "name", - "isRequire": true, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published", - "createdDateTime": "2019-12-17T13:19:42.663", - "isClone": false, - "cultures": null, - "priority": 2, - "specificulture": null - }, - { - "attributeSetId": 2, - "attributeSetName": "sys_navigation", - "title": "Menu Items", - "dataType": 23, - "name": "menu_items", - "options": [], - "referenceId": 1, - "priority": 3, - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "status": "Published" - } - ], - "status": "Published" - }, - { - "id": 3, - "title": "Page", - "name": "sys_additional_field_page", - "fields": [] - }, - { - "id": 4, - "title": "Module", - "name": "sys_additional_field_module", - "fields": [] - }, - { - "id": 5, - "title": "Post", - "name": "sys_additional_field_post", - "fields": [] - }, - { - "id": 6, - "title": "Additional Field", - "name": "sys_additional_field", - "fields": [] - }, - { - "id": 7, - "ReferenceId": null, - "type": "System", - "title": "Post Type", - "name": "sys_post_type", - "description": null, - "formTemplate": "Widgets/Comments.cshtml", - "edmTemplate": "Widgets/Comments.cshtml", - "edmSubject": null, - "edmFrom": null, - "edmAutoSend": null, - "createdBy": null, - "createdDateTime": "2020-09-26T10:18:22", - "modifiedBy": null, - "lastModified": "2020-09-26T10:19:31", - "priority": 0, - "status": "Published", - "specificulture": null, - "fields": [ - { - "id": 60, - "specificulture": null, - "attributeSetId": 15, - "attributeSetName": "post_type", - "referenceId": null, - "regex": null, - "isRegex": false, - "title": "Title", - "dataType": "Text", - "defaultValue": null, - "strOptions": "[]", - "options": [], - "name": "title", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "isMultiple": false, - "createdBy": null, - "createdDateTime": "2020-09-26T10:18:22", - "modifiedBy": null, - "lastModified": null, - "priority": 1, - "status": "Published" - }, - { - "id": 61, - "specificulture": null, - "attributeSetId": 15, - "attributeSetName": "post_type", - "referenceId": null, - "regex": null, - "isRegex": false, - "title": "Attribute Set Name", - "dataType": "Text", - "defaultValue": null, - "strOptions": "[]", - "options": [], - "name": "attribute_set_name", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "isMultiple": false, - "createdBy": null, - "createdDateTime": "2020-09-26T10:18:22", - "modifiedBy": null, - "lastModified": null, - "priority": 2, - "status": "Published" - }, - { - "id": 62, - "specificulture": null, - "attributeSetId": 15, - "attributeSetName": "post_type", - "referenceId": null, - "regex": null, - "isRegex": false, - "title": "Icon", - "dataType": "Icon", - "defaultValue": null, - "strOptions": "[]", - "options": [], - "name": "icon", - "isRequire": false, - "isEncrypt": false, - "isSelect": false, - "isUnique": false, - "isMultiple": false, - "createdBy": null, - "createdDateTime": "2020-09-26T10:19:32", - "modifiedBy": null, - "lastModified": null, - "priority": 3, - "status": "Published" - } - ], - "removeAttributes": [], - "formView": null, - "edmView": null - } - ] -} diff --git a/src/Mix.Cms.Web/MixContent/data/configurations.json b/src/Mix.Cms.Web/MixContent/data/configurations.json deleted file mode 100644 index 427281961..000000000 --- a/src/Mix.Cms.Web/MixContent/data/configurations.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "data": [ - { - "keyword": "SiteName", - "scope": "Site", - "category": "Common", - "value": "Mix Core", - "dataType": "Text", - "description": "Site Name", - "priority": 0, - "status": "Published" - }, - { - "keyword": "LanguageVersion", - "scope": "System", - "category": "Version", - "value": 1, - "dataType": "Text", - "description": "Language Version", - "priority": 0, - "status": "Published" - }, - { - "keyword": "SettingVersion", - "scope": "System", - "category": "Version", - "value": 1, - "dataType": "Text", - "description": "Settings Version", - "priority": 0, - "status": "Published" - }, - { - "keyword": "ThemeName", - "scope": "System", - "category": "Site", - "value": "Default", - "dataType": "Text", - "description": "Theme Name", - "priority": 0, - "status": "Published" - }, - { - "keyword": "ThemeFolder", - "scope": "System", - "category": "Site", - "value": "Default", - "dataType": "Text", - "description": "Theme Folder", - "priority": 0, - "status": "Published" - }, - { - "keyword": "ThemeId", - "scope": "System", - "category": "Site", - "value": "1", - "dataType": "Text", - "description": "Theme Id", - "priority": 0, - "status": "Published" - }, - { - "keyword": "DateTimeFormat", - "scope": "Shared", - "category": "Common", - "value": "dd-MM-yyyy HH:mm:ss", - "dataType": "Text", - "description": "Date Time Format", - "priority": 0, - "status": "Published" - }, - { - "keyword": "StartWeekOn", - "scope": "Shared", - "category": "Common", - "value": "Monday", - "dataType": "Text", - "description": "Day", - "priority": 0, - "status": "Published" - }, - { - "keyword": "post_image_width", - "scope": "Shared", - "category": "Site", - "value": "", - "dataType": "Integer", - "description": "Post Image Width", - "priority": 0, - "status": "Published" - }, - { - "keyword": "post_image_height", - "scope": "Shared", - "category": "Site", - "value": "", - "dataType": "Integer", - "description": "Post Image Width", - "priority": 0, - "status": "Published" - } - ] -} diff --git a/src/Mix.Cms.Web/MixContent/data/enums.json b/src/Mix.Cms.Web/MixContent/data/enums.json deleted file mode 100644 index e37a38bb7..000000000 --- a/src/Mix.Cms.Web/MixContent/data/enums.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "configuration_cates": ["Common", "Version", "Site"], - "configuration_scope": ["System", "Site", "Shared"], - "language_cates": ["System", "Site", "Mobile"] - } -} diff --git a/src/Mix.Cms.Web/Mixcore.csproj b/src/Mix.Cms.Web/Mixcore.csproj deleted file mode 100644 index de1275552..000000000 --- a/src/Mix.Cms.Web/Mixcore.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - net5.0 - true - Mix.Cms.Web.Program - false - 20a88919-2a4a-4558-9c68-0a12ed724415 - disable - en - true - favicon.ico - 1.0.1 - mixcore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - PreserveNewest - true - PreserveNewest - - - Always - - - Always - - - - - - Always - - - Always - - - - - - - - - - - - diff --git a/src/Mix.Cms.Web/Models/RewriteRules.cs b/src/Mix.Cms.Web/Models/RewriteRules.cs deleted file mode 100644 index 37d0dd47d..000000000 --- a/src/Mix.Cms.Web/Models/RewriteRules.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite; -using Microsoft.Net.Http.Headers; -using System; -using System.Text.RegularExpressions; - -namespace RewriteRules -{ - public class MethodRules - { - #region snippet1 - - public static void RedirectXMLRequests(RewriteContext context) - { - var request = context.HttpContext.Request; - - // Because we're redirecting back to the same app, stop - // processing if the request has already been redirected - if (request.Path.StartsWithSegments(new PathString("/xmlfiles"))) - { - return; - } - - if (request.Path.Value.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) - { - var response = context.HttpContext.Response; - response.StatusCode = StatusCodes.Status301MovedPermanently; - context.Result = RuleResult.EndResponse; - response.Headers[HeaderNames.Location] = - "/xmlfiles" + request.Path + request.QueryString; - } - } - - #endregion snippet1 - } - - #region snippet2 - - public class RedirectImageRequests : IRule - { - private readonly string _extension; - private readonly PathString _newPath; - - public RedirectImageRequests(string extension, string newPath) - { - if (string.IsNullOrEmpty(extension)) - { - throw new ArgumentException(nameof(extension)); - } - - if (!Regex.IsMatch(extension, @"^\.(png|jpg|gif)$")) - { - throw new ArgumentException("Invalid extension", nameof(extension)); - } - - if (!Regex.IsMatch(newPath, @"(/[A-Za-z0-9]+)+?")) - { - throw new ArgumentException("Invalid path", nameof(newPath)); - } - - _extension = extension; - _newPath = new PathString(newPath); - } - - public void ApplyRule(RewriteContext context) - { - var request = context.HttpContext.Request; - - // Because we're redirecting back to the same app, stop - // processing if the request has already been redirected - if (request.Path.StartsWithSegments(new PathString(_newPath))) - { - return; - } - - if (request.Path.Value.EndsWith(_extension, StringComparison.OrdinalIgnoreCase)) - { - var response = context.HttpContext.Response; - response.StatusCode = StatusCodes.Status301MovedPermanently; - context.Result = RuleResult.EndResponse; - response.Headers[HeaderNames.Location] = - _newPath + request.Path + request.QueryString; - } - } - } - - #endregion snippet2 -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Program.cs b/src/Mix.Cms.Web/Program.cs deleted file mode 100644 index ecf43ed0d..000000000 --- a/src/Mix.Cms.Web/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Mix.Cms.Lib; -using System.IO; - -namespace Mix.Cms.Web -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) - { - if (!File.Exists($"{MixConstants.CONST_FILE_APPSETTING}")) - { - File.Copy($"{MixConstants.CONST_DEFAULT_FILE_APPSETTING}", $"{MixConstants.CONST_FILE_APPSETTING}"); - } - - var config = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile(MixConstants.CONST_FILE_APPSETTING, optional: true, reloadOnChange: true) - .Build(); - return Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Properties/PublishProfiles/Publish2Folder.pubxml b/src/Mix.Cms.Web/Properties/PublishProfiles/Publish2Folder.pubxml deleted file mode 100644 index 245f78227..000000000 --- a/src/Mix.Cms.Web/Properties/PublishProfiles/Publish2Folder.pubxml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - True - False - True - Release - Any CPU - FileSystem - bin\Release\net5.0\publish\ - FileSystem - - net5.0 - 0e27fda9-70b1-41ad-8465-3e56ea78f0df - false - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/Properties/ServiceDependencies/tet2021-electrolux - Web Deploy/profile.arm.json b/src/Mix.Cms.Web/Properties/ServiceDependencies/tet2021-electrolux - Web Deploy/profile.arm.json deleted file mode 100644 index 9ac49f584..000000000 --- a/src/Mix.Cms.Web/Properties/ServiceDependencies/tet2021-electrolux - Web Deploy/profile.arm.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_dependencyType": "appService.windows" - }, - "parameters": { - "resourceGroupName": { - "type": "string", - "defaultValue": "Hakuhodo-Electrolux", - "metadata": { - "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." - } - }, - "resourceGroupLocation": { - "type": "string", - "defaultValue": "southeastasia", - "metadata": { - "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support." - } - }, - "resourceName": { - "type": "string", - "defaultValue": "tet2021-electrolux", - "metadata": { - "description": "Name of the main resource to be created by this template." - } - }, - "resourceLocation": { - "type": "string", - "defaultValue": "[parameters('resourceGroupLocation')]", - "metadata": { - "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." - } - } - }, - "variables": { - "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", - "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]" - }, - "resources": [ - { - "type": "Microsoft.Resources/resourceGroups", - "name": "[parameters('resourceGroupName')]", - "location": "[parameters('resourceGroupLocation')]", - "apiVersion": "2019-10-01" - }, - { - "type": "Microsoft.Resources/deployments", - "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", - "resourceGroup": "[parameters('resourceGroupName')]", - "apiVersion": "2019-10-01", - "dependsOn": [ - "[parameters('resourceGroupName')]" - ], - "properties": { - "mode": "Incremental", - "template": { - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "location": "[parameters('resourceLocation')]", - "name": "[parameters('resourceName')]", - "type": "Microsoft.Web/sites", - "apiVersion": "2015-08-01", - "tags": { - "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty" - }, - "dependsOn": [ - "[variables('appServicePlan_ResourceId')]" - ], - "kind": "app", - "properties": { - "name": "[parameters('resourceName')]", - "kind": "app", - "httpsOnly": true, - "reserved": false, - "serverFarmId": "[variables('appServicePlan_ResourceId')]", - "siteConfig": { - "metadata": [ - { - "name": "CURRENT_STACK", - "value": "dotnetcore" - } - ] - } - }, - "identity": { - "type": "SystemAssigned" - } - }, - { - "location": "[parameters('resourceLocation')]", - "name": "[variables('appServicePlan_name')]", - "type": "Microsoft.Web/serverFarms", - "apiVersion": "2015-08-01", - "sku": { - "name": "S1", - "tier": "Standard", - "family": "S", - "size": "S1" - }, - "properties": { - "name": "[variables('appServicePlan_name')]" - } - } - ] - } - } - } - ] -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Properties/launchSettings.json b/src/Mix.Cms.Web/Properties/launchSettings.json deleted file mode 100644 index d7564a7b2..000000000 --- a/src/Mix.Cms.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:58613", - "sslPort": 44374 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Mix.Cms.Web": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Startup.cs b/src/Mix.Cms.Web/Startup.cs deleted file mode 100644 index 44432ec51..000000000 --- a/src/Mix.Cms.Web/Startup.cs +++ /dev/null @@ -1,180 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.StaticFiles; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Mix.Cms.Api.RestFul; -using Mix.Cms.Lib.Constants; -using Mix.Cms.Lib.Extensions; -using Mix.Cms.Lib.Models.Account; -using Mix.Cms.Lib.Models.Cms; -using Mix.Cms.Lib.Services; -using Mix.Cms.Messenger.Models.Data; -using Mix.Cms.Schedule; -using Mix.Cms.Service.SignalR; -using Mix.Services; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Mix.Cms.Web -{ - public partial class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - private readonly string MixcoreAllowSpecificOrigins = "_mixcoreAllowSpecificOrigins"; - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - string[] allowedHosts = MixService.GetConfig(MixAppSettingKeywords.AllowedHosts) - .Select(m => m.Value("text")).ToArray(); - services.AddCors(options => - { - options.AddPolicy(name: MixcoreAllowSpecificOrigins, - builder => - { - builder.WithOrigins(allowedHosts); - builder.AllowAnyHeader(); - builder.AllowAnyMethod(); - }); - }); - - services.AddControllersWithViews() - .AddRazorRuntimeCompilation() - .AddNewtonsoftJson(options => - { - options.SerializerSettings.Converters.Add(new StringEnumConverter()); - }); - - #region Additionals Config for Mixcore Cms - - /* Additional Config for Mixcore Cms */ - - /* Mix: Add db contexts */ - services.AddDbContext(); - services.AddDbContext(); - services.AddDbContext(); - /* Mix: End Add db contexts */ - - /* Mix: Inject Services */ - services.AddControllers(mvcOptions => mvcOptions.EnableEndpointRouting = false); - services.AddGenerateApis(); - services.AddMixRestApi(); - services.AddMixSignalR(); - //services.AddMixGprc(); - services.AddMixScheduler(Configuration); - /* Mix: End Inject Services */ - - VerifyInitData(services); - - services.AddMixAuthorize(Configuration); - /* End Additional Config for Mixcore Cms */ - - #endregion Additionals Config for Mixcore Cms - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseExceptionHandler("/404"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - app.UseHsts(); - } - if (!MixService.GetConfig("IsInit")) - { - var context = MixService.GetDbContext(); - var pendingMigration = context.Database.GetPendingMigrations(); - if (pendingMigration.Count() > 0) - { - context.Database.Migrate(); - } - } - app.UseCors(MixcoreAllowSpecificOrigins); - - var provider = new FileExtensionContentTypeProvider(); - // Add new mappings - provider.Mappings[".vue"] = "application/text"; - - app.UseStaticFiles(new StaticFileOptions - { - ContentTypeProvider = provider - }); - - //app.UseStaticFiles(); - //app.UseGraphiQl("/api/graphql"); - - app.UseRouting(); - app.UseAuthentication(); - app.UseAuthorization(); - - #region Additionals Config for Mixcore Cms - - if (MixService.GetConfig("IsHttps")) - { - app.UseHttpsRedirection(); - } - app.UseMixRestApi(); - //app.UseMixGprc(); - - app.UseMixSignalR(); - - app.UseMixRoutes(); - app.UseMixScheduler(); - - #endregion Additionals Config for Mixcore Cms - } - - // Mix: Check custom cms config - private void VerifyInitData(IServiceCollection services) - { - // Mix: Migrate db if already inited - - if (!MixService.GetConfig("IsInit")) - { - using (var ctx = MixService.GetDbContext()) - { - ctx.Database.Migrate(); - var transaction = ctx.Database.BeginTransaction(); - var sysDatabasesFile = MixFileRepository.Instance.GetFile("sys_databases", MixFileExtensions.Json, $"{MixFolders.JsonDataFolder}"); - var sysDatabases = JObject.Parse(sysDatabasesFile.Content)["data"].ToObject>(); - foreach (var db in sysDatabases) - { - if (!ctx.MixDatabase.Any(m => m.Name == db.Name)) - { - db.SaveModel(true, ctx, transaction); - } - } - transaction.Commit(); - transaction.Dispose(); - } - } - - // Mix: Check if require ssl - if (MixService.GetConfig("IsHttps")) - { - services.AddHttpsRedirection(options => - { - options.RedirectStatusCode = StatusCodes.Status308PermanentRedirect; - options.HttpsPort = 443; - }); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Data/Index.cshtml b/src/Mix.Cms.Web/Views/Data/Index.cshtml deleted file mode 100644 index a0ed7d4a1..000000000 --- a/src/Mix.Cms.Web/Views/Data/Index.cshtml +++ /dev/null @@ -1,74 +0,0 @@ -@model Mix.Cms.Lib.ViewModels.MixDatabaseDatas.ReadMvcViewModel -@{ - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeName, ViewBag.culture); - string templateFolder = MixCmsHelper.GetTemplateFolder(ViewBag.culture); - string layout = Model.Property("master_path") ?? "Masters/_Layout.cshtml"; - var masterTemplate = await MixCmsHelper.GetTemplateByPath(master, layout); - Layout = $"{templateFolder}/{layout}"; - MixCmsHelper.GetAttributeDataListBySet(Context, "services", ViewBag.culture); -} -
- - - - - @if (!string.IsNullOrEmpty(Model.TemplatePath)) - { - try - { - - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template with Exception detail below:

- - @invalidOperationException - - - } - catch (Exception ex) - { - - @ex - -

Unable load template

- } - } - else - { -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
- } -
-@{ - string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.PreviewUrl; - string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.Property("title"); - ViewData["Title"] = ViewData["Title"] != null ? (string)ViewData["Title"] : Model.Property("title"); - string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.Property("seo_description"); - string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.Property("image"); - - var domain = url.IndexOf("http") == -1 ? $"{Context.Request.Scheme}://{Context.Request.Host}": string.Empty; -} -@section Seo{ - @*@(MixService.GetConfig<string>("SiteName", ViewBag.culture)) - @Model.SeoTitle*@ - - - - - @* - - - - - *@ -} -@section Styles{ - @Html.Raw(masterTemplate?.Styles) - @*@Html.Raw(Model.View?.Styles)*@ -} -@section Scripts{ - @Html.Raw(masterTemplate?.Scripts) - @*@Html.Raw(Model.View?.Scripts)*@ -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Home/Index.cshtml b/src/Mix.Cms.Web/Views/Home/Index.cshtml deleted file mode 100644 index b170b514a..000000000 --- a/src/Mix.Cms.Web/Views/Home/Index.cshtml +++ /dev/null @@ -1,73 +0,0 @@ -@using Mix.Cms.Lib; -@using Mix.Cms.Lib.Services; -@model Mix.Cms.Lib.Interfaces.IMvcViewModel -@{ - var assetFolder = MixCmsHelper.GetAssetFolder(ViewBag.culture); - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeName, ViewBag.culture); - string templateFolder = MixCmsHelper.GetTemplateFolder(ViewBag.culture); - string layout = Model.Layout ?? "Masters/_Layout.cshtml"; - var masterTemplate = await MixCmsHelper.GetTemplateByPath(master, layout); - Layout = $"{templateFolder}/{layout}"; - var p = MixCmsHelper.GetPostlistByMeta(Context, ViewBag.culture as string - , MixConstants.MixDatabaseName.SYSTEM_TAG); - var posts = Mix.Cms.Lib.ViewModels.MixPosts.Helper.GetModelistByMeta( - MixConstants.MixDatabaseName.SYSTEM_TAG, Context.Request.Query["tag"], - ViewBag.culture as string, "CreatedDateTime", Mix.Heart.Enums.MixHeartEnums.DisplayDirection.Desc, 10, 0); -} - - - -@if (!string.IsNullOrEmpty(Model.TemplatePath)) -{ - - try - { - @await Html.PartialAsync(Model.TemplatePath, Model) - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @invalidOperationException - - } - catch (Exception ex) - { - - @ex - - } -} -else -{ -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
-} -@{ - string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailsUrl; - string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; - string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; - string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.ThumbnailUrl; -} -@section Seo{ - @(MixService.GetConfig<string>("SiteName", ViewBag.culture)) - @Model.SeoTitle - - - - - - - - - - -} -@section Styles{ - @Html.Raw(masterTemplate?.Styles) - @Html.Raw(Model.View?.Styles) -} -@section Scripts{ - @Html.Raw(masterTemplate?.Scripts) - @Html.Raw(Model.View?.Scripts) -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Home/Module.cshtml b/src/Mix.Cms.Web/Views/Home/Module.cshtml deleted file mode 100644 index 4f9bb1f1f..000000000 --- a/src/Mix.Cms.Web/Views/Home/Module.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@model Mix.Cms.Lib.ViewModels.MixModules.ReadMvcViewModel -@{ - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, ViewBag.culture); - Layout = null; -} -@if (!string.IsNullOrEmpty(Model.TemplatePath)) -{ - try - { - - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template with Exception detail below:

- - @invalidOperationException - - - } - catch (Exception ex) - { - - @ex - -

Unable load template

- } -} -else -{ -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
-} - -@Html.Raw(Model.View?.Styles) -@Html.Raw(Model.View?.Scripts) \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Init/Index.cshtml b/src/Mix.Cms.Web/Views/Init/Index.cshtml deleted file mode 100644 index f4b78c8ed..000000000 --- a/src/Mix.Cms.Web/Views/Init/Index.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "Init"; - Layout = "~/Views/Shared/_LayoutInit_Angular.cshtml"; -} - -
-
\ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Module/Index.cshtml b/src/Mix.Cms.Web/Views/Module/Index.cshtml deleted file mode 100644 index e77622fd4..000000000 --- a/src/Mix.Cms.Web/Views/Module/Index.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@model Mix.Cms.Lib.ViewModels.MixModules.ReadMvcViewModel -@{ - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, ViewBag.culture); - Layout = null; -} -@if (!string.IsNullOrEmpty(Model.TemplatePath)) -{ - try - { - Model.Posts.Items.Take(4); - - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @invalidOperationException - - } - catch (Exception ex) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @ex - - } -} -else -{ -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
-} - -@Html.Raw(Model.View?.Styles) -@Html.Raw(Model.View?.Scripts) \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Page/Index.cshtml b/src/Mix.Cms.Web/Views/Page/Index.cshtml deleted file mode 100644 index e2e252549..000000000 --- a/src/Mix.Cms.Web/Views/Page/Index.cshtml +++ /dev/null @@ -1,75 +0,0 @@ -@{ - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeName, ViewBag.culture); - string templateFolder = MixCmsHelper.GetTemplateFolder(ViewBag.culture); - string layout = Model.Layout ?? "Masters/_Layout.cshtml"; - var masterTemplate = await MixCmsHelper.GetTemplateByPath(master, layout); - Layout = $"{templateFolder}/{layout}"; - -} -@* - - *@ - - -@if (!string.IsNullOrEmpty(Model.TemplatePath)) -{ - try - { - @*foreach (var item in navs) - { - @item.ToString() - }*@ - - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @invalidOperationException - - } - catch (Exception ex) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @ex - - } -} -else -{ -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
-} -@{ - string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailsUrl; - string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; - string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; - string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.ThumbnailUrl; -} -@section Seo{ - @(MixService.GetConfig<string>("SiteName", ViewBag.culture)) - @Model.SeoTitle - - - - - - - - - - -} -@section Styles{ - - @Html.Raw(masterTemplate?.Styles) - - @Html.Raw(Model.View?.Styles) -} -@section Scripts{ - - @Html.Raw(masterTemplate?.Scripts) - - @Html.Raw(Model.View?.Scripts) -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Portal/Index.cshtml b/src/Mix.Cms.Web/Views/Portal/Index.cshtml deleted file mode 100644 index 7584f1549..000000000 --- a/src/Mix.Cms.Web/Views/Portal/Index.cshtml +++ /dev/null @@ -1,33 +0,0 @@ -@{ - ViewData["Title"] = "Dashboard"; - ViewData["Description"] = "Your powerful dashboard is here"; - Layout = "~/Views/Shared/_LayoutPortal_Angular.cshtml"; - - var menus = MixCmsHelper.LoadDataFile(MixFolders.JsonDataFolder, "portal-menus.json"); -} - -
- - - - - -
- - - -
-
- - - - - - - - - -
- - -
\ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Post/Index.cshtml b/src/Mix.Cms.Web/Views/Post/Index.cshtml deleted file mode 100644 index 6f204daf2..000000000 --- a/src/Mix.Cms.Web/Views/Post/Index.cshtml +++ /dev/null @@ -1,80 +0,0 @@ -@model Mix.Cms.Lib.ViewModels.MixPosts.ReadMvcViewModel -@{ - string master = MixService.GetConfig(MixAppSettingKeywords.ThemeName, ViewBag.culture); - string templateFolder = MixCmsHelper.GetTemplateFolder(ViewBag.culture); - string layout = "Masters/_Layout.cshtml"; - var masterTemplate = await MixCmsHelper.GetTemplateByPath(master, layout); - Layout = $"{templateFolder}/{layout}"; -} -@if (Model != null) -{ -
- - - - - @if (!string.IsNullOrEmpty(Model.TemplatePath)) - { - try - { - - } - catch (System.InvalidOperationException invalidOperationException) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @invalidOperationException - - } - catch (Exception ex) - { -

Unable load template @Model.TemplatePath with Exception detail below:

- - @ex - - } - } - else - { -
-

@(MixService.Translate("Please choose template", ViewBag.culture))

-
- } -
-} -else -{ -

NotFound

-} -@{ - string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailsUrl; - string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; - ViewData["Title"] = ViewData["Title"] != null ? (string)ViewData["Title"] : Model.SeoTitle; - string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; - string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.ThumbnailUrl; - - var domain = url.IndexOf("http") == -1 ? $"{Context.Request.Scheme}://{Context.Request.Host}" : string.Empty; -} -@section Seo{ - @(MixService.GetConfig<string>("SiteName", ViewBag.culture)) - @Model.SeoTitle - - - - - - - - - - -} - -@section Styles{ - @Html.Raw(masterTemplate?.Styles) - @Html.Raw(Model.View?.Styles) -} -@section Scripts{ - @Html.Raw(masterTemplate?.Scripts) - @Html.Raw(Model.View?.Scripts) -} diff --git a/src/Mix.Cms.Web/Views/Security/Index.cshtml b/src/Mix.Cms.Web/Views/Security/Index.cshtml deleted file mode 100644 index 8769ff77a..000000000 --- a/src/Mix.Cms.Web/Views/Security/Index.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@{ - ViewData["Title"] = "Security"; - Layout = "~/Views/Shared/_LayoutSecurity_Angular.cshtml"; -} - -
-
-
- - -
\ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Shared/_LayoutInit_Angular.cshtml b/src/Mix.Cms.Web/Views/Shared/_LayoutInit_Angular.cshtml deleted file mode 100644 index 69770f15d..000000000 --- a/src/Mix.Cms.Web/Views/Shared/_LayoutInit_Angular.cshtml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - @ViewData["Title"] - Mixcore - - - - - - - - - - -
- -
-
-
- Mixcore CMS - @RenderBody() -
-
-
- - - - - - - - - - - - @RenderSection("Scripts", required: false) - - - - - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Shared/_LayoutPortal_Angular.cshtml b/src/Mix.Cms.Web/Views/Shared/_LayoutPortal_Angular.cshtml deleted file mode 100644 index dec73a565..000000000 --- a/src/Mix.Cms.Web/Views/Shared/_LayoutPortal_Angular.cshtml +++ /dev/null @@ -1,81 +0,0 @@ -@using Microsoft.AspNetCore.Mvc.Localization -@inject UserManager UserManager - - - - - - - @ViewData["Title"] - Angular mixcore - - - - - - - - - - - - @RenderSection("Styles", required: false) - - - - - @RenderBody() - - - - - - - @* - *@ - @* *@ - - - - - - - - - - - - - - - - - - - @RenderSection("Scripts", required: false) - - - @*@RenderSection("Modals", required: false)*@ - @*@await Component.InvokeAsync(typeof(Mix.Cms.Mvc.Areas.Portal.ViewComponents.Modals))*@ - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Shared/_LayoutSecurity_Angular.cshtml b/src/Mix.Cms.Web/Views/Shared/_LayoutSecurity_Angular.cshtml deleted file mode 100644 index 2397f3919..000000000 --- a/src/Mix.Cms.Web/Views/Shared/_LayoutSecurity_Angular.cshtml +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - @ViewData["Title"] - mixcore - - - @* - *@ - - - - - - - - - - - - - - - -
- - -
- -
- - - - - - - - - - - - - @RenderSection("Scripts", required: false) - - - - - - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/Views/Vue/VueComponent.cshtml b/src/Mix.Cms.Web/Views/Vue/VueComponent.cshtml deleted file mode 100644 index c93faa165..000000000 --- a/src/Mix.Cms.Web/Views/Vue/VueComponent.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@model Mix.Cms.Lib.ViewModels.MixModules.ReadMvcViewModel - -@await Html.PartialAsync(Model.TemplatePath, Model) -@Html.Raw(Model.View.Scripts) -@Html.Raw(Model.View.Styles) diff --git a/src/Mix.Cms.Web/Views/_ViewImports.cshtml b/src/Mix.Cms.Web/Views/_ViewImports.cshtml deleted file mode 100644 index e8a182897..000000000 --- a/src/Mix.Cms.Web/Views/_ViewImports.cshtml +++ /dev/null @@ -1,28 +0,0 @@ -@using Mix.Cms -@using Mix.Identity.Models -@using Mix.Identity.Models.AccountViewModels -@using Mix.Identity.Models.ManageViewModels -@using Microsoft.AspNetCore.Identity -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Mvc.Localization -@using Mix.Domain.Core.ViewModels -@using Mix.Cms.Lib.ViewModels -@using Mix.Cms.Lib -@using Mix.Cms.Lib.Helpers -@using Mix.Cms.Web.Models -@using Mix.Cms.Lib.Services -@using Mix.Cms.Lib.Enums; -@using Mix.Heart.Enums; -@using Mix.Cms.Lib.Constants; -@using Newtonsoft.Json.Linq; -@using System.Security.Claims; -@using Mix.Cms.Lib.Models.Common -@using Mix.Cms.Lib.Interfaces - -@using MixModules = Mix.Cms.Lib.ViewModels.MixModules -@using MixPosts = Mix.Cms.Lib.ViewModels.MixPosts -@using MixPages = Mix.Cms.Lib.ViewModels.MixPages -@using MixDatas = Mix.Cms.Lib.ViewModels.MixDatabaseDatas - -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/Mix.Cms.Web/Views/_ViewStart.cshtml b/src/Mix.Cms.Web/Views/_ViewStart.cshtml deleted file mode 100644 index 8572c98f2..000000000 --- a/src/Mix.Cms.Web/Views/_ViewStart.cshtml +++ /dev/null @@ -1,62 +0,0 @@ -@using Mix.Cms -@using Mix.Identity.Models -@using Mix.Identity.Models.AccountViewModels -@using Mix.Identity.Models.ManageViewModels -@using Microsoft.AspNetCore.Identity -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Mvc.Localization -@using Mix.Domain.Core.ViewModels -@using Mix.Cms.Lib.ViewModels -@using Mix.Cms.Lib -@using Mix.Cms.Web.Models -@using Mix.Cms.Lib.Services -@using Mix.Heart.Enums; -@using System.Security.Claims; - -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - -@{ -//if (!MixService.GetConfig("IsInit")) -//{ - -// string culture = ViewBag.culture; -// var globalConfig = MixService.GetGlobalSetting(); -// var localConfig = MixService.GetLocalSettings(culture); -// string master = MixService.GetConfig(MixAppSettingKeywords.ThemeFolder, ViewBag.culture) ?? "Default"; -// Layout = $"Templates/{master}/Masters/{"_Layout"}"; -// var userId = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier); -// User.IsInRole("SuperAdmin"); -// // Get by paging -// int.TryParse(Context.Request.Query["pIndex"], out int pIndex); -// //var pagingReq = new RequestPaging() -// var posts = MixPosts.UpdateViewModel.Repository.GetModelListAsync( -// "CreatedDateTime", -// MixHeartEnums.DisplayDirection.Asc, -// MixService.GetConfig(MixAppSettingKeywords.MaxPageSize), -// pIndex); - -// int.TryParse(Context.Request.Query["pId"], out int pId); - -// var getPost = await MixPosts.UpdateViewModel.Repository.GetSingleModelAsync(m => m.Id == pId && m.Specificulture == culture); -// MixPosts.UpdateViewModel post = null; -// if (getPost.IsSucceed) -// { -// post = getPost.Data; -// } - -// // - -// // Insert by - - -// var navs = await MixDatas.Helper.FilterByKeywordAsync(culture, MixDatabaseNames.NAVIGATION, "equal", "name", "top"); - -// //var dynamicDb = await MixDatas.Helper.FilterByKeywordAsync(culture, MixDatabaseNames.NAVIGATION, "equal", "name", "top"); - -// //async Task UpdatePost(MixPosts.UpdateViewModel post, bool isSaveSubModel = false) -// //{ -// // await post.SaveModelAsync(isSaveSubModel); -// //} -//} -} \ No newline at end of file diff --git a/src/Mix.Cms.Web/default.appsettings.json b/src/Mix.Cms.Web/default.appsettings.json deleted file mode 100644 index 672df173e..000000000 --- a/src/Mix.Cms.Web/default.appsettings.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "ConnectionStrings": { - "MixAccountConnection": null, - "MixCmsConnection": null, - "MixMessengerConnection": null - }, - "MixConfigurations": { - "IsCache": true, - "MixCacheMode": "Json", - "MixCacheFolder": "MixContent/cache", - "JsonDataFolder": "MixContent/data", - "MixLogsFolder": "MixContent/logs" - }, - "Authentication": { - "ClockSkew": 20, - "CookieExpiration": 20, - "RefreshTokenExpiration": 120, - "ValidateIssuer": false, - "ValidateAudience": false, - "ValidateLifetime": true, - "ValidateIssuerSigningKey": true, - "TokenType": "Bearer", - "Audience": "mix-core", - "SecretKey": "mixcore-secret-key", - "Issuer": "mix-core", - "Issuers": "mix-core", - "Audiences": "mix-core", - "AllowedIps": "" - }, - "IpSecuritySettings": { - "IsRetrictIp": true, - "AllowedPortalIps": [], - "AllowedIps": [], - "ExceptIps": [] - }, - "Cloudflare": { - "ApiToken": "", - "ApiKey": { - "GlobalKey": "", - "OriginKey": "" - } - }, - "Translator": {}, - "LocalSettings": { - "en-us": { - "ContactAddress": "", - "ContactEmail": "", - "ContactPhone": "", - "Facebook": "", - "FacebookAppId": "", - "Favicon": "", - "LanguageVersion": "1", - "Logo": "", - "SettingVersion": "1", - "Theme": "Default", - "ThemeId": "1" - } - }, - "GlobalSettings": { - "IsInit": true, - "InitStatus": 0, - "IsMaintenance": false, - "IsRewrite": true, - "IsHttps": false, - "IsCache": true, - "IsRegistration": true, - "MaxPageSize": 100, - "ImageSize": 2000, - "DefaultAvatar": "/mix-app/assets/img/user.png", - "DefaultCulture": "en-us", - "DefaultTemplate": "_Blank", - "DefaultTemplateContent": "
", - "DefaultTheme": "Default_Blank", - "DefaultContentStatus": "Published", - "DefaultBlankTemplateFolder": "Themes/Default_Blank", - "DefaultTemplateFolder": "Themes/Default", - "DefaultTemplateLayout": "_Layout", - "DefaultPostAttr": "[]", - "OrderBy": "Priority", - "OrderDirection": "0", - "Language": "en-us", - "UploadFolder": "Content/Uploads", - "ThemeId": "1", - "Domain": "", - "TemplateExtension": ".cshtml", - "TagPageSize": "20", - "SearchPageSize": "20", - "IsEncryptApi": true, - "LastUpdateConfiguration": null, - "DatabaseProvider": "MSSQL", - "AllowedHosts": [], - "Smtp": { - "Server": "", - "Port": 587, - "SSL": true, - "User": "", - "Password": "", - "From": "support@mixcore.org", - "FromName": "mix-core" - }, - "PortalThemeSettings": { - "primaryColorHue": 90, - "primaryColorSaturation": 35, - "primaryColorBrightness": 50, - "bgColor": "#fbfbfb", - "textColor": "#404040", - "primaryColor": "#47c5d1", - "bgColorHover": "#d1e0de", - "borderColor": "#d1e0de", - "borderColorHover": "#e0e4e7", - "linkColor": "#47c5d1", - "linkColorHover": "#404040", - "linkColorActive": "#404040", - "textColorHover": "#008b8b", - "fontFamily": "", - "fontSizeH1": "16", - "fontSize": "12" - } - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "JWTSettings": { - "SecretKey": "sw-cms-secret-key", - "Issuer": "sw-cms", - "Audience": "sw-client" - }, - "Language": "en-us", - "EPPlus": { - "ExcelPackage": { - "LicenseContext": "NonCommercial" //The license context used - } - }, - "Quartz": { - "quartz.scheduler.instanceName": "Mixcore Cms Scheduler" - } -} diff --git a/src/Mix.Cms.Web/favicon.ico b/src/Mix.Cms.Web/favicon.ico deleted file mode 100644 index 15a038f7e..000000000 Binary files a/src/Mix.Cms.Web/favicon.ico and /dev/null differ diff --git a/src/Mix.Cms.Web/web.config b/src/Mix.Cms.Web/web.config deleted file mode 100644 index 542b9748c..000000000 --- a/src/Mix.Cms.Web/web.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/favicon.ico b/src/Mix.Cms.Web/wwwroot/favicon.ico deleted file mode 100644 index 15a038f7e..000000000 Binary files a/src/Mix.Cms.Web/wwwroot/favicon.ico and /dev/null differ diff --git a/src/Mix.Cms.Web/wwwroot/manifest.json b/src/Mix.Cms.Web/wwwroot/manifest.json deleted file mode 100644 index 73b6d8ed2..000000000 --- a/src/Mix.Cms.Web/wwwroot/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "Mixcore CMS", - "short_name": "Mixcore", - "description": "Fully Open Source UI Tools to create multi-purpose Web Apps & Application Services. CMS and Dashboards built on top of ASP.Net Core / Dotnet Core, SignalR, Angular.JS and Bootstrap.", - "start_url": "/quasar/init-screen.mix", - "scope": "/quasar/", - "orientation": "any", - "lang": "English", - "display": "standalone", - "theme_color": "green", - "background_color": "white", - "icons": [ - { - "src": "\/assets\/icons\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/assets\/icons\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/assets\/icons\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/assets\/icons\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - } - ] -} diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-client.min.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/app-client.min.css deleted file mode 100644 index d66faf910..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-client.min.css +++ /dev/null @@ -1 +0,0 @@ -/* Wed Feb 24 2021 09:23:11 GMT+0700 (Indochina Time) */.haiyen-loader,.video{width:100%;height:100%}#modal-shopping-cart .modal-title{margin-top:0}#modal-shopping-cart .cart-item{margin:10px 0}#modal-shopping-cart .modal-dialog{max-width:unset;margin:20px}#modal-shopping-cart{color:#5c4b43;z-index:1060}#modal-shopping-cart .modal-footer button{margin:0 10px}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}@-moz-keyframes rotation{from{-moz-transform:rotate(0);-moz-transform-origin:85% 90%}to{-moz-transform:rotate(359deg);-moz-transform-origin:85% 90%}}@-webkit-keyframes rotation{from{-webkit-transform:rotate(0);-webkit-transform-origin:85% 90%}to{-webkit-transform:rotate(359deg);-webkit-transform-origin:85% 90%}}[class*=" icon-"].loading-indicator{float:left;display:none;font-size:24px;margin:7px;color:#EC173A}[class*=" icon-"].loading-indicator.on{display:block;-webkit-animation:rotation 1.5s infinite linear;-moz-animation:rotation 1.5s infinite linear}.browser-warning,.user .icon-phone-4{display:none}.user-list{padding:9px 0}.user:hover .icon-phone-4{display:inline-block}.user a{position:relative;overflow:hidden}.user .username{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding-right:16px}.user .helper{position:absolute;right:10px;top:5px}.actions{display:none}[data-mode=incall] .actions,[data-mode=calling] .actions{display:block}.actions .hangup{width:100%}.actions .status{text-align:center;margin-bottom:20px}.video{border:2px solid #000}.cool-background{background:linear-gradient(135deg,#ECEDDC 25%,transparent 25%) -50px 0,linear-gradient(225deg,#ECEDDC 25%,transparent 25%) -50px 0,linear-gradient(315deg,#ECEDDC 25%,transparent 25%),linear-gradient(45deg,#ECEDDC 25%,transparent 25%);background-size:100px 100px;background-color:#EC173A}.alertify-cover{background:rgba(0,0,0,.8)}.haiyen-loader{position:fixed;left:0;top:0;z-index:999999;background:rgba(255,255,255,.78)}.haiyen-loader .spinner{width:55px;height:70px;position:absolute;top:50%;left:50%;margin-top:-70px;margin-left:-65px}.haiyen-loader .spinner>div{background-color:red;height:100%;width:6px;margin-right:5px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.haiyen-loader .spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.haiyen-loader .spinner .rect3{-webkit-animation-delay:-1s;animation-delay:-1s}.haiyen-loader .spinner .rect4{-webkit-animation-delay:-.9s;animation-delay:-.9s}.haiyen-loader .spinner .rect5{-webkit-animation-delay:-.8s;animation-delay:-.8s}@-webkit-keyframes sk-stretchdelay{0%,100%,40%{-webkit-transform:scaleY(.4)}20%{-webkit-transform:scaleY(1)}}@keyframes sk-stretchdelay{0%,100%,40%{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.package-wrapper h2{margin-top:20px}.tbl-package span{margin-left:0;font-size:inherit}.tbl-package .sum-th{background-color:#fff}.tbl-package .sum-th span{color:#333}.tbl-package td,.tbl-package th{height:21px;padding:2px 14px;font-size:20px}.tbl-package-slot th{height:0;padding:0 14px;font-size:20px}.tbl-package td{height:21px;text-align:center}.tbl-package .no-border-top{border-top:none}.tbl-package .no-border-bottom{border-bottom:none}.btn-minus,.btn-plus{width:50px;height:20px;font-weight:700;font-size:1em;line-height:10px;border:1px solid #fff;border-radius:15px;color:#fff;margin-right:5px}.btn-dark,.btn-minus-dark{border:1px solid #333}.btn-minus-dark,.btn-plus{color:#333;background-color:#fff}.btn-dark{color:#fff;background-color:#333}.tbl-package-mobile{font-size:medium}.tbl-package-mobile td,.tbl-package-mobile th{height:21px;padding:5px;font-size:medium}.tbl-package-mobile th{height:0}.tbl-package-mobile .btn-minus,.tbl-package-mobile .btn-plus{width:40px;height:16px;font-weight:700;font-size:1em;line-height:5px}.tbl-final{width:100%}.tbl-final .gift-title{padding:5px 10px;background-color:#ddd;color:#000}.tbl-final .gift-quantity{padding:5px 10px;background-color:#000;color:#fff} \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor-scss.min.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor-scss.min.css deleted file mode 100644 index f91cc9beb..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor-scss.min.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Wed Feb 24 2021 09:22:56 GMT+0700 (Indochina Time) */mix-module-data-table .data-table .header { - padding: 5px; - color: #495057; - background-color: hsla(var(--primary-color-hue, 211), 100%, 50%, 0.075); - border-color: #dee2e6; - font-weight: 400; - font-size: small; } - -mix-module-data-table .preview-container { - max-height: 4em; - overflow: hidden; } - -/* PROPORTIONALLY resize the canvas to the intended viewing size */ -/* canvas{width:300px; height:380px;} */ -upload-croppie .cr-boundary { - overflow: hidden; } - -main-side-bar-dynamic .sw-sidebar .sw-toc-item { - position: relative; } - main-side-bar-dynamic .sw-sidebar .sw-toc-item .sw-toc-link .sw-toc-link { - padding-left: 0; } - main-side-bar-dynamic .sw-sidebar .sw-toc-item .btn-group { - right: 20px; - opacity: 1; } - -main-side-bar-dynamic .sw-sidebar ul { - padding-left: 15px; } - -main-side-bar-dynamic .sw-sidebar .sw-toc-sub-link .btn-group { - padding: 2px 0; } - -@media (min-width: 992px) { - #modal-content-filter .modal-lg, - #modal-content-filter .modal-xl { - max-width: 80vw; } } diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor.min.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor.min.css deleted file mode 100644 index 0abc7f52f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/app-vendor.min.css +++ /dev/null @@ -1,10 +0,0 @@ -/* Wed Feb 24 2021 09:22:56 GMT+0700 (Indochina Time) */@charset "UTF-8";.youtube,.youtube .play-button,.youtube img{cursor:pointer}#return-to-top,tags-input .tags .tag-item .remove-button:hover{text-decoration:none}.Chartjs-legend,.dialogdemoThemeInheritance .container{text-align:center}.cr-slider:focus,.hr-text,.input-site-name,tags-input .host:active,tags-input .tags .input,tags-input[disabled] .host:focus{outline:0}.Chartjs-legend,.te-heading-add ul{list-style:none}#return-to-top{position:fixed;bottom:20px;right:20px;background:#000;background:rgba(0,0,0,.7);width:50px;height:50px;-webkit-border-radius:35px;-moz-border-radius:35px;border-radius:35px;display:none;-webkit-transition:all .3s linear;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease;z-index:9}#return-to-top:hover{background:rgba(0,0,0,.9)}#return-to-top i{color:#fff;margin:0;position:relative;left:4px;top:0;font-size:30px;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#return-to-top:hover i{color:#fff;top:5px}@media (min-width:992px){.language-switcher{display:inline;position:absolute;right:150px;bottom:15px}.language-switcher.portal{bottom:0}.language-switcher .dropdown-menu{right:0}}@media screen and (max-width:991px){.language-switcher{display:inline;position:absolute;left:20px}.language-switcher .dropdown-menu{left:0}}.language-switcher .dropdown-menu{width:250px;overflow:hidden!important}.navbar-collapse .dropdown-menu .dropdown-item{color:#444}#modal-files-search .modal-body img{height:50px}.data-table .header{padding:10px;font-weight:700;background:#d3d3d3}.mix-loader-container{top:0;left:0;width:100%;height:100%;position:fixed;background-color:#21252987;opacity:.97;z-index:9999;display:flex;justify-content:center;align-items:center}.mix-loader-container .spinner{margin:100px auto;width:40px;height:40px;position:relative;text-align:center;-webkit-animation:sk-rotate 2s infinite linear;animation:sk-rotate 2s infinite linear}.mix-loader-container .dot1,.mix-loader-container .dot2{width:60%;height:60%;display:inline-block;position:absolute;top:0;background-color:#fff;border-radius:100%;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.mix-loader-container .dot2{top:auto;bottom:0;-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes sk-rotate{100%{-webkit-transform:rotate(360deg)}}@keyframes sk-rotate{100%{transform:rotate(360deg);-webkit-transform:rotate(360deg)}}@-webkit-keyframes sk-bounce{0%,100%{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,100%{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#fff;animation-timing-function:cubic-bezier(0,1,1,0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 .6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 .6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 .6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0,0)}100%{transform:translate(24px,0)}}#dlg-preview-popup .modal-body .img{max-width:100%;display:block;margin:0 auto}.snowflake{display:block;position:absolute;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0);-webkit-user-select:none;-moz-user-select:none;user-select:none;background-image:-webkit-radial-gradient(center,circle farthest-corner,rgba(255,255,255,1) 40%,rgba(255,255,255,0) 100%);background-image:-moz-radial-gradient(center,circle farthest-corner,rgba(255,255,255,1) 40%,rgba(255,255,255,0) 100%);background-image:-ms-radial-gradient(center,circle farthest-corner,rgba(255,255,255,1) 40%,rgba(255,255,255,0) 100%);background-image:radial-gradient(center,circle farthest-corner,rgba(255,255,255,1) 40%,rgba(255,255,255,0) 100%)}#snow{position:fixed;width:100%;height:100%}.star-rating{margin:0;padding:0;display:inline-block}.star-rating .star{padding:1px;color:#ddd;font-size:12px;text-shadow:.05em .05em #aaa;list-style-type:none;display:inline-block;cursor:pointer}.star-rating .star.filled{color:#fd0}.star-rating.readonly .star.filled{color:#666}.youtube{background-color:#000;margin-bottom:30px;position:relative;padding-top:56.25%;overflow:hidden}.youtube img{width:100%;top:-16.82%;left:0;opacity:.7}.youtube .play-button{width:90px;height:60px;background-color:#333;box-shadow:0 0 30px rgba(0,0,0,.6);z-index:1;opacity:.8;border-radius:6px}tags-input[disabled] .tags,tags-input[disabled] .tags .input{background-color:#eee}.youtube .play-button:before{content:"";border-style:solid;border-width:15px 0 15px 26px;border-color:transparent transparent transparent #fff}.youtube .play-button,.youtube .play-button:before,.youtube iframe,.youtube img{position:absolute}.youtube .play-button,.youtube .play-button:before{top:50%;left:50%;transform:translate3d(-50%,-50%,0)}.youtube iframe{height:100%;width:100%;top:0;left:0}tags-input{box-shadow:none;border:none;padding:0;min-height:34px}tags-input .tags{border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-moz-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}tags-input .tags .tag-item.selected{color:#fff;border:1px solid #d43f3a}tags-input .tags.focused{border:1px solid #66afe9}tags-input .autocomplete{border-radius:4px}tags-input.ng-invalid .tags{border-color:#843534}.input-group tags-input{padding:0;display:table-cell}.input-group tags-input:not(:first-child) .tags{border-top-left-radius:0;border-bottom-left-radius:0}.input-group tags-input:not(:last-child) .tags{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-lg tags-input:first-child .tags{border-top-left-radius:6px;border-bottom-left-radius:6px}.input-group-lg tags-input:last-child .tags{border-top-right-radius:6px;border-bottom-right-radius:6px}.input-group-sm tags-input:first-child .tags{border-top-left-radius:3px;border-bottom-left-radius:3px}.input-group-sm tags-input:last-child .tags{border-top-right-radius:3px;border-bottom-right-radius:3px}.input-group-lg tags-input,tags-input.ti-input-lg{min-height:46px}.input-group-lg tags-input .tags,tags-input.ti-input-lg .tags{border-radius:6px}.input-group-lg tags-input .tags .tag-item,tags-input.ti-input-lg .tags .tag-item{height:38px;line-height:37px;font-size:18px;border-radius:6px}.input-group-lg tags-input .tags .tag-item .remove-button,tags-input.ti-input-lg .tags .tag-item .remove-button{font-size:20px}.input-group-lg tags-input .tags .input,tags-input.ti-input-lg .tags .input{height:38px;font-size:18px}.input-group-sm tags-input,tags-input.ti-input-sm{min-height:30px}.input-group-sm tags-input .tags,tags-input.ti-input-sm .tags{border-radius:3px}.input-group-sm tags-input .tags .tag-item,tags-input.ti-input-sm .tags .tag-item{height:22px;line-height:21px;font-size:12px;border-radius:3px}.input-group-sm tags-input .tags .tag-item .remove-button,tags-input.ti-input-sm .tags .tag-item .remove-button{font-size:16px}.input-group-sm tags-input .tags .input,tags-input.ti-input-sm .tags .input{height:22px;font-size:12px}.has-feedback tags-input .tags{padding-right:30px}.has-success tags-input .tags{border-color:#3c763d}.has-success tags-input .tags.focused{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-error tags-input .tags{border-color:#a94442}.has-error tags-input .tags.focused{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-warning tags-input .tags{border-color:#8a6d3b}.has-warning tags-input .tags.focused{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}tags-input{display:block}tags-input *,tags-input :after,tags-input :before{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}tags-input .host{margin:5px 0;position:relative;height:100%}tags-input .tags{-moz-appearance:textfield;-webkit-appearance:textfield;padding:1px;overflow:hidden;word-wrap:break-word;cursor:text;background-color:#fff;border:1px solid #a9a9a9;box-shadow:1px 1px 1px 0 #d3d3d3 inset;height:100%}tags-input .tags.focused{outline:0;-webkit-box-shadow:0 0 3px 1px rgba(5,139,242,.6);-moz-box-shadow:0 0 3px 1px rgba(5,139,242,.6);box-shadow:0 0 3px 1px rgba(5,139,242,.6)}tags-input .tags .tag-list{margin:0;padding:0;list-style-type:none}tags-input .tags .tag-item{color:#fff;margin:2px;padding:0 5px;display:inline-block;float:left;font:14px "Helvetica Neue",Helvetica,Arial,sans-serif;height:26px;line-height:25px;border:1px solid #acacac;border-radius:3px;background:-webkit-linear-gradient(top,#f0f9ff 0,#cbebff 47%,#a1dbff 100%);background:linear-gradient(to bottom,#f0f9ff 0,#cbebff 47%,#a1dbff 100%)}tags-input .tags .tag-item.selected{background:-webkit-linear-gradient(top,#febbbb 0,#fe9090 45%,#ff5c5c 100%);background:linear-gradient(to bottom,#febbbb 0,#fe9090 45%,#ff5c5c 100%)}tags-input .tags .tag-item .remove-button{margin:0 0 0 5px;padding:0;border:none;background:0 0;cursor:pointer;vertical-align:middle;font:700 16px Arial,sans-serif;color:#585858}tags-input[disabled] .tags,tags-input[disabled] .tags .input,tags-input[disabled] .tags .tag-item .remove-button{cursor:default}tags-input .tags .input.invalid-tag,tags-input .tags .tag-item .remove-button:active{color:red}tags-input .tags .input{border:0;margin:2px;padding:0 0 0 5px;float:left;height:26px;font:14px "Helvetica Neue",Helvetica,Arial,sans-serif}tags-input .tags .input::-ms-clear{display:none}tags-input.ng-invalid .tags{-webkit-box-shadow:0 0 3px 1px rgba(255,0,0,.6);-moz-box-shadow:0 0 3px 1px rgba(255,0,0,.6);box-shadow:0 0 3px 1px rgba(255,0,0,.6)}tags-input[disabled] .tags .tag-item{opacity:.65;background:-webkit-linear-gradient(top,#f0f9ff 0,rgba(203,235,255,.75) 47%,rgba(161,219,255,.62) 100%);background:linear-gradient(to bottom,#f0f9ff 0,rgba(203,235,255,.75) 47%,rgba(161,219,255,.62) 100%)}tags-input[disabled] .tags .tag-item .remove-button:active{color:#585858}tags-input .autocomplete{margin-top:5px;position:absolute;padding:5px 0;z-index:999;width:100%;background-color:#fff;border:1px solid rgba(0,0,0,.2);-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}tags-input .autocomplete .suggestion-list{margin:0;padding:0;list-style-type:none;max-height:280px;overflow-y:auto;position:relative}tags-input .autocomplete .suggestion-item{padding:5px 10px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:16px "Helvetica Neue",Helvetica,Arial,sans-serif;color:#000;background-color:#fff}tags-input .autocomplete .suggestion-item.selected,tags-input .autocomplete .suggestion-item.selected em{color:#fff;background-color:#0097cf}tags-input .autocomplete .suggestion-item em{font:normal 700 16px "Helvetica Neue",Helvetica,Arial,sans-serif;color:#000;background-color:#fff}.portal-menus ul[dnd-list],.portal-menus ul[dnd-list]>li{position:relative}.portal-menus ul[dnd-list]{min-height:42px;padding-left:0}.portal-menus ul[dnd-list] .dndDraggingSource{display:none}.portal-menus ul[dnd-list] .dndPlaceholder{display:block;background-color:#ddd;padding:10px 15px;min-height:42px}.portal-menus ul[dnd-list] li{background-color:#fff;border:1px solid #ddd;border-top-right-radius:4px;border-top-left-radius:4px;display:block;margin-bottom:-1px;position:relative;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.portal-menus ul[dnd-list] li dnd-nodrag{display:block;padding:10px 15px}.portal-menus .handle{cursor:move}#inputState,.btn,.btn-link,.round label,body .options .option{cursor:pointer}body,html{height:100%}.display-4{font-size:2rem!important}div[dnd-list],ul[dnd-list]{min-height:42px;padding-left:0}div[dnd-list] .dndDraggingSource,ul[dnd-list] .dndDraggingSource{display:none}div[dnd-list] .dndPlaceholder,ul[dnd-list] .dndPlaceholder{background-color:#ddd;display:block;min-height:42px}div[dnd-list] .dnd-item,ul[dnd-list] li{background-color:#fff;border:1px solid #ddd;border-top-right-radius:4px;border-top-left-radius:4px;display:block;padding:10px 15px;margin-bottom:-1px}div[dnd-list] .dnd-item.selected,ul[dnd-list] li.selected{background-color:#dff0d8;color:#3c763d}.md-avatar{vertical-align:middle;width:50px;height:50px}.mix-tree-view .container{padding-right:0;padding-left:25px}.mix-tree-view .dropdown-menu{z-index:99999}.mix-tree-view .item{padding-bottom:2px;border-left:1px #eee solid}.mix-tree-view .item-fields{padding:12px 8px 0 26px}.sw-search{margin-right:0!important;margin-left:0!important}.sw-sidebar a{color:var(--text-color,#212529)}.ActiveUsers.is-increasing{-webkit-animation:a 3s;animation:a 3s}.ActiveUsers.is-decreasing{-webkit-animation:b 3s;animation:b 3s}@-webkit-keyframes a{10%{background-color:#ebffeb;border-color:rgba(0,128,0,.5);color:green}}@keyframes a{10%{background-color:#ebffeb;border-color:rgba(0,128,0,.5);color:green}}@-webkit-keyframes b{10%{background-color:#ffebeb;border-color:rgba(255,0,0,.5);color:red}}@keyframes b{10%{background-color:#ffebeb;border-color:rgba(255,0,0,.5);color:red}}.Chartjs{font-size:.85em}.Chartjs-figure{height:250px}.Chartjs-legend{margin:0;padding:1em 0 0}.Chartjs-legend>li{display:inline-block;padding:.25em .5em}.Chartjs-legend>li>i{display:inline-block;height:1em;margin-right:.5em;vertical-align:-.1em;width:1em}@media (min-width:570px){.Chartjs-figure{margin-right:1.5em}}.attr-set-value-item:last-child{border-bottom:0!important}.custom-image{max-width:30vw}.mix-sel-icons .dropdown-menu{left:-90px!important}.mix-sel-icons .dropdown-menu.show{max-height:250px;overflow:scroll}.mix-sel-icons .list-icon{max-height:150px;overflow-y:scroll;overflow-x:hidden}#modal-posts img{height:30px}.monaco-editor-full{position:fixed!important;left:0;top:0;width:100%;z-index:2222}.monaco-editor-full .monaco-editor-btn-group-full{z-index:2223;position:fixed;top:15px;right:25px}.simpleDemo ul[dnd-list]{min-height:42px;padding-left:0}.simpleDemo ul[dnd-list] .dndDraggingSource{display:none}.simpleDemo ul[dnd-list] .dndPlaceholder{background-color:#ddd;display:block;min-height:42px}.simpleDemo ul[dnd-list] li{background-color:#fff;border:1px solid #ddd;border-top-right-radius:4px;border-top-left-radius:4px;display:block;padding:10px 15px;margin-bottom:-1px}.simpleDemo ul[dnd-list] li.selected{background-color:#dff0d8;color:#3c763d}@media(min-width:576px){.jumbotron{padding:2rem 1rem!important}}.alert.position-sticky{bottom:10px}.left-coloumn{padding:2rem}.bg-register-image{transition:background-image .2s ease-in-out;background-image:url(../mix-app/mix-app/assets/img/bgs/right-bg.png)}.input-site-name{background:0 0;border:none;border-bottom:1px solid #000;box-shadow:none;display:inline;width:200px;border-radius:0;padding:0}input.country-select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.label-country-select{position:relative}.label-country-select:after{content:"\f107";font-family:FontAwesome;font-size:16px;right:4px;padding:0 0 2px;position:absolute;pointer-events:none}.hr-text:before,.label-country-select:before,.round label:after{content:""}.label-country-select:before{right:4px;top:0;width:16px;height:16px;background:#fff;position:absolute;pointer-events:none;display:block}@media only screen and (min-width:1200px){.card-header-nav-pills{margin-bottom:20px}}.content{width:100%;display:flex;align-items:center;flex-direction:column;background:0 0}.content>div{min-width:400px}.website-configuration{position:relative;margin-top:6%}.label-using{font-size:1.9rem}.bg-register-image{background-position:bottom;background-repeat:no-repeat;background-size:cover}.intruction-labels{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left}.country-select{background:0 0!important}.round{position:relative}.round label{background-color:#fff;border:1px solid #ccc;border-radius:50%;height:40px;left:0;position:absolute;top:0;width:40px}.round label:after{border:2px solid #fff;border-top:none;border-right:none;height:9px;left:11px;opacity:0;position:absolute;top:12px;transform:rotate(-45deg);width:17px}body .credit,body .options .option.active .label{bottom:20px;left:20px}.round input[type=checkbox]{visibility:hidden}.round input[type=checkbox]:checked+label{background-color:#66bb6a;border-color:#66bb6a}.round input[type=checkbox]:checked+label:after{opacity:1}body.app-init{display:flex;flex-direction:row;justify-content:center;align-items:center;overflow:hidden;height:100vh}@media only screen and (max-width:600px){.left-coloumn{padding:1rem}body.app-init{display:unset;flex-direction:unset;justify-content:unset;align-items:unset;overflow:scroll}.container.init-pages{padding-top:4%}}body .credit{position:absolute;color:#000}body .options{display:flex;flex-direction:row;align-items:stretch;overflow:hidden;min-width:100%;max-width:100%;height:400px}body .options .option{position:relative;overflow:hidden;min-width:60px;margin:10px 5px;background:var(--optionBackground,var(--defaultBackground,#e6e9ed));background-size:auto 120%;background-position:center;transition:.5s cubic-bezier(.05,.61,.41,.95)}body .options .option .label,body .options .option .shadow{position:absolute;right:0;transition:.5s cubic-bezier(.05,.61,.41,.95)}body .options .option:nth-child(1){--defaultBackground:#ed5565}body .options .option:nth-child(2){--defaultBackground:#fc6e51}body .options .option:nth-child(3){--defaultBackground:#ffce54}body .options .option:nth-child(4){--defaultBackground:#2ecc71}body .options .option:nth-child(5){--defaultBackground:#5d9cec}body .options .option:nth-child(6){--defaultBackground:#ac92ec}body .options .option.active{flex-grow:10000;-webkit-transform:scale(1);transform:scale(1);max-width:600px;margin:0 5px;border-radius:40px;background-size:auto 100%}body .options .option.active .shadow{box-shadow:inset 0 -120px 120px -120px #000,inset 0 -120px 120px -100px #000}body .options .option.active .label .info>div{left:0;opacity:1}body .options .option:not(.active){flex-grow:1;border-radius:30px}body .options .option:not(.active) .shadow{bottom:-40px;box-shadow:inset 0 -120px 0 -120px #000,inset 0 -120px 0 -100px #000}body .options .option:not(.active) .label{bottom:10px;left:10px}body .options .option:not(.active) .label .info>div{left:20px;opacity:0}body .options .option .shadow{bottom:0;left:0;height:400px;cursor:pointer}body .options .option .label{display:flex;height:40px}body .options .option .label .icon{display:flex;flex-direction:row;justify-content:center;align-items:center;min-width:40px;max-width:40px;height:40px;border-radius:100%;background-color:#fff;color:var(--defaultBackground)}body .options .option .label .info{display:flex;flex-direction:column;justify-content:center;margin-left:35px;color:#fff}body .options .option .label .info>div{position:relative;transition:.5s cubic-bezier(.05,.61,.41,.95),opacity .5s ease-out}body .options .option .label .info .main{font-weight:700;font-size:1.2rem}body .options .option .label .info .sub{transition-delay:.1s}.hr-text{line-height:1em;position:relative;border:0;color:#000;text-align:center;height:1.5em;opacity:.5}.hr-text:before{background:linear-gradient(to right,transparent,#818078,transparent);position:absolute;left:0;top:50%;width:100%;height:1px}.hr-text:after{content:attr(data-content);position:relative;display:inline-block;padding:0 .5em;line-height:1.5em;color:#212529;background-color:#fcfcfa}body::after,body::before{content:"";top:0;left:0;right:0;position:fixed;z-index:-1;bottom:0}body{display:grid;background-color:#000;height:100%}body::before{background:url(/mix-app/img/background.jpg) right top no-repeat fixed #000;opacity:.8;background-size:cover}body::after{background:right top no-repeat fixed #000;opacity:.5;background-size:cover;filter:blur(8px);-webkit-filter:blur(8px)}.flag-icon,.flag-icon-background{background-size:contain;background-position:50%;background-repeat:no-repeat}hr{border:none!important}.container{grid-template-columns:40px 50px auto 50px 40px;grid-template-rows:25% 100px auto}.form-init{width:100%;max-width:530px;padding:15px;margin:auto}mix-module-data-table .data-table .header{padding:5px;color:#495057;background-color:hsla(var(--primary-color-hue,211),100%,50%,.075);border-color:#dee2e6;font-weight:400;font-size:small}mix-module-data-table .preview-container{max-height:4em;overflow:hidden}upload-croppie .cr-boundary{overflow:hidden}main-side-bar-dynamic .sw-sidebar .sw-toc-item{position:relative}main-side-bar-dynamic .sw-sidebar .sw-toc-item .sw-toc-link .sw-toc-link{padding-left:0}main-side-bar-dynamic .sw-sidebar .sw-toc-item .btn-group{right:20px;opacity:1}main-side-bar-dynamic .sw-sidebar ul{padding-left:15px}main-side-bar-dynamic .sw-sidebar .sw-toc-sub-link .btn-group{padding:2px 0}@media (min-width:992px){#modal-content-filter .modal-lg,#modal-content-filter .modal-xl{max-width:80vw}}.img-container>img,.img-preview>img{max-width:100%}.img-container,.img-preview{background-color:#f7f7f7;text-align:center;width:100%}.img-container{margin-bottom:1rem;max-height:497px;min-height:200px}.docs-data>.input-group,.docs-toggles>.btn,.docs-toggles>.btn-group,.docs-toggles>.dropdown,.img-preview{margin-bottom:.5rem}@media (min-width:768px){.img-container{min-height:497px}}.docs-preview{margin-right:-1rem}.img-preview{float:left;margin-right:.5rem;overflow:hidden}.preview-lg{height:9rem;width:16rem}.preview-md{height:4.5rem;width:8rem}.preview-sm{height:2.25rem;width:4rem}.preview-xs{height:1.125rem;margin-right:0;width:2rem}.docs-data>.input-group>label{justify-content:center;min-width:5rem}.docs-data>.input-group>span{justify-content:center;min-width:3rem}.docs-buttons>.btn,.docs-buttons>.btn-group,.docs-buttons>.form-control{margin-bottom:.5rem;margin-right:.25rem}.custom-file-val{position:absolute;bottom:0}.sw-content{width:100%!important}input[type=date]::-webkit-inner-spin-button{display:none}.ace_razor{background-color:#ff0}.ace_punctuation.ace_block.ace_razor,.ace_punctuation.ace_short.ace_razor{color:#000}@media screen and (max-width:580px){.hide-on-mb{display:none}}#modal-files img{height:30px}#modal-files img.preview{width:100%;height:auto}@media screen and (min-width:580px){.hide-on-desktop{display:none}}@media screen and (max-width:991px){.navbar .navbar-nav{min-height:unset}}@font-face{font-family:'Nucleo Outline';src:url(../fonts/nucleo-outline.eot);src:url(../fonts/nucleo-outline.eot) format("embedded-opentype"),url(../fonts/nucleo-outline.woff2) format("woff2"),url(../fonts/nucleo-outline.woff) format("woff"),url(../fonts/nucleo-outline.ttf) format("truetype"),url(../fonts/nucleo-outline.svg) format("svg");font-weight:400;font-style:normal}.now-ui-icons{display:inline-block;font:normal normal normal 14px/1 'Nucleo Outline';font-size:inherit;speak:none;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.now-ui-icons.circle{padding:.33333333em;vertical-align:-16%;background-color:#eee;border-radius:50%}.nc-icon-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.nc-icon-ul>li{position:relative}.nc-icon-ul>li>.now-ui-icons{position:absolute;left:-1.57142857em;top:.14285714em;text-align:center}.nc-icon-ul>li>.now-ui-icons.circle{top:-.19047619em;left:-1.9047619em}.now-ui-icons.spin{-webkit-animation:nc-icon-spin 2s infinite linear;-moz-animation:nc-icon-spin 2s infinite linear;animation:nc-icon-spin 2s infinite linear}@-webkit-keyframes nc-icon-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes nc-icon-spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(360deg)}}@keyframes nc-icon-spin{0%{-webkit-transform:rotate(0);-moz-transform:rotate(0);-ms-transform:rotate(0);-o-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.now-ui-icons.ui-1_check:before{content:"\ea22"}.now-ui-icons.ui-1_email-85:before{content:"\ea2a"}.now-ui-icons.arrows-1_cloud-download-93:before{content:"\ea21"}.now-ui-icons.arrows-1_cloud-upload-94:before{content:"\ea24"}.now-ui-icons.arrows-1_minimal-down:before{content:"\ea39"}.now-ui-icons.arrows-1_minimal-left:before{content:"\ea3a"}.now-ui-icons.arrows-1_minimal-right:before{content:"\ea3b"}.now-ui-icons.arrows-1_minimal-up:before{content:"\ea3c"}.now-ui-icons.arrows-1_refresh-69:before{content:"\ea44"}.now-ui-icons.arrows-1_share-66:before{content:"\ea4c"}.now-ui-icons.business_badge:before{content:"\ea09"}.now-ui-icons.business_bank:before{content:"\ea0a"}.now-ui-icons.business_briefcase-24:before{content:"\ea13"}.now-ui-icons.business_bulb-63:before{content:"\ea15"}.now-ui-icons.business_chart-bar-32:before{content:"\ea1e"}.now-ui-icons.business_chart-pie-36:before{content:"\ea1f"}.now-ui-icons.business_globe:before{content:"\ea2f"}.now-ui-icons.business_money-coins:before{content:"\ea40"}.now-ui-icons.clothes_tie-bow:before{content:"\ea5b"}.now-ui-icons.design_vector:before{content:"\ea61"}.now-ui-icons.design_app:before{content:"\ea08"}.now-ui-icons.design_bullet-list-67:before{content:"\ea14"}.now-ui-icons.design_image:before{content:"\ea33"}.now-ui-icons.design_palette:before{content:"\ea41"}.now-ui-icons.design_scissors:before{content:"\ea4a"}.now-ui-icons.design-2_html5:before{content:"\ea32"}.now-ui-icons.design-2_ruler-pencil:before{content:"\ea48"}.now-ui-icons.emoticons_satisfied:before{content:"\ea49"}.now-ui-icons.files_box:before{content:"\ea12"}.now-ui-icons.files_paper:before{content:"\ea43"}.now-ui-icons.files_single-copy-04:before{content:"\ea52"}.now-ui-icons.health_ambulance:before{content:"\ea07"}.now-ui-icons.loader_gear:before{content:"\ea4e"}.now-ui-icons.loader_refresh:before{content:"\ea44"}.now-ui-icons.location_bookmark:before{content:"\ea10"}.now-ui-icons.location_compass-05:before{content:"\ea25"}.now-ui-icons.location_map-big:before{content:"\ea3d"}.now-ui-icons.location_pin:before{content:"\ea47"}.now-ui-icons.location_world:before{content:"\ea63"}.now-ui-icons.media-1_album:before{content:"\ea02"}.now-ui-icons.media-1_button-pause:before{content:"\ea16"}.now-ui-icons.media-1_button-play:before{content:"\ea18"}.now-ui-icons.media-1_button-power:before{content:"\ea19"}.now-ui-icons.media-1_camera-compact:before{content:"\ea1c"}.now-ui-icons.media-2_note-03:before{content:"\ea3f"}.now-ui-icons.media-2_sound-wave:before{content:"\ea57"}.now-ui-icons.objects_diamond:before{content:"\ea29"}.now-ui-icons.objects_globe:before{content:"\ea2f"}.now-ui-icons.objects_key-25:before{content:"\ea38"}.now-ui-icons.objects_planet:before{content:"\ea46"}.now-ui-icons.objects_spaceship:before{content:"\ea55"}.now-ui-icons.objects_support-17:before{content:"\ea56"}.now-ui-icons.objects_umbrella-13:before{content:"\ea5f"}.now-ui-icons.education_agenda-bookmark:before{content:"\ea01"}.now-ui-icons.education_atom:before{content:"\ea0c"}.now-ui-icons.education_glasses:before{content:"\ea2d"}.now-ui-icons.education_hat:before{content:"\ea30"}.now-ui-icons.education_paper:before{content:"\ea42"}.now-ui-icons.shopping_bag-16:before{content:"\ea0d"}.now-ui-icons.shopping_basket:before{content:"\ea0b"}.now-ui-icons.shopping_box:before{content:"\ea11"}.now-ui-icons.shopping_cart-simple:before{content:"\ea1d"}.now-ui-icons.shopping_credit-card:before{content:"\ea28"}.now-ui-icons.shopping_delivery-fast:before{content:"\ea27"}.now-ui-icons.shopping_shop:before{content:"\ea50"}.now-ui-icons.shopping_tag-content:before{content:"\ea59"}.now-ui-icons.sport_trophy:before{content:"\ea5d"}.now-ui-icons.sport_user-run:before{content:"\ea60"}.now-ui-icons.tech_controller-modern:before{content:"\ea26"}.now-ui-icons.tech_headphones:before{content:"\ea31"}.now-ui-icons.tech_laptop:before{content:"\ea36"}.now-ui-icons.tech_mobile:before{content:"\ea3e"}.now-ui-icons.tech_tablet:before{content:"\ea58"}.now-ui-icons.tech_tv:before{content:"\ea5e"}.now-ui-icons.tech_watch-time:before{content:"\ea62"}.now-ui-icons.text_align-center:before{content:"\ea05"}.now-ui-icons.text_align-left:before{content:"\ea06"}.now-ui-icons.text_bold:before{content:"\ea0e"}.now-ui-icons.text_caps-small:before{content:"\ea1b"}.now-ui-icons.gestures_tap-01:before{content:"\ea5a"}.now-ui-icons.transportation_air-baloon:before{content:"\ea03"}.now-ui-icons.transportation_bus-front-12:before{content:"\ea17"}.now-ui-icons.travel_info:before{content:"\ea04"}.now-ui-icons.travel_istanbul:before{content:"\ea34"}.now-ui-icons.ui-1_bell-53:before{content:"\ea0f"}.now-ui-icons.ui-1_calendar-60:before{content:"\ea1a"}.now-ui-icons.ui-1_lock-circle-open:before{content:"\ea35"}.now-ui-icons.ui-1_send:before{content:"\ea4d"}.now-ui-icons.ui-1_settings-gear-63:before{content:"\ea4e"}.now-ui-icons.ui-1_simple-add:before{content:"\ea4f"}.now-ui-icons.ui-1_simple-delete:before{content:"\ea54"}.now-ui-icons.ui-1_simple-remove:before{content:"\ea53"}.now-ui-icons.ui-1_zoom-bold:before{content:"\ea64"}.now-ui-icons.ui-2_chat-round:before{content:"\ea20"}.now-ui-icons.ui-2_favourite-28:before{content:"\ea2b"}.now-ui-icons.ui-2_like:before{content:"\ea37"}.now-ui-icons.ui-2_settings-90:before{content:"\ea4b"}.now-ui-icons.ui-2_time-alarm:before{content:"\ea5c"}.now-ui-icons.users_circle-08:before{content:"\ea23"}.now-ui-icons.users_single-02:before{content:"\ea51"}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon.flag-icon-squared{width:1em}.flag-icon-ad{background-image:url(../flags/4x3/ad.svg)}.flag-icon-ad.flag-icon-squared{background-image:url(../flags/1x1/ad.svg)}.flag-icon-ae{background-image:url(../flags/4x3/ae.svg)}.flag-icon-ae.flag-icon-squared{background-image:url(../flags/1x1/ae.svg)}.flag-icon-af{background-image:url(../flags/4x3/af.svg)}.flag-icon-af.flag-icon-squared{background-image:url(../flags/1x1/af.svg)}.flag-icon-ag{background-image:url(../flags/4x3/ag.svg)}.flag-icon-ag.flag-icon-squared{background-image:url(../flags/1x1/ag.svg)}.flag-icon-ai{background-image:url(../flags/4x3/ai.svg)}.flag-icon-ai.flag-icon-squared{background-image:url(../flags/1x1/ai.svg)}.flag-icon-al{background-image:url(../flags/4x3/al.svg)}.flag-icon-al.flag-icon-squared{background-image:url(../flags/1x1/al.svg)}.flag-icon-am{background-image:url(../flags/4x3/am.svg)}.flag-icon-am.flag-icon-squared{background-image:url(../flags/1x1/am.svg)}.flag-icon-ao{background-image:url(../flags/4x3/ao.svg)}.flag-icon-ao.flag-icon-squared{background-image:url(../flags/1x1/ao.svg)}.flag-icon-aq{background-image:url(../flags/4x3/aq.svg)}.flag-icon-aq.flag-icon-squared{background-image:url(../flags/1x1/aq.svg)}.flag-icon-ar{background-image:url(../flags/4x3/ar.svg)}.flag-icon-ar.flag-icon-squared{background-image:url(../flags/1x1/ar.svg)}.flag-icon-as{background-image:url(../flags/4x3/as.svg)}.flag-icon-as.flag-icon-squared{background-image:url(../flags/1x1/as.svg)}.flag-icon-at{background-image:url(../flags/4x3/at.svg)}.flag-icon-at.flag-icon-squared{background-image:url(../flags/1x1/at.svg)}.flag-icon-au{background-image:url(../flags/4x3/au.svg)}.flag-icon-au.flag-icon-squared{background-image:url(../flags/1x1/au.svg)}.flag-icon-aw{background-image:url(../flags/4x3/aw.svg)}.flag-icon-aw.flag-icon-squared{background-image:url(../flags/1x1/aw.svg)}.flag-icon-ax{background-image:url(../flags/4x3/ax.svg)}.flag-icon-ax.flag-icon-squared{background-image:url(../flags/1x1/ax.svg)}.flag-icon-az{background-image:url(../flags/4x3/az.svg)}.flag-icon-az.flag-icon-squared{background-image:url(../flags/1x1/az.svg)}.flag-icon-ba{background-image:url(../flags/4x3/ba.svg)}.flag-icon-ba.flag-icon-squared{background-image:url(../flags/1x1/ba.svg)}.flag-icon-bb{background-image:url(../flags/4x3/bb.svg)}.flag-icon-bb.flag-icon-squared{background-image:url(../flags/1x1/bb.svg)}.flag-icon-bd{background-image:url(../flags/4x3/bd.svg)}.flag-icon-bd.flag-icon-squared{background-image:url(../flags/1x1/bd.svg)}.flag-icon-be{background-image:url(../flags/4x3/be.svg)}.flag-icon-be.flag-icon-squared{background-image:url(../flags/1x1/be.svg)}.flag-icon-bf{background-image:url(../flags/4x3/bf.svg)}.flag-icon-bf.flag-icon-squared{background-image:url(../flags/1x1/bf.svg)}.flag-icon-bg{background-image:url(../flags/4x3/bg.svg)}.flag-icon-bg.flag-icon-squared{background-image:url(../flags/1x1/bg.svg)}.flag-icon-bh{background-image:url(../flags/4x3/bh.svg)}.flag-icon-bh.flag-icon-squared{background-image:url(../flags/1x1/bh.svg)}.flag-icon-bi{background-image:url(../flags/4x3/bi.svg)}.flag-icon-bi.flag-icon-squared{background-image:url(../flags/1x1/bi.svg)}.flag-icon-bj{background-image:url(../flags/4x3/bj.svg)}.flag-icon-bj.flag-icon-squared{background-image:url(../flags/1x1/bj.svg)}.flag-icon-bl{background-image:url(../flags/4x3/bl.svg)}.flag-icon-bl.flag-icon-squared{background-image:url(../flags/1x1/bl.svg)}.flag-icon-bm{background-image:url(../flags/4x3/bm.svg)}.flag-icon-bm.flag-icon-squared{background-image:url(../flags/1x1/bm.svg)}.flag-icon-bn{background-image:url(../flags/4x3/bn.svg)}.flag-icon-bn.flag-icon-squared{background-image:url(../flags/1x1/bn.svg)}.flag-icon-bo{background-image:url(../flags/4x3/bo.svg)}.flag-icon-bo.flag-icon-squared{background-image:url(../flags/1x1/bo.svg)}.flag-icon-bq{background-image:url(../flags/4x3/bq.svg)}.flag-icon-bq.flag-icon-squared{background-image:url(../flags/1x1/bq.svg)}.flag-icon-br{background-image:url(../flags/4x3/br.svg)}.flag-icon-br.flag-icon-squared{background-image:url(../flags/1x1/br.svg)}.flag-icon-bs{background-image:url(../flags/4x3/bs.svg)}.flag-icon-bs.flag-icon-squared{background-image:url(../flags/1x1/bs.svg)}.flag-icon-bt{background-image:url(../flags/4x3/bt.svg)}.flag-icon-bt.flag-icon-squared{background-image:url(../flags/1x1/bt.svg)}.flag-icon-bv{background-image:url(../flags/4x3/bv.svg)}.flag-icon-bv.flag-icon-squared{background-image:url(../flags/1x1/bv.svg)}.flag-icon-bw{background-image:url(../flags/4x3/bw.svg)}.flag-icon-bw.flag-icon-squared{background-image:url(../flags/1x1/bw.svg)}.flag-icon-by{background-image:url(../flags/4x3/by.svg)}.flag-icon-by.flag-icon-squared{background-image:url(../flags/1x1/by.svg)}.flag-icon-bz{background-image:url(../flags/4x3/bz.svg)}.flag-icon-bz.flag-icon-squared{background-image:url(../flags/1x1/bz.svg)}.flag-icon-ca{background-image:url(../flags/4x3/ca.svg)}.flag-icon-ca.flag-icon-squared{background-image:url(../flags/1x1/ca.svg)}.flag-icon-cc{background-image:url(../flags/4x3/cc.svg)}.flag-icon-cc.flag-icon-squared{background-image:url(../flags/1x1/cc.svg)}.flag-icon-cd{background-image:url(../flags/4x3/cd.svg)}.flag-icon-cd.flag-icon-squared{background-image:url(../flags/1x1/cd.svg)}.flag-icon-cf{background-image:url(../flags/4x3/cf.svg)}.flag-icon-cf.flag-icon-squared{background-image:url(../flags/1x1/cf.svg)}.flag-icon-cg{background-image:url(../flags/4x3/cg.svg)}.flag-icon-cg.flag-icon-squared{background-image:url(../flags/1x1/cg.svg)}.flag-icon-ch{background-image:url(../flags/4x3/ch.svg)}.flag-icon-ch.flag-icon-squared{background-image:url(../flags/1x1/ch.svg)}.flag-icon-ci{background-image:url(../flags/4x3/ci.svg)}.flag-icon-ci.flag-icon-squared{background-image:url(../flags/1x1/ci.svg)}.flag-icon-ck{background-image:url(../flags/4x3/ck.svg)}.flag-icon-ck.flag-icon-squared{background-image:url(../flags/1x1/ck.svg)}.flag-icon-cl{background-image:url(../flags/4x3/cl.svg)}.flag-icon-cl.flag-icon-squared{background-image:url(../flags/1x1/cl.svg)}.flag-icon-cm{background-image:url(../flags/4x3/cm.svg)}.flag-icon-cm.flag-icon-squared{background-image:url(../flags/1x1/cm.svg)}.flag-icon-cn{background-image:url(../flags/4x3/cn.svg)}.flag-icon-cn.flag-icon-squared{background-image:url(../flags/1x1/cn.svg)}.flag-icon-co{background-image:url(../flags/4x3/co.svg)}.flag-icon-co.flag-icon-squared{background-image:url(../flags/1x1/co.svg)}.flag-icon-cr{background-image:url(../flags/4x3/cr.svg)}.flag-icon-cr.flag-icon-squared{background-image:url(../flags/1x1/cr.svg)}.flag-icon-cu{background-image:url(../flags/4x3/cu.svg)}.flag-icon-cu.flag-icon-squared{background-image:url(../flags/1x1/cu.svg)}.flag-icon-cv{background-image:url(../flags/4x3/cv.svg)}.flag-icon-cv.flag-icon-squared{background-image:url(../flags/1x1/cv.svg)}.flag-icon-cw{background-image:url(../flags/4x3/cw.svg)}.flag-icon-cw.flag-icon-squared{background-image:url(../flags/1x1/cw.svg)}.flag-icon-cx{background-image:url(../flags/4x3/cx.svg)}.flag-icon-cx.flag-icon-squared{background-image:url(../flags/1x1/cx.svg)}.flag-icon-cy{background-image:url(../flags/4x3/cy.svg)}.flag-icon-cy.flag-icon-squared{background-image:url(../flags/1x1/cy.svg)}.flag-icon-cz{background-image:url(../flags/4x3/cz.svg)}.flag-icon-cz.flag-icon-squared{background-image:url(../flags/1x1/cz.svg)}.flag-icon-de{background-image:url(../flags/4x3/de.svg)}.flag-icon-de.flag-icon-squared{background-image:url(../flags/1x1/de.svg)}.flag-icon-dj{background-image:url(../flags/4x3/dj.svg)}.flag-icon-dj.flag-icon-squared{background-image:url(../flags/1x1/dj.svg)}.flag-icon-dk{background-image:url(../flags/4x3/dk.svg)}.flag-icon-dk.flag-icon-squared{background-image:url(../flags/1x1/dk.svg)}.flag-icon-dm{background-image:url(../flags/4x3/dm.svg)}.flag-icon-dm.flag-icon-squared{background-image:url(../flags/1x1/dm.svg)}.flag-icon-do{background-image:url(../flags/4x3/do.svg)}.flag-icon-do.flag-icon-squared{background-image:url(../flags/1x1/do.svg)}.flag-icon-dz{background-image:url(../flags/4x3/dz.svg)}.flag-icon-dz.flag-icon-squared{background-image:url(../flags/1x1/dz.svg)}.flag-icon-ec{background-image:url(../flags/4x3/ec.svg)}.flag-icon-ec.flag-icon-squared{background-image:url(../flags/1x1/ec.svg)}.flag-icon-ee{background-image:url(../flags/4x3/ee.svg)}.flag-icon-ee.flag-icon-squared{background-image:url(../flags/1x1/ee.svg)}.flag-icon-eg{background-image:url(../flags/4x3/eg.svg)}.flag-icon-eg.flag-icon-squared{background-image:url(../flags/1x1/eg.svg)}.flag-icon-eh{background-image:url(../flags/4x3/eh.svg)}.flag-icon-eh.flag-icon-squared{background-image:url(../flags/1x1/eh.svg)}.flag-icon-er{background-image:url(../flags/4x3/er.svg)}.flag-icon-er.flag-icon-squared{background-image:url(../flags/1x1/er.svg)}.flag-icon-es{background-image:url(../flags/4x3/es.svg)}.flag-icon-es.flag-icon-squared{background-image:url(../flags/1x1/es.svg)}.flag-icon-et{background-image:url(../flags/4x3/et.svg)}.flag-icon-et.flag-icon-squared{background-image:url(../flags/1x1/et.svg)}.flag-icon-fi{background-image:url(../flags/4x3/fi.svg)}.flag-icon-fi.flag-icon-squared{background-image:url(../flags/1x1/fi.svg)}.flag-icon-fj{background-image:url(../flags/4x3/fj.svg)}.flag-icon-fj.flag-icon-squared{background-image:url(../flags/1x1/fj.svg)}.flag-icon-fk{background-image:url(../flags/4x3/fk.svg)}.flag-icon-fk.flag-icon-squared{background-image:url(../flags/1x1/fk.svg)}.flag-icon-fm{background-image:url(../flags/4x3/fm.svg)}.flag-icon-fm.flag-icon-squared{background-image:url(../flags/1x1/fm.svg)}.flag-icon-fo{background-image:url(../flags/4x3/fo.svg)}.flag-icon-fo.flag-icon-squared{background-image:url(../flags/1x1/fo.svg)}.flag-icon-fr{background-image:url(../flags/4x3/fr.svg)}.flag-icon-fr.flag-icon-squared{background-image:url(../flags/1x1/fr.svg)}.flag-icon-ga{background-image:url(../flags/4x3/ga.svg)}.flag-icon-ga.flag-icon-squared{background-image:url(../flags/1x1/ga.svg)}.flag-icon-gb{background-image:url(../flags/4x3/gb.svg)}.flag-icon-gb.flag-icon-squared{background-image:url(../flags/1x1/gb.svg)}.flag-icon-gd{background-image:url(../flags/4x3/gd.svg)}.flag-icon-gd.flag-icon-squared{background-image:url(../flags/1x1/gd.svg)}.flag-icon-ge{background-image:url(../flags/4x3/ge.svg)}.flag-icon-ge.flag-icon-squared{background-image:url(../flags/1x1/ge.svg)}.flag-icon-gf{background-image:url(../flags/4x3/gf.svg)}.flag-icon-gf.flag-icon-squared{background-image:url(../flags/1x1/gf.svg)}.flag-icon-gg{background-image:url(../flags/4x3/gg.svg)}.flag-icon-gg.flag-icon-squared{background-image:url(../flags/1x1/gg.svg)}.flag-icon-gh{background-image:url(../flags/4x3/gh.svg)}.flag-icon-gh.flag-icon-squared{background-image:url(../flags/1x1/gh.svg)}.flag-icon-gi{background-image:url(../flags/4x3/gi.svg)}.flag-icon-gi.flag-icon-squared{background-image:url(../flags/1x1/gi.svg)}.flag-icon-gl{background-image:url(../flags/4x3/gl.svg)}.flag-icon-gl.flag-icon-squared{background-image:url(../flags/1x1/gl.svg)}.flag-icon-gm{background-image:url(../flags/4x3/gm.svg)}.flag-icon-gm.flag-icon-squared{background-image:url(../flags/1x1/gm.svg)}.flag-icon-gn{background-image:url(../flags/4x3/gn.svg)}.flag-icon-gn.flag-icon-squared{background-image:url(../flags/1x1/gn.svg)}.flag-icon-gp{background-image:url(../flags/4x3/gp.svg)}.flag-icon-gp.flag-icon-squared{background-image:url(../flags/1x1/gp.svg)}.flag-icon-gq{background-image:url(../flags/4x3/gq.svg)}.flag-icon-gq.flag-icon-squared{background-image:url(../flags/1x1/gq.svg)}.flag-icon-gr{background-image:url(../flags/4x3/gr.svg)}.flag-icon-gr.flag-icon-squared{background-image:url(../flags/1x1/gr.svg)}.flag-icon-gs{background-image:url(../flags/4x3/gs.svg)}.flag-icon-gs.flag-icon-squared{background-image:url(../flags/1x1/gs.svg)}.flag-icon-gt{background-image:url(../flags/4x3/gt.svg)}.flag-icon-gt.flag-icon-squared{background-image:url(../flags/1x1/gt.svg)}.flag-icon-gu{background-image:url(../flags/4x3/gu.svg)}.flag-icon-gu.flag-icon-squared{background-image:url(../flags/1x1/gu.svg)}.flag-icon-gw{background-image:url(../flags/4x3/gw.svg)}.flag-icon-gw.flag-icon-squared{background-image:url(../flags/1x1/gw.svg)}.flag-icon-gy{background-image:url(../flags/4x3/gy.svg)}.flag-icon-gy.flag-icon-squared{background-image:url(../flags/1x1/gy.svg)}.flag-icon-hk{background-image:url(../flags/4x3/hk.svg)}.flag-icon-hk.flag-icon-squared{background-image:url(../flags/1x1/hk.svg)}.flag-icon-hm{background-image:url(../flags/4x3/hm.svg)}.flag-icon-hm.flag-icon-squared{background-image:url(../flags/1x1/hm.svg)}.flag-icon-hn{background-image:url(../flags/4x3/hn.svg)}.flag-icon-hn.flag-icon-squared{background-image:url(../flags/1x1/hn.svg)}.flag-icon-hr{background-image:url(../flags/4x3/hr.svg)}.flag-icon-hr.flag-icon-squared{background-image:url(../flags/1x1/hr.svg)}.flag-icon-ht{background-image:url(../flags/4x3/ht.svg)}.flag-icon-ht.flag-icon-squared{background-image:url(../flags/1x1/ht.svg)}.flag-icon-hu{background-image:url(../flags/4x3/hu.svg)}.flag-icon-hu.flag-icon-squared{background-image:url(../flags/1x1/hu.svg)}.flag-icon-id{background-image:url(../flags/4x3/id.svg)}.flag-icon-id.flag-icon-squared{background-image:url(../flags/1x1/id.svg)}.flag-icon-ie{background-image:url(../flags/4x3/ie.svg)}.flag-icon-ie.flag-icon-squared{background-image:url(../flags/1x1/ie.svg)}.flag-icon-il{background-image:url(../flags/4x3/il.svg)}.flag-icon-il.flag-icon-squared{background-image:url(../flags/1x1/il.svg)}.flag-icon-im{background-image:url(../flags/4x3/im.svg)}.flag-icon-im.flag-icon-squared{background-image:url(../flags/1x1/im.svg)}.flag-icon-in{background-image:url(../flags/4x3/in.svg)}.flag-icon-in.flag-icon-squared{background-image:url(../flags/1x1/in.svg)}.flag-icon-io{background-image:url(../flags/4x3/io.svg)}.flag-icon-io.flag-icon-squared{background-image:url(../flags/1x1/io.svg)}.flag-icon-iq{background-image:url(../flags/4x3/iq.svg)}.flag-icon-iq.flag-icon-squared{background-image:url(../flags/1x1/iq.svg)}.flag-icon-ir{background-image:url(../flags/4x3/ir.svg)}.flag-icon-ir.flag-icon-squared{background-image:url(../flags/1x1/ir.svg)}.flag-icon-is{background-image:url(../flags/4x3/is.svg)}.flag-icon-is.flag-icon-squared{background-image:url(../flags/1x1/is.svg)}.flag-icon-it{background-image:url(../flags/4x3/it.svg)}.flag-icon-it.flag-icon-squared{background-image:url(../flags/1x1/it.svg)}.flag-icon-je{background-image:url(../flags/4x3/je.svg)}.flag-icon-je.flag-icon-squared{background-image:url(../flags/1x1/je.svg)}.flag-icon-jm{background-image:url(../flags/4x3/jm.svg)}.flag-icon-jm.flag-icon-squared{background-image:url(../flags/1x1/jm.svg)}.flag-icon-jo{background-image:url(../flags/4x3/jo.svg)}.flag-icon-jo.flag-icon-squared{background-image:url(../flags/1x1/jo.svg)}.flag-icon-jp{background-image:url(../flags/4x3/jp.svg)}.flag-icon-jp.flag-icon-squared{background-image:url(../flags/1x1/jp.svg)}.flag-icon-ke{background-image:url(../flags/4x3/ke.svg)}.flag-icon-ke.flag-icon-squared{background-image:url(../flags/1x1/ke.svg)}.flag-icon-kg{background-image:url(../flags/4x3/kg.svg)}.flag-icon-kg.flag-icon-squared{background-image:url(../flags/1x1/kg.svg)}.flag-icon-kh{background-image:url(../flags/4x3/kh.svg)}.flag-icon-kh.flag-icon-squared{background-image:url(../flags/1x1/kh.svg)}.flag-icon-ki{background-image:url(../flags/4x3/ki.svg)}.flag-icon-ki.flag-icon-squared{background-image:url(../flags/1x1/ki.svg)}.flag-icon-km{background-image:url(../flags/4x3/km.svg)}.flag-icon-km.flag-icon-squared{background-image:url(../flags/1x1/km.svg)}.flag-icon-kn{background-image:url(../flags/4x3/kn.svg)}.flag-icon-kn.flag-icon-squared{background-image:url(../flags/1x1/kn.svg)}.flag-icon-kp{background-image:url(../flags/4x3/kp.svg)}.flag-icon-kp.flag-icon-squared{background-image:url(../flags/1x1/kp.svg)}.flag-icon-kr{background-image:url(../flags/4x3/kr.svg)}.flag-icon-kr.flag-icon-squared{background-image:url(../flags/1x1/kr.svg)}.flag-icon-kw{background-image:url(../flags/4x3/kw.svg)}.flag-icon-kw.flag-icon-squared{background-image:url(../flags/1x1/kw.svg)}.flag-icon-ky{background-image:url(../flags/4x3/ky.svg)}.flag-icon-ky.flag-icon-squared{background-image:url(../flags/1x1/ky.svg)}.flag-icon-kz{background-image:url(../flags/4x3/kz.svg)}.flag-icon-kz.flag-icon-squared{background-image:url(../flags/1x1/kz.svg)}.flag-icon-la{background-image:url(../flags/4x3/la.svg)}.flag-icon-la.flag-icon-squared{background-image:url(../flags/1x1/la.svg)}.flag-icon-lb{background-image:url(../flags/4x3/lb.svg)}.flag-icon-lb.flag-icon-squared{background-image:url(../flags/1x1/lb.svg)}.flag-icon-lc{background-image:url(../flags/4x3/lc.svg)}.flag-icon-lc.flag-icon-squared{background-image:url(../flags/1x1/lc.svg)}.flag-icon-li{background-image:url(../flags/4x3/li.svg)}.flag-icon-li.flag-icon-squared{background-image:url(../flags/1x1/li.svg)}.flag-icon-lk{background-image:url(../flags/4x3/lk.svg)}.flag-icon-lk.flag-icon-squared{background-image:url(../flags/1x1/lk.svg)}.flag-icon-lr{background-image:url(../flags/4x3/lr.svg)}.flag-icon-lr.flag-icon-squared{background-image:url(../flags/1x1/lr.svg)}.flag-icon-ls{background-image:url(../flags/4x3/ls.svg)}.flag-icon-ls.flag-icon-squared{background-image:url(../flags/1x1/ls.svg)}.flag-icon-lt{background-image:url(../flags/4x3/lt.svg)}.flag-icon-lt.flag-icon-squared{background-image:url(../flags/1x1/lt.svg)}.flag-icon-lu{background-image:url(../flags/4x3/lu.svg)}.flag-icon-lu.flag-icon-squared{background-image:url(../flags/1x1/lu.svg)}.flag-icon-lv{background-image:url(../flags/4x3/lv.svg)}.flag-icon-lv.flag-icon-squared{background-image:url(../flags/1x1/lv.svg)}.flag-icon-ly{background-image:url(../flags/4x3/ly.svg)}.flag-icon-ly.flag-icon-squared{background-image:url(../flags/1x1/ly.svg)}.flag-icon-ma{background-image:url(../flags/4x3/ma.svg)}.flag-icon-ma.flag-icon-squared{background-image:url(../flags/1x1/ma.svg)}.flag-icon-mc{background-image:url(../flags/4x3/mc.svg)}.flag-icon-mc.flag-icon-squared{background-image:url(../flags/1x1/mc.svg)}.flag-icon-md{background-image:url(../flags/4x3/md.svg)}.flag-icon-md.flag-icon-squared{background-image:url(../flags/1x1/md.svg)}.flag-icon-me{background-image:url(../flags/4x3/me.svg)}.flag-icon-me.flag-icon-squared{background-image:url(../flags/1x1/me.svg)}.flag-icon-mf{background-image:url(../flags/4x3/mf.svg)}.flag-icon-mf.flag-icon-squared{background-image:url(../flags/1x1/mf.svg)}.flag-icon-mg{background-image:url(../flags/4x3/mg.svg)}.flag-icon-mg.flag-icon-squared{background-image:url(../flags/1x1/mg.svg)}.flag-icon-mh{background-image:url(../flags/4x3/mh.svg)}.flag-icon-mh.flag-icon-squared{background-image:url(../flags/1x1/mh.svg)}.flag-icon-mk{background-image:url(../flags/4x3/mk.svg)}.flag-icon-mk.flag-icon-squared{background-image:url(../flags/1x1/mk.svg)}.flag-icon-ml{background-image:url(../flags/4x3/ml.svg)}.flag-icon-ml.flag-icon-squared{background-image:url(../flags/1x1/ml.svg)}.flag-icon-mm{background-image:url(../flags/4x3/mm.svg)}.flag-icon-mm.flag-icon-squared{background-image:url(../flags/1x1/mm.svg)}.flag-icon-mn{background-image:url(../flags/4x3/mn.svg)}.flag-icon-mn.flag-icon-squared{background-image:url(../flags/1x1/mn.svg)}.flag-icon-mo{background-image:url(../flags/4x3/mo.svg)}.flag-icon-mo.flag-icon-squared{background-image:url(../flags/1x1/mo.svg)}.flag-icon-mp{background-image:url(../flags/4x3/mp.svg)}.flag-icon-mp.flag-icon-squared{background-image:url(../flags/1x1/mp.svg)}.flag-icon-mq{background-image:url(../flags/4x3/mq.svg)}.flag-icon-mq.flag-icon-squared{background-image:url(../flags/1x1/mq.svg)}.flag-icon-mr{background-image:url(../flags/4x3/mr.svg)}.flag-icon-mr.flag-icon-squared{background-image:url(../flags/1x1/mr.svg)}.flag-icon-ms{background-image:url(../flags/4x3/ms.svg)}.flag-icon-ms.flag-icon-squared{background-image:url(../flags/1x1/ms.svg)}.flag-icon-mt{background-image:url(../flags/4x3/mt.svg)}.flag-icon-mt.flag-icon-squared{background-image:url(../flags/1x1/mt.svg)}.flag-icon-mu{background-image:url(../flags/4x3/mu.svg)}.flag-icon-mu.flag-icon-squared{background-image:url(../flags/1x1/mu.svg)}.flag-icon-mv{background-image:url(../flags/4x3/mv.svg)}.flag-icon-mv.flag-icon-squared{background-image:url(../flags/1x1/mv.svg)}.flag-icon-mw{background-image:url(../flags/4x3/mw.svg)}.flag-icon-mw.flag-icon-squared{background-image:url(../flags/1x1/mw.svg)}.flag-icon-mx{background-image:url(../flags/4x3/mx.svg)}.flag-icon-mx.flag-icon-squared{background-image:url(../flags/1x1/mx.svg)}.flag-icon-my{background-image:url(../flags/4x3/my.svg)}.flag-icon-my.flag-icon-squared{background-image:url(../flags/1x1/my.svg)}.flag-icon-mz{background-image:url(../flags/4x3/mz.svg)}.flag-icon-mz.flag-icon-squared{background-image:url(../flags/1x1/mz.svg)}.flag-icon-na{background-image:url(../flags/4x3/na.svg)}.flag-icon-na.flag-icon-squared{background-image:url(../flags/1x1/na.svg)}.flag-icon-nc{background-image:url(../flags/4x3/nc.svg)}.flag-icon-nc.flag-icon-squared{background-image:url(../flags/1x1/nc.svg)}.flag-icon-ne{background-image:url(../flags/4x3/ne.svg)}.flag-icon-ne.flag-icon-squared{background-image:url(../flags/1x1/ne.svg)}.flag-icon-nf{background-image:url(../flags/4x3/nf.svg)}.flag-icon-nf.flag-icon-squared{background-image:url(../flags/1x1/nf.svg)}.flag-icon-ng{background-image:url(../flags/4x3/ng.svg)}.flag-icon-ng.flag-icon-squared{background-image:url(../flags/1x1/ng.svg)}.flag-icon-ni{background-image:url(../flags/4x3/ni.svg)}.flag-icon-ni.flag-icon-squared{background-image:url(../flags/1x1/ni.svg)}.flag-icon-nl{background-image:url(../flags/4x3/nl.svg)}.flag-icon-nl.flag-icon-squared{background-image:url(../flags/1x1/nl.svg)}.flag-icon-no{background-image:url(../flags/4x3/no.svg)}.flag-icon-no.flag-icon-squared{background-image:url(../flags/1x1/no.svg)}.flag-icon-np{background-image:url(../flags/4x3/np.svg)}.flag-icon-np.flag-icon-squared{background-image:url(../flags/1x1/np.svg)}.flag-icon-nr{background-image:url(../flags/4x3/nr.svg)}.flag-icon-nr.flag-icon-squared{background-image:url(../flags/1x1/nr.svg)}.flag-icon-nu{background-image:url(../flags/4x3/nu.svg)}.flag-icon-nu.flag-icon-squared{background-image:url(../flags/1x1/nu.svg)}.flag-icon-nz{background-image:url(../flags/4x3/nz.svg)}.flag-icon-nz.flag-icon-squared{background-image:url(../flags/1x1/nz.svg)}.flag-icon-om{background-image:url(../flags/4x3/om.svg)}.flag-icon-om.flag-icon-squared{background-image:url(../flags/1x1/om.svg)}.flag-icon-pa{background-image:url(../flags/4x3/pa.svg)}.flag-icon-pa.flag-icon-squared{background-image:url(../flags/1x1/pa.svg)}.flag-icon-pe{background-image:url(../flags/4x3/pe.svg)}.flag-icon-pe.flag-icon-squared{background-image:url(../flags/1x1/pe.svg)}.flag-icon-pf{background-image:url(../flags/4x3/pf.svg)}.flag-icon-pf.flag-icon-squared{background-image:url(../flags/1x1/pf.svg)}.flag-icon-pg{background-image:url(../flags/4x3/pg.svg)}.flag-icon-pg.flag-icon-squared{background-image:url(../flags/1x1/pg.svg)}.flag-icon-ph{background-image:url(../flags/4x3/ph.svg)}.flag-icon-ph.flag-icon-squared{background-image:url(../flags/1x1/ph.svg)}.flag-icon-pk{background-image:url(../flags/4x3/pk.svg)}.flag-icon-pk.flag-icon-squared{background-image:url(../flags/1x1/pk.svg)}.flag-icon-pl{background-image:url(../flags/4x3/pl.svg)}.flag-icon-pl.flag-icon-squared{background-image:url(../flags/1x1/pl.svg)}.flag-icon-pm{background-image:url(../flags/4x3/pm.svg)}.flag-icon-pm.flag-icon-squared{background-image:url(../flags/1x1/pm.svg)}.flag-icon-pn{background-image:url(../flags/4x3/pn.svg)}.flag-icon-pn.flag-icon-squared{background-image:url(../flags/1x1/pn.svg)}.flag-icon-pr{background-image:url(../flags/4x3/pr.svg)}.flag-icon-pr.flag-icon-squared{background-image:url(../flags/1x1/pr.svg)}.flag-icon-ps{background-image:url(../flags/4x3/ps.svg)}.flag-icon-ps.flag-icon-squared{background-image:url(../flags/1x1/ps.svg)}.flag-icon-pt{background-image:url(../flags/4x3/pt.svg)}.flag-icon-pt.flag-icon-squared{background-image:url(../flags/1x1/pt.svg)}.flag-icon-pw{background-image:url(../flags/4x3/pw.svg)}.flag-icon-pw.flag-icon-squared{background-image:url(../flags/1x1/pw.svg)}.flag-icon-py{background-image:url(../flags/4x3/py.svg)}.flag-icon-py.flag-icon-squared{background-image:url(../flags/1x1/py.svg)}.flag-icon-qa{background-image:url(../flags/4x3/qa.svg)}.flag-icon-qa.flag-icon-squared{background-image:url(../flags/1x1/qa.svg)}.flag-icon-re{background-image:url(../flags/4x3/re.svg)}.flag-icon-re.flag-icon-squared{background-image:url(../flags/1x1/re.svg)}.flag-icon-ro{background-image:url(../flags/4x3/ro.svg)}.flag-icon-ro.flag-icon-squared{background-image:url(../flags/1x1/ro.svg)}.flag-icon-rs{background-image:url(../flags/4x3/rs.svg)}.flag-icon-rs.flag-icon-squared{background-image:url(../flags/1x1/rs.svg)}.flag-icon-ru{background-image:url(../flags/4x3/ru.svg)}.flag-icon-ru.flag-icon-squared{background-image:url(../flags/1x1/ru.svg)}.flag-icon-rw{background-image:url(../flags/4x3/rw.svg)}.flag-icon-rw.flag-icon-squared{background-image:url(../flags/1x1/rw.svg)}.flag-icon-sa{background-image:url(../flags/4x3/sa.svg)}.flag-icon-sa.flag-icon-squared{background-image:url(../flags/1x1/sa.svg)}.flag-icon-sb{background-image:url(../flags/4x3/sb.svg)}.flag-icon-sb.flag-icon-squared{background-image:url(../flags/1x1/sb.svg)}.flag-icon-sc{background-image:url(../flags/4x3/sc.svg)}.flag-icon-sc.flag-icon-squared{background-image:url(../flags/1x1/sc.svg)}.flag-icon-sd{background-image:url(../flags/4x3/sd.svg)}.flag-icon-sd.flag-icon-squared{background-image:url(../flags/1x1/sd.svg)}.flag-icon-se{background-image:url(../flags/4x3/se.svg)}.flag-icon-se.flag-icon-squared{background-image:url(../flags/1x1/se.svg)}.flag-icon-sg{background-image:url(../flags/4x3/sg.svg)}.flag-icon-sg.flag-icon-squared{background-image:url(../flags/1x1/sg.svg)}.flag-icon-sh{background-image:url(../flags/4x3/sh.svg)}.flag-icon-sh.flag-icon-squared{background-image:url(../flags/1x1/sh.svg)}.flag-icon-si{background-image:url(../flags/4x3/si.svg)}.flag-icon-si.flag-icon-squared{background-image:url(../flags/1x1/si.svg)}.flag-icon-sj{background-image:url(../flags/4x3/sj.svg)}.flag-icon-sj.flag-icon-squared{background-image:url(../flags/1x1/sj.svg)}.flag-icon-sk{background-image:url(../flags/4x3/sk.svg)}.flag-icon-sk.flag-icon-squared{background-image:url(../flags/1x1/sk.svg)}.flag-icon-sl{background-image:url(../flags/4x3/sl.svg)}.flag-icon-sl.flag-icon-squared{background-image:url(../flags/1x1/sl.svg)}.flag-icon-sm{background-image:url(../flags/4x3/sm.svg)}.flag-icon-sm.flag-icon-squared{background-image:url(../flags/1x1/sm.svg)}.flag-icon-sn{background-image:url(../flags/4x3/sn.svg)}.flag-icon-sn.flag-icon-squared{background-image:url(../flags/1x1/sn.svg)}.flag-icon-so{background-image:url(../flags/4x3/so.svg)}.flag-icon-so.flag-icon-squared{background-image:url(../flags/1x1/so.svg)}.flag-icon-sr{background-image:url(../flags/4x3/sr.svg)}.flag-icon-sr.flag-icon-squared{background-image:url(../flags/1x1/sr.svg)}.flag-icon-ss{background-image:url(../flags/4x3/ss.svg)}.flag-icon-ss.flag-icon-squared{background-image:url(../flags/1x1/ss.svg)}.flag-icon-st{background-image:url(../flags/4x3/st.svg)}.flag-icon-st.flag-icon-squared{background-image:url(../flags/1x1/st.svg)}.flag-icon-sv{background-image:url(../flags/4x3/sv.svg)}.flag-icon-sv.flag-icon-squared{background-image:url(../flags/1x1/sv.svg)}.flag-icon-sx{background-image:url(../flags/4x3/sx.svg)}.flag-icon-sx.flag-icon-squared{background-image:url(../flags/1x1/sx.svg)}.flag-icon-sy{background-image:url(../flags/4x3/sy.svg)}.flag-icon-sy.flag-icon-squared{background-image:url(../flags/1x1/sy.svg)}.flag-icon-sz{background-image:url(../flags/4x3/sz.svg)}.flag-icon-sz.flag-icon-squared{background-image:url(../flags/1x1/sz.svg)}.flag-icon-tc{background-image:url(../flags/4x3/tc.svg)}.flag-icon-tc.flag-icon-squared{background-image:url(../flags/1x1/tc.svg)}.flag-icon-td{background-image:url(../flags/4x3/td.svg)}.flag-icon-td.flag-icon-squared{background-image:url(../flags/1x1/td.svg)}.flag-icon-tf{background-image:url(../flags/4x3/tf.svg)}.flag-icon-tf.flag-icon-squared{background-image:url(../flags/1x1/tf.svg)}.flag-icon-tg{background-image:url(../flags/4x3/tg.svg)}.flag-icon-tg.flag-icon-squared{background-image:url(../flags/1x1/tg.svg)}.flag-icon-th{background-image:url(../flags/4x3/th.svg)}.flag-icon-th.flag-icon-squared{background-image:url(../flags/1x1/th.svg)}.flag-icon-tj{background-image:url(../flags/4x3/tj.svg)}.flag-icon-tj.flag-icon-squared{background-image:url(../flags/1x1/tj.svg)}.flag-icon-tk{background-image:url(../flags/4x3/tk.svg)}.flag-icon-tk.flag-icon-squared{background-image:url(../flags/1x1/tk.svg)}.flag-icon-tl{background-image:url(../flags/4x3/tl.svg)}.flag-icon-tl.flag-icon-squared{background-image:url(../flags/1x1/tl.svg)}.flag-icon-tm{background-image:url(../flags/4x3/tm.svg)}.flag-icon-tm.flag-icon-squared{background-image:url(../flags/1x1/tm.svg)}.flag-icon-tn{background-image:url(../flags/4x3/tn.svg)}.flag-icon-tn.flag-icon-squared{background-image:url(../flags/1x1/tn.svg)}.flag-icon-to{background-image:url(../flags/4x3/to.svg)}.flag-icon-to.flag-icon-squared{background-image:url(../flags/1x1/to.svg)}.flag-icon-tr{background-image:url(../flags/4x3/tr.svg)}.flag-icon-tr.flag-icon-squared{background-image:url(../flags/1x1/tr.svg)}.flag-icon-tt{background-image:url(../flags/4x3/tt.svg)}.flag-icon-tt.flag-icon-squared{background-image:url(../flags/1x1/tt.svg)}.flag-icon-tv{background-image:url(../flags/4x3/tv.svg)}.flag-icon-tv.flag-icon-squared{background-image:url(../flags/1x1/tv.svg)}.flag-icon-tw{background-image:url(../flags/4x3/tw.svg)}.flag-icon-tw.flag-icon-squared{background-image:url(../flags/1x1/tw.svg)}.flag-icon-tz{background-image:url(../flags/4x3/tz.svg)}.flag-icon-tz.flag-icon-squared{background-image:url(../flags/1x1/tz.svg)}.flag-icon-ua{background-image:url(../flags/4x3/ua.svg)}.flag-icon-ua.flag-icon-squared{background-image:url(../flags/1x1/ua.svg)}.flag-icon-ug{background-image:url(../flags/4x3/ug.svg)}.flag-icon-ug.flag-icon-squared{background-image:url(../flags/1x1/ug.svg)}.flag-icon-um{background-image:url(../flags/4x3/um.svg)}.flag-icon-um.flag-icon-squared{background-image:url(../flags/1x1/um.svg)}.flag-icon-us{background-image:url(../flags/4x3/us.svg)}.flag-icon-us.flag-icon-squared{background-image:url(../flags/1x1/us.svg)}.flag-icon-uy{background-image:url(../flags/4x3/uy.svg)}.flag-icon-uy.flag-icon-squared{background-image:url(../flags/1x1/uy.svg)}.flag-icon-uz{background-image:url(../flags/4x3/uz.svg)}.flag-icon-uz.flag-icon-squared{background-image:url(../flags/1x1/uz.svg)}.flag-icon-va{background-image:url(../flags/4x3/va.svg)}.flag-icon-va.flag-icon-squared{background-image:url(../flags/1x1/va.svg)}.flag-icon-vc{background-image:url(../flags/4x3/vc.svg)}.flag-icon-vc.flag-icon-squared{background-image:url(../flags/1x1/vc.svg)}.flag-icon-ve{background-image:url(../flags/4x3/ve.svg)}.flag-icon-ve.flag-icon-squared{background-image:url(../flags/1x1/ve.svg)}.flag-icon-vg{background-image:url(../flags/4x3/vg.svg)}.flag-icon-vg.flag-icon-squared{background-image:url(../flags/1x1/vg.svg)}.flag-icon-vi{background-image:url(../flags/4x3/vi.svg)}.flag-icon-vi.flag-icon-squared{background-image:url(../flags/1x1/vi.svg)}.flag-icon-vn{background-image:url(../flags/4x3/vn.svg)}.flag-icon-vn.flag-icon-squared{background-image:url(../flags/1x1/vn.svg)}.flag-icon-vu{background-image:url(../flags/4x3/vu.svg)}.flag-icon-vu.flag-icon-squared{background-image:url(../flags/1x1/vu.svg)}.flag-icon-wf{background-image:url(../flags/4x3/wf.svg)}.flag-icon-wf.flag-icon-squared{background-image:url(../flags/1x1/wf.svg)}.flag-icon-ws{background-image:url(../flags/4x3/ws.svg)}.flag-icon-ws.flag-icon-squared{background-image:url(../flags/1x1/ws.svg)}.flag-icon-ye{background-image:url(../flags/4x3/ye.svg)}.flag-icon-ye.flag-icon-squared{background-image:url(../flags/1x1/ye.svg)}.flag-icon-yt{background-image:url(../flags/4x3/yt.svg)}.flag-icon-yt.flag-icon-squared{background-image:url(../flags/1x1/yt.svg)}.flag-icon-za{background-image:url(../flags/4x3/za.svg)}.flag-icon-za.flag-icon-squared{background-image:url(../flags/1x1/za.svg)}.flag-icon-zm{background-image:url(../flags/4x3/zm.svg)}.flag-icon-zm.flag-icon-squared{background-image:url(../flags/1x1/zm.svg)}.flag-icon-zw{background-image:url(../flags/4x3/zw.svg)}.flag-icon-zw.flag-icon-squared{background-image:url(../flags/1x1/zw.svg)}.flag-icon-es-ct{background-image:url(../flags/4x3/es-ct.svg)}.flag-icon-es-ct.flag-icon-squared{background-image:url(../flags/1x1/es-ct.svg)}.flag-icon-eu{background-image:url(../flags/4x3/eu.svg)}.flag-icon-eu.flag-icon-squared{background-image:url(../flags/1x1/eu.svg)}.flag-icon-gb-eng{background-image:url(../flags/4x3/gb-eng.svg)}.flag-icon-gb-eng.flag-icon-squared{background-image:url(../flags/1x1/gb-eng.svg)}.flag-icon-gb-nir{background-image:url(../flags/4x3/gb-nir.svg)}.flag-icon-gb-nir.flag-icon-squared{background-image:url(../flags/1x1/gb-nir.svg)}.flag-icon-gb-sct{background-image:url(../flags/4x3/gb-sct.svg)}.flag-icon-gb-sct.flag-icon-squared{background-image:url(../flags/1x1/gb-sct.svg)}.flag-icon-gb-wls{background-image:url(../flags/4x3/gb-wls.svg)}.flag-icon-gb-wls.flag-icon-squared{background-image:url(../flags/1x1/gb-wls.svg)}.flag-icon-un{background-image:url(../flags/4x3/un.svg)}.flag-icon-un.flag-icon-squared{background-image:url(../flags/1x1/un.svg)}.flag-icon-xk{background-image:url(../flags/4x3/xk.svg)}.flag-icon-xk.flag-icon-squared{background-image:url(../flags/1x1/xk.svg)}.loader-container{top:0;left:0;width:100%;height:100%;position:fixed;background-color:#000;opacity:.2;z-index:9999}#loader{position:absolute;left:50%;top:50%;z-index:1;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #3498db;width:120px;height:120px;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.modal-open{overflow:hidden;padding-right:0!important}.croppie-container{width:100%;height:100%}.croppie-container .cr-image{z-index:-1;position:absolute;top:0;left:0;transform-origin:0 0;max-height:none;max-width:none}.croppie-container .cr-boundary{position:relative;overflow:hidden;margin:0 auto;z-index:1;width:100%;height:100%}.croppie-container .cr-resizer,.croppie-container .cr-viewport{position:absolute;border:2px solid #fff;margin:auto;top:0;bottom:0;right:0;left:0;box-shadow:0 0 2000px 2000px rgba(0,0,0,.5);z-index:0}.croppie-container .cr-resizer{z-index:2;box-shadow:none;pointer-events:none}.croppie-container .cr-resizer-horisontal,.croppie-container .cr-resizer-vertical{position:absolute;pointer-events:all}.croppie-container .cr-resizer-horisontal::after,.croppie-container .cr-resizer-vertical::after{display:block;position:absolute;box-sizing:border-box;border:1px solid #000;background:#fff;width:10px;height:10px;content:''}.croppie-container .cr-resizer-vertical{bottom:-5px;cursor:row-resize;width:100%;height:10px}.croppie-container .cr-resizer-vertical::after{left:50%;margin-left:-5px}.croppie-container .cr-resizer-horisontal{right:-5px;cursor:col-resize;width:10px;height:100%}.croppie-container .cr-resizer-horisontal::after{top:50%;margin-top:-5px}.croppie-container .cr-original-image{display:none}.croppie-container .cr-vp-circle{border-radius:50%}.croppie-container .cr-overlay{z-index:1;position:absolute;cursor:move;touch-action:none}.croppie-container .cr-slider-wrap{width:75%;margin:15px auto;text-align:center}.croppie-result{position:relative;overflow:hidden}.croppie-result img{position:absolute}.croppie-container .cr-image,.croppie-container .cr-overlay,.croppie-container .cr-viewport{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.cr-slider{-webkit-appearance:none;max-width:100%;padding-top:8px;padding-bottom:8px;background-color:transparent}.cr-slider::-webkit-slider-runnable-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-webkit-slider-thumb{-webkit-appearance:none;border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider::-moz-range-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}.cr-slider::-ms-track{width:100%;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}.cr-slider::-ms-fill-lower{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-fill-upper{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:1px}.cr-slider:focus::-ms-fill-lower{background:rgba(0,0,0,.5)}.cr-slider:focus::-ms-fill-upper{background:rgba(0,0,0,.5)}.cr-rotate-controls{position:absolute;bottom:5px;left:5px;z-index:1}.cr-rotate-controls button{border:0;background:0 0}.cr-rotate-controls i:before{display:inline-block;font-style:normal;font-weight:900;font-size:22px}.cm-em,.hljs-emphasis,.tui-editor-contents address,.tui-editor-contents cite,.tui-editor-contents dfn,.tui-editor-contents em,.tui-editor-contents i,.tui-editor-contents var{font-style:italic}.cr-rotate-l i:before{content:'↺'}.cr-rotate-r i:before{content:'↻'}.bootstrap-tagsinput{background-color:#fff;border:1px solid #ccc;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);display:inline-block;padding:4px 6px;color:#555;vertical-align:middle;border-radius:4px;max-width:100%;line-height:22px;cursor:text}.bootstrap-tagsinput input,.bootstrap-tagsinput input:focus{border:none;box-shadow:none}.bootstrap-tagsinput input{outline:0;background-color:transparent;padding:0 6px;margin:0;width:auto;max-width:inherit}.bootstrap-tagsinput.form-control input::-moz-placeholder{color:#777;opacity:1}.bootstrap-tagsinput.form-control input:-ms-input-placeholder{color:#777}.bootstrap-tagsinput.form-control input::-webkit-input-placeholder{color:#777}.bootstrap-tagsinput .tag{margin-right:2px;color:#fff}.bootstrap-tagsinput .tag [data-role=remove]{margin-left:8px;cursor:pointer}.bootstrap-tagsinput .tag [data-role=remove]:after{content:"x";padding:0 2px}.bootstrap-tagsinput .tag [data-role=remove]:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.bootstrap-tagsinput .tag [data-role=remove]:hover:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}/*! - * Font Awesome Free 5.12.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.CodeMirror{height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:#333;background:#f8f8f8}.hljs-comment,.hljs-quote{color:#998;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#333;font-weight:700}.hljs-literal,.hljs-number,.hljs-tag .hljs-attr,.hljs-template-variable,.hljs-variable{color:teal}.hljs-doctag,.hljs-string{color:#d14}.hljs-section,.hljs-selector-id,.hljs-title{color:#900;font-weight:700}.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-type{color:#458;font-weight:700}.hljs-attribute,.hljs-name,.hljs-tag{color:navy;font-weight:400}.hljs-meta,.hljs-strong,.tui-editor-contents h1,.tui-editor-contents h2,.tui-editor-contents h3,.tui-editor-contents h5,.tui-editor-contents strong{font-weight:700}.hljs-link,.hljs-regexp{color:#009926}.hljs-bullet,.hljs-symbol{color:#990073}.hljs-built_in,.hljs-builtin-name{color:#0086b3}.hljs-meta{color:#999}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.CodeMirror{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.tui-editor-contents :not(table){line-height:160%;box-sizing:content-box}.fa,.fab,.fad,.fal,.far,.fas,.mi{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;text-rendering:auto}.tui-editor-contents p{margin:10px 0;color:#555}.tui-editor-contents>div>div:first-of-type h1,.tui-editor-contents>h1:first-of-type{margin-top:14px}.tui-editor-contents h1{font-size:1.6rem;line-height:28px;border-bottom:3px double #999;margin:52px 0 15px;padding-bottom:7px;color:#000}.tui-editor-contents h2{font-size:1.3rem;line-height:23px;border-bottom:1px solid #dbdbdb;margin:30px 0 13px;padding-bottom:7px;color:#333}.tui-editor-contents h3,.tui-editor-contents h4{font-size:1.2rem;line-height:18px;margin:20px 0 2px;color:#333}.tui-editor-contents h5,.tui-editor-contents h6{font-size:1rem;line-height:17px;margin:10px 0 -4px;color:#333}.tui-editor-contents blockquote{margin:15px 0;border-left:4px solid #ddd;padding:0 15px;color:#777}.tui-editor-contents blockquote>:first-child{margin-top:0}.tui-editor-contents blockquote>:last-child{margin-bottom:0}.tui-editor-contents code,.tui-editor-contents pre{font-family:Consolas,Courier,"Apple SD 산돌고딕 Neo",-apple-system,"Lucida Grande","Apple SD Gothic Neo","맑은 고딕","Malgun Gothic","Segoe UI","돋움",dotum,sans-serif;border:0;border-radius:0}.te-input-language input,.te-ww-block-overlay.code-block-header,.tui-editor-defaultUI{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.tui-editor-contents pre{margin:2px 0 8px;padding:18px;background-color:#f5f7f8}.tui-editor-contents code{color:#c1788b;padding:4px 4px 2px 0;letter-spacing:-.3px}.tui-editor-contents pre code{padding:0;color:inherit;white-space:pre-wrap;background-color:transparent}.tui-editor-contents pre.addon{border:1px solid #e8ebed;background-color:#fff}.tui-editor-contents img{margin:4px 0 10px;box-sizing:border-box;vertical-align:top;max-width:100%}.tui-editor-contents table{margin:2px 0 14px;color:#555;width:auto;border-collapse:collapse;box-sizing:border-box}.tui-editor-contents table td,.tui-editor-contents table th{height:32px;padding:5px 14px 5px 12px}.tui-editor-contents table td{border:1px solid #eaeaea}.tui-editor-contents table th{border:1px solid #72777b;border-top:0;background-color:#7b8184;font-weight:300;color:#fff;padding-top:6px}.tui-editor-contents dir,.tui-editor-contents menu,.tui-editor-contents ol,.tui-editor-contents ul{display:block;list-style-type:disc;padding-left:17px;margin:6px 0 10px;color:#555}.tui-editor-contents ol{list-style-type:decimal}.fa-ul,.mi-ul{list-style-type:none}.tui-editor-contents ol ol,.tui-editor-contents ol ul,.tui-editor-contents ul ol,.tui-editor-contents ul ul{margin-top:0!important;margin-bottom:0!important}.tui-editor-contents ol li,.tui-editor-contents ul li{position:relative}.tui-editor-contents ul p,ol p{margin:0}.tui-editor-contents ol li.task-list-item:before,.tui-editor-contents pre ul li:before,.tui-editor-contents ul li.task-list-item:before{content:""}.tui-editor-contents hr{border-top:1px solid #eee;margin:16px 0}.tui-editor-contents a{text-decoration:underline;color:#5286bc}.tui-editor-contents a:hover{color:#007cff}.tui-editor-contents{font-size:13px;margin:0;padding:0}.tui-editor-contents .task-list-item{border:0;list-style:none;padding-left:22px;margin-left:-22px}.tui-editor-contents .task-list-item:before{background-repeat:no-repeat;background-size:16px 16px;background-position:center;content:"";height:18px;width:18px;position:absolute;left:0;top:1px;cursor:pointer;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAADdJREFUKBVjvHv37n8GMgALSI+SkhJJWu/du8fARJIOJMWjGpECA505GjjoIYLEB6dVUNojFQAA/1MJUFWet/4AAAAASUVORK5CYII=)}.tui-editor-contents .task-list-item.checked:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMpJREFUKBVjjJ/64D8DGYCJDD1gLbTVyM3OxJDiJMzAxcYIdyALnIWDAdJU7i/OICfCxsDMxMgwc88bwk5F1vTs/W+GFUffwY2H+1FBlI2hLliCQYCbGSyJrqlzwwuGj9//YWoMtRBgUBJnZ6gMEGeQFWaFOw9kE7omkG5GWDyCPF7mJ86gIMbO8P//fwZGRkYGXJpAGuFO/fbrP0PXppcMD179JKgJRSOIA9N8/NZXrM4DqYEBjOgAaYYFOUwRNhruVGyS+MTI1ggAx8NTGcUtFVQAAAAASUVORK5CYII=)}.tui-editor-contents .task-list-item .task-list-item-checkbox,.tui-editor-contents .task-list-item input[type=checkbox]{margin-left:-17px;margin-right:3.8px;margin-top:3px}.tui-editor-contents-placeholder:before{content:attr(data-placeholder);color:grey;line-height:160%;position:absolute}.auto-height,.auto-height .tui-editor-defaultUI{height:auto}.auto-height .tui-editor{position:relative}:not(.auto-height)>.tui-editor-defaultUI,:not(.auto-height)>.tui-editor-defaultUI>.te-editor-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:not(.auto-height)>.tui-editor-defaultUI>.te-editor-section{-ms-flex:1;flex:1}.tui-editor-defaultUI-toolbar:after,.tui-editor:after{content:"";display:block;height:0;clear:both}.tui-editor{position:absolute;line-height:1;color:#181818;width:100%;height:inherit}.te-editor-section{min-height:0;position:relative;height:inherit}.te-md-container{display:none;overflow:hidden;height:100%}.te-md-container .te-editor{line-height:1.5}.te-md-container .te-editor,.te-md-container .te-preview{box-sizing:border-box;padding:0;height:inherit}.te-md-container .CodeMirror{font-size:13px;height:inherit}.te-md-container .te-preview{overflow:auto;padding:0 25px;height:100%}.te-md-container .te-preview>p:first-child{margin-top:0!important}.te-md-container .te-preview .tui-editor-contents{padding-top:11px}.tui-editor .te-preview-style-tab>.te-editor,.tui-editor .te-preview-style-tab>.te-preview{float:left;width:100%;display:none}.tui-editor .te-preview-style-tab>.te-tab-active{display:block}.tui-editor .te-preview-style-vertical>.te-tab-section{display:none}.tui-editor .te-preview-style-tab>.te-tab-section{display:block}.tui-editor .te-preview-style-vertical .te-editor,.tui-editor .te-preview-style-vertical .te-preview{float:left;width:50%}.tui-editor .te-md-splitter{display:none;position:absolute;left:50%;top:0;height:100%;width:1px;border-left:1px solid #e5e5e5}.tui-editor .te-preview-style-vertical .te-md-splitter{display:block}.te-ww-container{display:none;overflow:hidden;z-index:10;height:inherit;background-color:#fff}.te-ww-container>.te-editor{overflow:auto;height:inherit}.te-ww-container .tui-editor-contents:focus{outline:0}.te-ww-container .tui-editor-contents{padding:0 25px}.te-ww-container .tui-editor-contents:first-child{box-sizing:border-box;margin:0;padding:16px 25px 0;height:inherit}.te-ww-container .tui-editor-contents:last-child{margin-bottom:16px}.te-md-mode .te-md-container,.te-ww-mode .te-ww-container{display:block;z-index:100}.tui-editor-defaultUI.te-hide,.tui-editor.te-hide{display:none}.tui-editor-defaultUI .CodeMirror-lines{padding-top:13px;padding-bottom:13px}.tui-editor-defaultUI .CodeMirror-line{padding-left:25px;padding-right:25px}.tui-editor-defaultUI .CodeMirror pre.CodeMirror-placeholder{padding-left:25px;color:grey}.tui-editor-defaultUI .CodeMirror-scroll{cursor:text}.tui-editor-contents td.te-cell-selected{background-color:#d8dfec}.tui-editor-contents td.te-cell-selected::selection{background-color:#d8dfec}.tui-editor-contents th.te-cell-selected{background-color:#908f8f}.tui-editor-contents th.te-cell-selected::selection{background-color:#908f8f}.tui-editor-defaultUI{position:relative;border:1px solid #e5e5e5;height:100%}.tui-editor-defaultUI button{color:#fff;padding:0 14px 0 15px;height:28px;font-size:12px;border:none;cursor:pointer;outline:0}.tui-editor-defaultUI button.te-ok-button{background-color:#4b96e6}.tui-editor-defaultUI button.te-close-button{background-color:#777}.tui-editor-defaultUI-toolbar{padding:0 25px;height:31px;background-color:#fff;border:0;overflow:hidden}.tui-toolbar-divider{float:left;display:inline-block;width:1px;height:14px;background-color:#ddd;margin:9px 6px}.tui-toolbar-button-group{height:28px;border-right:1px solid #d9d9d9;float:left}.te-toolbar-section{height:32px;box-sizing:border-box;border-bottom:1px solid #e5e5e5}.tui-editor-defaultUI-toolbar button{float:left;box-sizing:border-box;outline:0;cursor:pointer;background-color:#fff;width:22px;height:22px;padding:3px;border-radius:0;margin:5px 3px;border:1px solid #fff}.tui-editor-defaultUI-toolbar button.active,.tui-editor-defaultUI-toolbar button:active,.tui-editor-defaultUI-toolbar button:hover{border:1px solid #aaa;background-color:#fff}.tui-editor-defaultUI-toolbar button:first-child{margin-left:0}.tui-editor-defaultUI-toolbar button:last-child{margin-right:0}.tui-editor-defaultUI-toolbar button.tui-scrollsync{width:auto;color:#777;border:0}.tui-editor-defaultUI button.tui-scrollsync:after{content:"Scroll off"}.tui-editor-defaultUI button.tui-scrollsync.active{color:#125de6;font-weight:700}.tui-editor-defaultUI button.tui-scrollsync.active:after{content:"Scroll on"}.tui-editor-defaultUI .te-mode-switch-section{background-color:#f9f9f9;border-top:1px solid #e5e5e5;height:20px;font-size:12px}.tui-editor-defaultUI .te-mode-switch{float:right;height:100%}.tui-editor-defaultUI .te-switch-button{width:92px;height:inherit;background:#e5e5e5;outline:0;color:#a0aabf;cursor:pointer;border:0;border-left:1px solid #ddd;border-right:1px solid #ddd}.tui-editor-defaultUI .te-switch-button.active{background-color:#fff;color:#000}.tui-editor-defaultUI .te-markdown-tab-section{float:left;height:31px;background:#fff}.te-markdown-tab-section .te-tab{margin:0 -7px 0 24px;background:#fff}.tui-editor-defaultUI .te-tab button{box-sizing:border-box;line-height:100%;position:relative;cursor:pointer;z-index:1;font-size:13px;background-color:#f9f9f9;border:1px solid #e5e5e5;border-top:0;padding:0 9px;color:#777;border-radius:0;outline:0}.te-markdown-tab-section .te-tab button:last-child{margin-left:-1px}.te-markdown-tab-section .te-tab button.te-tab-active,.te-markdown-tab-section .te-tab button:hover.te-tab-active{background-color:#fff;color:#333;border-bottom:1px solid #fff;z-index:2}.te-markdown-tab-section .te-tab button:hover{background-color:#fff;color:#333}.tui-popup-modal-background{background-color:rgba(202,202,202,.6);position:fixed;margin:0;left:0;top:0;width:100%;height:100%;z-index:9999}.tui-popup-modal-background.fit-window .tui-popup-wrapper,.tui-popup-wrapper.fit-window{width:100%;height:100%}.tui-popup-wrapper{width:500px;margin-right:auto;border:1px solid #cacaca;background:#fff;z-index:9999}.tui-popup-modal-background .tui-popup-wrapper{position:absolute;margin:auto;top:0;right:0;bottom:0;left:0}.tui-popup-header{padding:10px;height:auto;line-height:normal;position:relative;border-bottom:1px solid #cacaca}.tui-popup-header .tui-popup-header-buttons{float:right}.tui-popup-header .tui-popup-header-buttons button{padding:0;background-color:transparent;background-size:cover;float:left}.tui-popup-header .tui-popup-close-button{margin:3px;width:13px;height:13px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMHB4IiBoZWlnaHQ9IjEwcHgiIHZpZXdCb3g9IjAgMCAxMCAxMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5GMjc2Qzc4MC0zM0JBLTQ3MTItQTM3OC04RkQwQUNDOTFDRTk8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImxuYi1mb2xkZXItZGVsIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGZpbGw9IiM3Nzc3NzciPiAgICAgICAgICAgIDxwYXRoIGQ9Ik01LDMuNTg1Nzg2NDQgTDEuNzA3MTA2NzgsMC4yOTI4OTMyMTkgTDAuMjkyODkzMjE5LDEuNzA3MTA2NzggTDMuNTg1Nzg2NDQsNSBMMC4yOTI4OTMyMTksOC4yOTI4OTMyMiBMMS43MDcxMDY3OCw5LjcwNzEwNjc4IEw1LDYuNDE0MjEzNTYgTDguMjkyODkzMjIsOS43MDcxMDY3OCBMOS43MDcxMDY3OCw4LjI5Mjg5MzIyIEw2LjQxNDIxMzU2LDUgTDkuNzA3MTA2NzgsMS43MDcxMDY3OCBMOC4yOTI4OTMyMiwwLjI5Mjg5MzIxOSBMNSwzLjU4NTc4NjQ0IFoiIGlkPSJDb21iaW5lZC1TaGFwZSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+)}.tui-popup-header .tui-popup-title{font-size:13px;font-weight:700;color:#333;vertical-align:bottom}.tui-popup-body{padding:15px;font-size:12px}.tui-editor-popup{position:absolute;top:30px;left:50%;margin-left:-250px}.tui-editor-popup.tui-popup-modal-background{position:fixed;top:0;left:0;margin:0}.tui-editor-popup .tui-popup-body label{font-weight:700;color:#666;display:block;margin:10px 0 5px}.tui-editor-popup .tui-popup-body .te-button-section{margin-top:15px}.tui-editor-popup .tui-popup-body input[type=file],.tui-editor-popup .tui-popup-body input[type=text]{padding:4px 10px;border:1px solid #bfbfbf;box-sizing:border-box;width:100%}.tui-editor-popup .tui-popup-body input.wrong{border-color:red}.te-popup-add-link .tui-popup-wrapper{height:219px}.te-popup-add-image .tui-popup-wrapper{height:243px}.te-popup-add-image .te-tab{display:block;background:0 0;border-bottom:1px solid #ebebeb;margin-bottom:8px}.te-popup-add-image .te-file-type,.te-popup-add-image .te-url-type{display:none}.te-popup-add-image div.te-tab-active,.te-popup-add-image form.te-tab-active{display:block}.te-dropdown-toolbar .tui-toolbar-divider,.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-toggle-slider{display:none}.te-popup-add-image .te-tab button{border:1px solid #ccc;background:#eee;min-width:100px;margin-left:-1px;border-bottom:0;border-radius:3px 3px 0 0}.te-popup-add-image .te-tab button.te-tab-active{background:#fff}.te-popup-add-table .te-table-selection{position:relative}.te-popup-add-table .te-table-body{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAARCAYAAAAougcOAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAOklEQVQ4EWO8e/fuPwYGBkYgphlgAZmspKREMwtABjPR1HSo4aOWkBTKo8E1GlwkhQBJikdT1wgNLgAMSwQgckFvTgAAAABJRU5ErkJggg==)}.te-popup-add-table .te-table-header{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAARCAYAAAAougcOAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAOklEQVQ4EWO8e/fuPwYGBkYgphlgAZksLCxMMwtABjPR1HSo4aOWkBTKo8E1GlwkhQBJikdT1wgNLgDxKwPzTeWPdAAAAABJRU5ErkJggg==)}.te-popup-add-table .te-selection-area{position:absolute;top:0;left:0;background:#80d2ff;opacity:.3;z-index:999}.te-popup-add-table .te-description{margin:10px 0 0;text-align:center}.te-popup-table-utils{width:120px}.te-popup-table-utils .tui-popup-body{padding:0}.te-popup-table-utils button{width:100%;background-color:#fff;border:none;outline:0;padding:0 10px;font-size:12px;line-height:28px;text-align:left;color:#777}.te-popup-table-utils button:hover{background-color:#f4f4f4}.te-popup-table-utils hr{background-color:#cacaca;border-style:none;height:1px}.te-heading-add{width:auto}.te-heading-add .tui-popup-body{padding:0}.te-heading-add h1,.te-heading-add h2,.te-heading-add h3,.te-heading-add h4,.te-heading-add h5,.te-heading-add h6,.te-heading-add p,.te-heading-add ul{padding:0;margin:0}.te-heading-add ul li{padding:2px 10px;cursor:pointer}.te-dropdown-toolbar .tui-popup-body,.tui-popup-color{padding:0}.te-heading-add ul li:hover{background-color:#eee}.te-heading-add h1{font-size:24px}.te-heading-add h2{font-size:22px}.te-heading-add h3{font-size:20px}.te-heading-add h4{font-size:18px}.te-heading-add h5{font-size:16px}.te-heading-add h6{font-size:14px}.te-dropdown-toolbar{position:absolute;width:auto}.tui-popup-color .tui-colorpicker-container,.tui-popup-color .tui-colorpicker-palette-container{width:144px}.tui-popup-color .tui-colorpicker-container ul{width:144px;margin-bottom:8px}.tui-popup-color .tui-colorpicker-container li{padding:0 1px 1px 0}.tui-popup-color .tui-colorpicker-container li .tui-colorpicker-palette-button{border:0;width:17px;height:17px}.tui-popup-color .tui-popup-body{padding:10px}.tui-popup-color .te-apply-button,.tui-popup-color .tui-colorpicker-palette-hex{float:right}.fa-pull-left,.tui-popup-code-block-editor .te-button-section button{float:left}.tui-popup-color .te-apply-button{height:21px;width:35px;background:#fff;border:1px solid #efefef;position:absolute;bottom:141px;right:10px}.tui-tooltip,.tui-tooltip .arrow{background-color:#222;position:absolute}.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-hex{border:1px solid #E1E1E1;padding:3px 14px;margin-left:-1px}.tui-popup-color .tui-colorpicker-container div.tui-colorpicker-clearfix{display:inline-block}.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-preview{width:19px;height:19px}.tui-popup-color .tui-colorpicker-slider-container .tui-colorpicker-slider-right{width:22px}.tui-popup-color .tui-colorpicker-slider-container .tui-colorpicker-huebar-handle{display:none}.tui-tooltip{z-index:999;opacity:.8;color:#fff;padding:2px 5px;font-size:10px}.tui-tooltip .arrow{content:"";display:inline-block;width:10px;height:10px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);top:-3px;left:6px;z-index:-1}.tui-toolbar-icons{background:url(tui-editor.png);background-size:218px 188px;display:inline-block}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.tui-toolbar-icons{background:url(tui-editor-2x.png);background-size:218px 188px;display:inline-block}}.tui-toolbar-icons.tui-heading{background-position:-172px -48px}.tui-toolbar-icons.tui-heading:disabled{background-position:-193px -48px}.tui-toolbar-icons.tui-bold{background-position:-4px -4px}.tui-toolbar-icons.tui-bold:disabled{background-position:-25px -4px}.tui-toolbar-icons.tui-italic{background-position:-4px -48px}.tui-toolbar-icons.tui-italic:disabled{background-position:-25px -48px}.tui-toolbar-icons.tui-color{background-position:-172px -70px}.tui-toolbar-icons.tui-color:disabled{background-position:-193px -70px}.tui-toolbar-icons.tui-strike{background-position:-4px -26px}.tui-toolbar-icons.tui-strike:disabled{background-position:-25px -26px}.tui-toolbar-icons.tui-hrline{background-position:-46px -92px}.tui-toolbar-icons.tui-hrline:disabled{background-position:-67px -92px}.tui-toolbar-icons.tui-quote{background-position:-4px -114px}.tui-toolbar-icons.tui-quote:disabled{background-position:-25px -114px}.tui-toolbar-icons.tui-ul{background-position:-46px -4px}.tui-toolbar-icons.tui-ul:disabled{background-position:-67px -4px}.tui-toolbar-icons.tui-ol{background-position:-46px -26px}.tui-toolbar-icons.tui-ol:disabled{background-position:-67px -26px}.tui-toolbar-icons.tui-task{background-position:-130px -48px}.tui-toolbar-icons.tui-task:disabled{background-position:-151px -48px}.tui-toolbar-icons.tui-indent{background-position:-46px -48px}.tui-toolbar-icons.tui-indent:disabled{background-position:-67px -48px}.tui-toolbar-icons.tui-outdent{background-position:-46px -70px}.tui-toolbar-icons.tui-outdent:disabled{background-position:-67px -70px}.tui-toolbar-icons.tui-table{background-position:-88px -92px}.tui-toolbar-icons.tui-table:disabled{background-position:-109px -92px}.tui-toolbar-icons.tui-image{background-position:-130px -4px}.tui-toolbar-icons.tui-image:disabled{background-position:-151px -4px}.tui-toolbar-icons.tui-link{background-position:-130px -26px}.tui-toolbar-icons.tui-link:disabled{background-position:-151px -26px}.tui-toolbar-icons.tui-code{background-position:-130px -92px}.tui-toolbar-icons.tui-code:disabled{background-position:-151px -92px}.tui-toolbar-icons.tui-codeblock{background-position:-130px -70px}.tui-toolbar-icons.tui-codeblock:disabled{background-position:-151px -70px}.tui-toolbar-icons.tui-more{background-position:-172px -92px}.tui-toolbar-icons.tui-more:disabled{background-position:-193px -92px}.tui-colorpicker-svg-huebar,.tui-colorpicker-svg-slider,.tui-colorpicker-vml-slider{border:1px solid #ebebeb}.CodeMirror-sizer{margin-top:6px}.CodeMirror .cm-header{font-weight:700;color:inherit}.CodeMirror .cm-header-1{font-size:24px}.CodeMirror .cm-header-2{font-size:22px}.CodeMirror .cm-header-3{font-size:20px}.CodeMirror .cm-header-4{font-size:18px}.CodeMirror .cm-header-5{font-size:16px}.CodeMirror .cm-header-6{font-size:14px}.CodeMirror .cm-variable-2{color:inherit}.tui-editor-pseudo-clipboard{position:fixed;left:-1000px;top:-1000px;width:100px;height:100px}.te-ww-block-overlay.code-block-header{text-align:right}.te-ww-block-overlay.code-block-header span{font-size:10px;font-weight:600;padding:0 10px;color:#333;cursor:default}.te-ww-block-overlay.code-block-header button{margin:8px;font-size:10px;color:#333;background-color:#f9f9f9;border:1px solid #ddd;padding:4px;height:auto}.te-popup-code-block-languages{position:fixed;box-sizing:border-box;width:130px}.te-popup-code-block-languages .tui-popup-body{max-height:169px;overflow:auto;padding:0}.te-popup-code-block-languages button{width:100%;background-color:#fff;border:none;outline:0;padding:0 10px;font-size:12px;line-height:24px;text-align:left;color:#777}.fa-fw,.fa-li,.mi-fw,.mi-li,.mi-stack-1x,.mi-stack-2x{text-align:center}.te-popup-code-block-languages button.active{background-color:#f4f4f4}.tui-popup-code-block-editor .tui-popup-wrapper{width:70%;height:70%;margin:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.te-input-language{position:relative;margin-left:15px;cursor:pointer}.te-input-language input{font-size:10px;padding:3px 5px;border:1px solid #ddd;background-color:#f9f9f9;box-sizing:border-box;width:130px;outline:0}.te-input-language input::-ms-clear{display:none}.te-input-language::after{content:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMiAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT42Q0NBRDk2QS0yMjYxLTRFNDAtOTk1RC1DRUUyQUREQUQ3NkQ8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBwb2ludHM9IjIgNSAxMCA1IDYgMTAiPjwvcG9seWdvbj4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);position:absolute;top:1px;right:3px}.te-input-language.active::after{content:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMiAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5BNEZDRkIzMy0zNjdBLTREMjAtOEEyNC1DQ0I2ODFBMDZDODg8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiIGZpbGw9IiM1NTU1NTUiPiAgICAgICAgICAgIDxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNi4wMDAwMDAsIDYuNTAwMDAwKSBzY2FsZSgxLCAtMSkgdHJhbnNsYXRlKC02LjAwMDAwMCwgLTYuNTAwMDAwKSAiIHBvaW50cz0iMiA0IDEwIDQgNiA5Ij48L3BvbHlnb24+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=)}.tui-popup-code-block-editor button{margin:-1px 3px}.tui-popup-code-block-editor .tui-popup-header-buttons{height:20px}.tui-popup-code-block-editor .popup-editor-toggle-preview::after{content:'Preview off';color:#777;margin-right:22px}.tui-popup-code-block-editor .popup-editor-toggle-preview.active::after{content:'Preview on';color:#4b96e6}.tui-popup-code-block-editor .popup-editor-toggle-scroll::after{content:'Scroll off';color:#777;margin-right:16px}.tui-popup-code-block-editor .popup-editor-toggle-scroll.active::after{content:'Scroll on';color:#4b96e6}.fa-inverse,.mi-inverse{color:#fff}.tui-popup-code-block-editor .popup-editor-toggle-fit{width:18px;height:18px;margin-top:4px;margin-right:14px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT40OUQ4RTYyMy1GRTAyLTQ1RUUtQkQ5Ri0xMjUyQjEzRTU1MkQ8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbnRlbnRzLWV4cGFuZCIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBhdGggZD0iTTMsMyBMOSwzIEw5LDUgTDUsNSBMNSw5IEwzLDkgTDMsMyBaIE0xNSwxNSBMOSwxNSBMOSwxMyBMMTMsMTMgTDEzLDkgTDE1LDkgTDE1LDE1IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOS4wMDAwMDAsIDkuMDAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC05LjAwMDAwMCwgLTkuMDAwMDAwKSAiPjwvcGF0aD4gICAgICAgICAgICA8cG9seWdvbiBpZD0iTGluZSIgZmlsbC1ydWxlPSJub256ZXJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMS41MDAwMDAsIDYuNTAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC0xMS41MDAwMDAsIC02LjUwMDAwMCkgIiBwb2ludHM9IjkuMDg1Nzg2NDQgNS41IDEyLjUgOC45MTQyMTM1NiAxMy45MTQyMTM2IDcuNSAxMC41IDQuMDg1Nzg2NDQiPjwvcG9seWdvbj4gICAgICAgICAgICA8cG9seWdvbiBpZD0iTGluZS1Db3B5IiBmaWxsLXJ1bGU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYuNTAwMDAwLCAxMS41MDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTYuNTAwMDAwLCAtMTEuNTAwMDAwKSAiIHBvaW50cz0iNC4wODU3ODY0NCAxMC41IDcuNSAxMy45MTQyMTM2IDguOTE0MjEzNTYgMTIuNSA1LjUgOS4wODU3ODY0NCI+PC9wb2x5Z29uPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+)}.tui-popup-code-block-editor .popup-editor-toggle-fit.active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT4wN0Q1MjlCRi1GNTIzLTREN0EtQTlGNi05NTUzNTU5RDNEMUE8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbnRlbnRzLXJlZHVjZSIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgtMzIiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS41MDAwMDAsIDEyLjUwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtNS41MDAwMDAsIC0xMi41MDAwMDApICIgcG9pbnRzPSIzLjA4NTc4NjQ0IDExLjUgNi41IDE0LjkxNDIxMzYgNy45MTQyMTM1NiAxMy41IDQuNSAxMC4wODU3ODY0Ij48L3BvbHlnb24+ICAgICAgICAgICAgPHBhdGggZD0iTTksOSBMMTUsOSBMMTUsMTEgTDExLDExIEwxMSwxNSBMOSwxNSBMOSw5IFogTTksOSBMMyw5IEwzLDcgTDcsNyBMNywzIEw5LDMgTDksOSBaIiBpZD0iQ29tYmluZWQtU2hhcGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDkuMDAwMDAwLCA5LjAwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtOS4wMDAwMDAsIC05LjAwMDAwMCkgIj48L3BhdGg+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgtMzMiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTIuNTAwMDAwLCA1LjUwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtMTIuNTAwMDAwLCAtNS41MDAwMDApICIgcG9pbnRzPSIxNC45MTQyMTM2IDYuNSAxMS41IDMuMDg1Nzg2NDQgMTAuMDg1Nzg2NCA0LjUgMTMuNSA3LjkxNDIxMzU2Ij48L3BvbHlnb24+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=)}.tui-popup-code-block-editor .tui-popup-close-button{margin-top:6px}.tui-popup-code-block-editor .tui-popup-body{z-index:-1;padding:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.tui-split-scroll.single-content .tui-split-content-right,.tui-split-scroll.single-content .tui-splitter,.tui-split-scroll.single-content button.tui-scrollsync{display:none}.tui-popup-code-block-editor .popup-editor-body{position:relative;-ms-flex:1;flex:1;border-bottom:1px solid #cacaca}.tui-popup-code-block-editor .te-button-section{padding:15px}.tui-popup-code-block-editor .tui-editor-contents pre{margin:0;background-color:transparent}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left,.mi.mi-pull-left{margin-right:.3em}.tui-popup-code-block-editor .CodeMirror{height:auto}.tui-popup-code-block-editor .CodeMirror-line{font-family:Consolas,Courier,"Apple SD 산돌고딕 Neo",-apple-system,"Lucida Grande","Apple SD Gothic Neo","맑은 고딕","Malgun Gothic","Segoe UI","돋움",dotum,sans-serif;font-size:13px;line-height:160%;letter-spacing:-.3px}.tui-popup-code-block-editor .popup-editor-editor-wrapper{min-height:100%}.tui-split-scroll-wrapper{position:relative}.tui-split-scroll{position:absolute}.tui-split-scroll,.tui-split-scroll-wrapper{width:100%;height:100%}.tui-split-scroll .tui-split-content-left,.tui-split-scroll .tui-split-content-right{position:absolute;top:0;width:50%;box-sizing:border-box}.tui-split-scroll .tui-split-content-left{left:0}.tui-split-scroll .tui-split-content-right{left:50%}.tui-split-scroll .tui-splitter{position:absolute;left:50%;top:0;height:100%;width:1px;border-left:1px solid #cacaca}.tui-split-scroll .tui-split-scroll-content{width:100%;height:100%;overflow:hidden;position:relative}.tui-split-scroll .tui-split-content-left,.tui-split-scroll .tui-split-content-right{height:100%;overflow-x:hidden;overflow-y:auto}.tui-split-scroll button.tui-scrollsync{top:10px;opacity:.2}.tui-split-scroll button.tui-scrollsync::after{content:"scroll off"}.tui-split-scroll.scroll-sync button.tui-scrollsync{opacity:.5}.tui-split-scroll.scroll-sync .tui-split-content-left,.tui-split-scroll.scroll-sync .tui-split-content-right{height:auto;overflow:initial}.tui-split-scroll.scroll-sync button.tui-scrollsync::after{content:"scroll on"}.tui-split-scroll.scroll-sync .tui-split-scroll-content{overflow-y:auto}.tui-split-scroll.single-content .tui-split-content-left{width:100%}.fa-stack,.mi,.mi-stack{display:inline-block}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.tui-split-scroll-wrapper .tui-splitter{left:calc(50% - 9px)}}@supports (-ms-accelerator:true){.tui-split-scroll-wrapper .tui-splitter{left:calc(50% - 9px)}}@media screen and (max-width:480px){.tui-popup-wrapper{max-width:300px}.tui-editor-popup{margin-left:-150px}.te-dropdown-toolbar{max-width:none}}/*! - * Font Awesome Free 5.12.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */.fa,.fab,.fad,.fal,.far,.fas{display:inline-block;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{width:1.25em}.fa-ul{margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-right{float:right}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-bahai:before{content:"\f666"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-alt:before{content:"\f422"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\f952"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-alt:before{content:"\f424"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\f907"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-ideal:before{content:"\f913"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-instagram-square:before{content:"\f955"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microblog:before{content:"\f91a"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\f956"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-square:before{content:"\f91e"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopify:before{content:"\f957"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\f941"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\f949"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(../fonts/fa-brands-400.eot);src:url(../fonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-brands-400.woff2) format("woff2"),url(../fonts/fa-brands-400.woff) format("woff"),url(../fonts/fa-brands-400.ttf) format("truetype"),url(../fonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../fonts/fa-regular-400.eot);src:url(../fonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-regular-400.woff2) format("woff2"),url(../fonts/fa-regular-400.woff) format("woff"),url(../fonts/fa-regular-400.ttf) format("truetype"),url(../fonts/fa-regular-400.svg#fontawesome) format("svg")}.fab,.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../fonts/fa-solid-900.eot);src:url(../fonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-solid-900.woff2) format("woff2"),url(../fonts/fa-solid-900.woff) format("woff"),url(../fonts/fa-solid-900.ttf) format("truetype"),url(../fonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}/*! - * License - Micon v3.0.168 http://xtoolkit.github.io/Micon/ (MIT License) - * License - template: https://fontawesome.com/license/free (Code: MIT License) - */@font-face{font-family:micon;font-style:normal;font-weight:400;src:url(../fonts/micon.eot);src:url(../fonts/micon.eot?#iefix) format("embedded-opentype"),url(../fonts/micon.woff2) format("woff2"),url(../fonts/micon.woff) format("woff"),url(../fonts/micon.ttf) format("truetype"),url(../fonts/micon.svg#micon) format("svg")}.mi{font-family:micon;font-weight:400;line-height:1}.mi-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.mi-xs{font-size:.75em}.mi-sm{font-size:.875em}.mi-1x{font-size:1em}.mi-2x{font-size:2em}.mi-3x{font-size:3em}.mi-4x{font-size:4em}.mi-5x{font-size:5em}.mi-6x{font-size:6em}.mi-7x{font-size:7em}.mi-8x{font-size:8em}.mi-9x{font-size:9em}.mi-10x{font-size:10em}.mi-fw{width:1.25em}.mi-ul{margin-left:2.5em;padding-left:0}.mi-ul>li{position:relative}.mi-li{left:-2em;position:absolute;width:2em;line-height:inherit}.mi-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.mi-pull-left{float:left}.mi-pull-right{float:right}.mi.mi-pull-right{margin-left:.3em}.mi-spin{animation:mi-spin 2s infinite linear}.mi-pulse{animation:mi-spin 1s infinite steps(8)}@keyframes mi-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.mi-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.mi-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.mi-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.mi-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scale(-1,1)}.mi-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(1,-1)}.mi-flip-horizontal.mi-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(-1,-1)}:root .mi-flip-horizontal,:root .mi-flip-vertical,:root .mi-rotate-180,:root .mi-rotate-270,:root .mi-rotate-90{filter:none}.mi-stack{height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.mi-stack-1x,.mi-stack-2x{left:0;position:absolute;width:100%}.mi-stack-1x{line-height:inherit}.mi-stack-2x{font-size:2em}.mi-Accept:before,.mi-AcceptLegacy:before,.mi-CheckmarkListviewLegacy:before,.mi-CheckmarkMenuLegacy:before{content:"\EA01"}.mi-Accident:before{content:"\EA02"}.mi-AccidentSolid:before{content:"\EA03"}.mi-Accounts:before,.mi-AccountsLegacy:before{content:"\EA04"}.mi-ActionCenter:before{content:"\EA05"}.mi-ActionCenterAsterisk:before{content:"\EA06"}.mi-ActionCenterMirrored:before{content:"\EA07"}.mi-ActionCenterNotification:before{content:"\EA08"}.mi-ActionCenterNotificationMirrored:before{content:"\EA09"}.mi-ActionCenterQuiet:before{content:"\EA0A"}.mi-ActionCenterQuietNotification:before{content:"\EA0B"}.mi-Add:before,.mi-AddLegacy:before{content:"\EA0C"}.mi-AddFriend:before,.mi-AddFriendLegacy:before{content:"\EA0D"}.mi-AddRemoteDevice:before{content:"\EA0E"}.mi-AddSurfaceHub:before{content:"\EA0F"}.mi-AddTo:before{content:"\EA10"}.mi-AdjustHologram:before{content:"\EA11"}.mi-Admin:before,.mi-AdminLegacy:before{content:"\EA12"}.mi-Airplane:before{content:"\EA13"}.mi-AirplaneSolid:before{content:"\EA14"}.mi-AlignCenter:before,.mi-AlignCenterLegacy:before{content:"\EA15"}.mi-AlignLeft:before,.mi-AlignLeftLegacy:before{content:"\EA16"}.mi-AlignRight:before,.mi-AlignRightLegacy:before{content:"\EA17"}.mi-AllApps:before,.mi-AllAppsLegacy:before{content:"\EA18"}.mi-AllAppsLegacyMirrored:before,.mi-AllAppsMirrored:before{content:"\EA19"}.mi-Annotation:before{content:"\EA1A"}.mi-AppIconDefault:before{content:"\EA1B"}.mi-Apps:before{content:"\EA1C"}.mi-AreaChart:before{content:"\EA1D"}.mi-ArrowDown8:before{content:"\EA1E"}.mi-ArrowLeft8:before{content:"\EA1F"}.mi-ArrowRight8:before{content:"\EA20"}.mi-ArrowUp8:before{content:"\EA21"}.mi-AspectRatio:before{content:"\EA22"}.mi-Asterisk:before{content:"\EA23"}.mi-AsteriskBadge12:before{content:"\EA24"}.mi-Attach:before,.mi-AttachLegacy:before{content:"\EA25"}.mi-AttachCamera:before,.mi-AttachCameraLegacy:before{content:"\EA26"}.mi-Audio:before,.mi-AudioLegacy:before{content:"\EA27"}.mi-ArrowHTMLLegacy:before,.mi-Back:before,.mi-BackBttnArrow20Legacy:before,.mi-BackBttnArrow42Legacy:before,.mi-BackLegacy:before{content:"\EA28"}.mi-BackMirrored:before{content:"\EA29"}.mi-BackSpaceQWERTYLg:before{content:"\EA2B"}.mi-BackSpaceQWERTYMd:before{content:"\EA2C"}.mi-BackSpaceQWERTYSm:before{content:"\EA2D"}.mi-BackToWindow:before,.mi-BackToWindowLegacy:before{content:"\EA2E"}.mi-BackgroundToggle:before{content:"\EA2F"}.mi-Badge:before{content:"\EA30"}.mi-BandBattery0:before{content:"\EA31"}.mi-BandBattery1:before{content:"\EA32"}.mi-BandBattery2:before{content:"\EA33"}.mi-BandBattery3:before{content:"\EA34"}.mi-BandBattery4:before{content:"\EA35"}.mi-BandBattery5:before{content:"\EA36"}.mi-BandBattery6:before{content:"\EA37"}.mi-Bank:before{content:"\EA38"}.mi-BarcodeScanner:before{content:"\EA39"}.mi-Battery0:before{content:"\EA3A"}.mi-Battery1:before{content:"\EA3B"}.mi-Battery10:before{content:"\EA3C"}.mi-Battery2:before{content:"\EA3D"}.mi-Battery3:before{content:"\EA3E"}.mi-Battery4:before{content:"\EA3F"}.mi-Battery5:before{content:"\EA40"}.mi-Battery6:before{content:"\EA41"}.mi-Battery7:before{content:"\EA42"}.mi-Battery8:before{content:"\EA43"}.mi-Battery9:before{content:"\EA44"}.mi-BatteryCharging0:before{content:"\EA45"}.mi-BatteryCharging1:before{content:"\EA46"}.mi-BatteryCharging10:before{content:"\EA47"}.mi-BatteryCharging2:before{content:"\EA48"}.mi-BatteryCharging3:before{content:"\EA49"}.mi-BatteryCharging4:before{content:"\EA4A"}.mi-BatteryCharging5:before{content:"\EA4B"}.mi-BatteryCharging6:before{content:"\EA4C"}.mi-BatteryCharging7:before{content:"\EA4D"}.mi-BatteryCharging8:before{content:"\EA4E"}.mi-BatteryCharging9:before{content:"\EA4F"}.mi-BatterySaver0:before{content:"\EA50"}.mi-BatterySaver1:before{content:"\EA51"}.mi-BatterySaver10:before{content:"\EA52"}.mi-BatterySaver2:before{content:"\EA53"}.mi-BatterySaver3:before{content:"\EA54"}.mi-BatterySaver4:before{content:"\EA55"}.mi-BatterySaver5:before{content:"\EA56"}.mi-BatterySaver6:before{content:"\EA57"}.mi-BatterySaver7:before{content:"\EA58"}.mi-BatterySaver8:before{content:"\EA59"}.mi-BatterySaver9:before{content:"\EA5A"}.mi-BatteryUnknown:before{content:"\EA5B"}.mi-Beta:before{content:"\EA5C"}.mi-BidiLtr:before{content:"\EA5D"}.mi-BidiRtl:before{content:"\EA5E"}.mi-BlockContact:before,.mi-BlockContactLegacy:before{content:"\EA5F"}.mi-Blocked:before,.mi-BlockedLegacy:before{content:"\EA61"}.mi-BlueLight:before{content:"\EA62"}.mi-Bluetooth:before{content:"\EA63"}.mi-BodyCam:before{content:"\EA64"}.mi-Bold:before,.mi-BoldLegacy:before{content:"\EA65"}.mi-BoldF:before,.mi-BoldFLegacy:before{content:"\EA67"}.mi-BoldG:before,.mi-BoldGLegacy:before{content:"\EA69"}.mi-BoldKorean:before,.mi-BoldKoreanLegacy:before{content:"\EA6B"}.mi-BoldN:before,.mi-BoldNLegacy:before{content:"\EA6D"}.mi-BoldRussion:before,.mi-BoldRussionLegacy:before{content:"\EA6F"}.mi-Bookmarks:before,.mi-BookmarksLegacy:before{content:"\EA70"}.mi-BookmarksLegacyMirrored:before,.mi-BookmarksMirrored:before{content:"\EA71"}.mi-Brightness:before{content:"\EA72"}.mi-Broom:before{content:"\EA73"}.mi-BrowsePhotos:before,.mi-BrowsePhotosLegacy:before{content:"\EA74"}.mi-BrushSize:before{content:"\EA75"}.mi-Bug:before{content:"\EA76"}.mi-BuildingEnergy:before{content:"\EA77"}.mi-BulletedList:before,.mi-BulletedListLegacy:before,.mi-ListLegacy:before{content:"\EA78"}.mi-BulletedListLegacyMirrored:before,.mi-BulletedListMirrored:before,.mi-ListLegacyMirrored:before{content:"\EA79"}.mi-Bullseye:before{content:"\EA7A"}.mi-BumperLeft:before{content:"\EA7B"}.mi-BumperRight:before{content:"\EA7C"}.mi-Bus:before{content:"\EA7D"}.mi-BusSolid:before{content:"\EA7E"}.mi-ButtonA:before{content:"\EA7F"}.mi-ButtonB:before{content:"\EA80"}.mi-ButtonMenu:before{content:"\EA81"}.mi-ButtonView2:before{content:"\EA82"}.mi-ButtonX:before{content:"\EA83"}.mi-ButtonY:before{content:"\EA84"}.mi-CC:before,.mi-CCLegacy:before{content:"\EA85"}.mi-CCEuro:before,.mi-CCEuroLegacy:before{content:"\EA87"}.mi-CCJapan:before,.mi-CCJapanLegacy:before{content:"\EA89"}.mi-Cafe:before{content:"\EA8A"}.mi-Calculator:before,.mi-CalculatorLegacy:before{content:"\EA8B"}.mi-CalculatorAddition:before{content:"\EA8C"}.mi-BackSpaceQWERTY:before,.mi-CalculatorBackspace:before{content:"\EA8D"}.mi-CalculatorDivide:before{content:"\EA8E"}.mi-CalculatorEqualTo:before{content:"\EA8F"}.mi-CalculatorMultiply:before{content:"\EA90"}.mi-CalculatorNegate:before{content:"\EA91"}.mi-CalculatorPercentage:before{content:"\EA92"}.mi-CalculatorSquareroot:before{content:"\EA93"}.mi-CalculatorSubtract:before{content:"\EA94"}.mi-Calendar:before,.mi-CalendarLegacy:before{content:"\EA95"}.mi-CalendarDay:before,.mi-CalendarDayLegacy:before{content:"\EA96"}.mi-CalendarLegacyMirrored:before,.mi-CalendarMirrored:before{content:"\EA97"}.mi-CalendarReply:before,.mi-CalendarReplyLegacy:before{content:"\EA98"}.mi-CalendarSolid:before{content:"\EA99"}.mi-CalendarWeek:before,.mi-CalendarWeekLegacy:before{content:"\EA9A"}.mi-CallForwardInternational:before{content:"\EA9B"}.mi-CallForwardInternationalMirrored:before{content:"\EA9C"}.mi-CallForwardRoaming:before{content:"\EA9D"}.mi-CallForwardRoamingMirrored:before{content:"\EA9E"}.mi-CallForwarding:before{content:"\EA9F"}.mi-CallForwardingMirrored:before{content:"\EAA0"}.mi-CalligraphyFill:before{content:"\EAA1"}.mi-CalligraphyPen:before{content:"\EAA2"}.mi-Calories:before{content:"\EAA3"}.mi-Camera:before,.mi-CameraLegacy:before{content:"\EAA4"}.mi-Cancel:before,.mi-CancelLegacy:before{content:"\EAA5"}.mi-Caption:before,.mi-CaptionLegacy:before{content:"\EAA6"}.mi-Car:before,.mi-DrivingMode:before{content:"\EAA7"}.mi-CaretBottomRightSolidCenter8:before{content:"\EAA8"}.mi-CaretDownSolid8:before{content:"\EAA9"}.mi-CaretLeftSolid8:before{content:"\EAAA"}.mi-CaretRight8:before{content:"\EAAB"}.mi-CaretRightSolid8:before{content:"\EAAC"}.mi-CaretUpSolid8:before{content:"\EAAD"}.mi-CashDrawer:before{content:"\EAAE"}.mi-CellPhone:before,.mi-CellPhoneLegacy:before,.mi-MobileContactLegacy:before{content:"\EAAF"}.mi-Certificate:before{content:"\EAB0"}.mi-CharacterAppearance:before{content:"\EAB1"}.mi-Characters:before,.mi-CharactersLegacy:before{content:"\EAB2"}.mi-ChatBubbles:before{content:"\EAB3"}.mi-CheckList:before{content:"\EAB4"}.mi-CheckMark:before,.mi-CheckMarkLegacy:before,.mi-CheckMarkZeroWidthLegacy:before{content:"\EAB5"}.mi-Checkbox:before,.mi-CheckboxLegacy:before{content:"\EAB6"}.mi-Checkbox14:before{content:"\EAB7"}.mi-CheckboxComposite:before,.mi-CheckboxCompositeLegacy:before{content:"\EAB8"}.mi-CheckboxComposite14:before{content:"\EAB9"}.mi-CheckboxCompositeReversed:before,.mi-CheckboxCompositeReversedLegacy:before{content:"\EABA"}.mi-CheckboxIndeterminate:before,.mi-CheckboxIndeterminateLegacy:before{content:"\EABC"}.mi-CheckboxIndeterminateCombo:before{content:"\EABD"}.mi-CheckboxIndeterminateCombo14:before{content:"\EABE"}.mi-ChecklistMirrored:before{content:"\EABF"}.mi-ChevronDown1Legacy:before,.mi-ChevronDown2Legacy:before,.mi-ChevronDown3Legacy:before,.mi-ChevronDown4Legacy:before,.mi-ChevronDown:before,.mi-ChevronFlipDownLegacy:before,.mi-ScrollChevronDownBoldLegacy:before,.mi-ScrollChevronDownLegacy:before{content:"\EAC0"}.mi-ChevronDownMed:before{content:"\EAC1"}.mi-ChevronDownSmLegacy:before,.mi-ChevronDownSmall:before{content:"\EAC2"}.mi-ChevronFlipLeftLegacy:before,.mi-ChevronLeft1Legacy:before,.mi-ChevronLeft2Legacy:before,.mi-ChevronLeft3Legacy:before,.mi-ChevronLeft4Legacy:before,.mi-ChevronLeft:before,.mi-ScrollChevronLeftBoldLegacy:before,.mi-ScrollChevronLeftLegacy:before{content:"\EAC3"}.mi-ChevronLeftMed:before{content:"\EAC4"}.mi-ChevronLeftSmLegacy:before,.mi-ChevronLeftSmall:before{content:"\EAC5"}.mi-ChevronFlipRightLegacy:before,.mi-ChevronRight1Legacy:before,.mi-ChevronRight2Legacy:before,.mi-ChevronRight3Legacy:before,.mi-ChevronRight4Legacy:before,.mi-ChevronRight:before,.mi-ScrollChevronRightBoldLegacy:before,.mi-ScrollChevronRightLegacy:before{content:"\EAC6"}.mi-ChevronRightMed:before{content:"\EAC7"}.mi-ChevronRightSmLegacy:before,.mi-ChevronRightSmall:before{content:"\EAC8"}.mi-ChevronFlipUpLegacy:before,.mi-ChevronUp1Legacy:before,.mi-ChevronUp2Legacy:before,.mi-ChevronUp3Legacy:before,.mi-ChevronUp4Legacy:before,.mi-ChevronUp:before,.mi-ScrollChevronUpBoldLegacy:before,.mi-ScrollChevronUpLegacy:before{content:"\EAC9"}.mi-ChevronUpMed:before{content:"\EACA"}.mi-ChevronUpSmall:before{content:"\EACB"}.mi-ChineseBoPoMoFo:before{content:"\EACC"}.mi-ChineseChangjie:before{content:"\EACD"}.mi-ChinesePinyin:before{content:"\EACE"}.mi-ChinesePunctuation:before{content:"\EACF"}.mi-ChineseQuick:before{content:"\EAD0"}.mi-ChipCardCreditCardReader:before{content:"\EAD1"}.mi-ChromeAnnotate:before{content:"\EAD2"}.mi-ChromeAnnotateContrast:before{content:"\EAD3"}.mi-ChromeBack:before{content:"\EAD4"}.mi-ChromeBackContrast:before{content:"\EAD5"}.mi-ChromeBackContrastMirrored:before{content:"\EAD6"}.mi-ChromeBackMirrored:before{content:"\EAD7"}.mi-ChromeBackToWindow:before{content:"\EAD8"}.mi-ChromeBackToWindowContrast:before{content:"\EAD9"}.mi-ChromeClose:before{content:"\EADA"}.mi-ChromeCloseContrast:before{content:"\EADB"}.mi-ChromeFullScreen:before{content:"\EADC"}.mi-ChromeFullScreenContrast:before{content:"\EADD"}.mi-ChromeMaximize:before{content:"\EADE"}.mi-ChromeMaximizeContrast:before{content:"\EADF"}.mi-ChromeMinimize:before{content:"\EAE0"}.mi-ChromeMinimizeContrast:before{content:"\EAE1"}.mi-ChromeRestore:before{content:"\EAE2"}.mi-ChromeRestoreContrast:before{content:"\EAE3"}.mi-ChromeSwitch:before{content:"\EAE4"}.mi-ChromeSwitchContast:before{content:"\EAE5"}.mi-CircleFill:before{content:"\EAE6"}.mi-CircleFillBadge12:before{content:"\EAE7"}.mi-CircleRing:before{content:"\EAE8"}.mi-CircleRingBadge12:before{content:"\EAE9"}.mi-CityNext:before{content:"\EAEA"}.mi-CityNext2:before{content:"\EAEB"}.mi-Clear:before,.mi-ClearLegacy:before{content:"\EAEC"}.mi-ClearAllInk:before{content:"\EAED"}.mi-ClearAllInkMirrored:before{content:"\EAEE"}.mi-ClearSelection:before,.mi-ClearSelectionLegacy:before{content:"\EAEF"}.mi-ClearSelectionLegacyMirrored:before,.mi-ClearSelectionMirrored:before{content:"\EAF0"}.mi-Click:before{content:"\EAF1"}.mi-ClipboardList:before{content:"\EAF2"}.mi-ClipboardListMirrored:before{content:"\EAF3"}.mi-ClippingTool:before{content:"\EAF4"}.mi-Clock:before,.mi-ClockLegacy:before{content:"\EAF6"}.mi-ClosePane:before,.mi-ClosePaneLegacy:before{content:"\EAF7"}.mi-ClosePaneLegacyMirrored:before,.mi-ClosePaneMirrored:before{content:"\EAF8"}.mi-Cloud:before{content:"\EAF9"}.mi-CloudPrinter:before{content:"\EAFA"}.mi-CloudSeach:before{content:"\EAFB"}.mi-Code:before{content:"\EAFC"}.mi-CollapseContent:before{content:"\EAFD"}.mi-CollapseContentSingle:before{content:"\EAFE"}.mi-CollateLandscape:before{content:"\EAFF"}.mi-CollateLandscapeSeparated:before{content:"\EB00"}.mi-CollatePortrait:before{content:"\EB01"}.mi-CollatePortraitSeparated:before{content:"\EB02"}.mi-Color:before,.mi-ColorLegacy:before{content:"\EB03"}.mi-ColorOff:before{content:"\EB04"}.mi-CommaKey:before{content:"\EB05"}.mi-CommandPrompt:before{content:"\EB06"}.mi-Comment:before,.mi-CommentLegacy:before{content:"\EB07"}.mi-Communications:before{content:"\EB08"}.mi-CompanionApp:before{content:"\EB09"}.mi-CompanionDeviceFramework:before{content:"\EB0A"}.mi-Completed:before{content:"\EB0B"}.mi-CompletedSolid:before{content:"\EB0C"}.mi-Component:before{content:"\EB0D"}.mi-Connect:before{content:"\EB0E"}.mi-ConnectApp:before,.mi-MiracastLogoLarge:before{content:"\EB0F"}.mi-Connected:before{content:"\EB10"}.mi-Construction:before{content:"\EB11"}.mi-ConstructionCone:before{content:"\EB12"}.mi-ConstructionSolid:before{content:"\EB13"}.mi-Contact3Legacy:before,.mi-Contact:before,.mi-ContactLegacy:before{content:"\EB14"}.mi-Contact2:before,.mi-Contact2Legacy:before{content:"\EB15"}.mi-ContactInfo:before,.mi-ContactInfoLegacy:before{content:"\EB16"}.mi-ContactInfoMirrored:before{content:"\EB17"}.mi-ContactPresence:before,.mi-ContactPresenceLegacy:before{content:"\EB18"}.mi-ContactSolid:before{content:"\EB19"}.mi-Copy:before,.mi-CopyLegacy:before{content:"\EB1A"}.mi-CopyTo:before{content:"\EB1B"}.mi-Courthouse:before{content:"\EB1C"}.mi-Crop:before,.mi-CropLegacy:before{content:"\EB1D"}.mi-CtrlSpatialLeft:before{content:"\EB1E"}.mi-CtrlSpatialRight:before{content:"\EB1F"}.mi-Cut:before,.mi-CutLegacy:before{content:"\EB20"}.mi-DMC:before{content:"\EB21"}.mi-DashKey:before{content:"\EB22"}.mi-DataSense:before{content:"\EB23"}.mi-DataSenseBar:before{content:"\EB24"}.mi-DateTime:before{content:"\EB25"}.mi-DateTimeMirrored:before{content:"\EB26"}.mi-DecreaseIndent:before,.mi-DecreaseIndentLegacy:before{content:"\EB28"}.mi-DecreaseIndentLegacyMirrored:before,.mi-DecreaseIndentMirrored:before{content:"\EB2A"}.mi-DefaultAPN:before{content:"\EB2B"}.mi-DefenderApp:before{content:"\EB2C"}.mi-DefenderBadge12:before{content:"\EB2D"}.mi-Delete:before,.mi-DeleteLegacy:before{content:"\EB2E"}.mi-Design:before{content:"\EB2F"}.mi-DetachablePC:before{content:"\EB30"}.mi-DevUpdate:before{content:"\EB31"}.mi-DeveloperTools:before{content:"\EB32"}.mi-DeviceDiscovery:before{content:"\EB33"}.mi-DeviceLaptopNoPic:before{content:"\EB34"}.mi-DeviceLaptopPic:before{content:"\EB35"}.mi-DeviceMonitorLeftPic:before{content:"\EB36"}.mi-DeviceMonitorNoPic:before{content:"\EB37"}.mi-DeviceMonitorRightPic:before{content:"\EB38"}.mi-Devices:before{content:"\EB39"}.mi-Devices3:before{content:"\EB3B"}.mi-Devices4:before{content:"\EB3C"}.mi-Devices2:before,.mi-DevicesLegacy:before{content:"\EB3D"}.mi-Diagnostic:before{content:"\EB3E"}.mi-Dial1:before{content:"\EB3F"}.mi-Dial10:before{content:"\EB40"}.mi-Dial11:before{content:"\EB41"}.mi-Dial12:before{content:"\EB42"}.mi-Dial13:before{content:"\EB43"}.mi-Dial14:before{content:"\EB44"}.mi-Dial15:before{content:"\EB45"}.mi-Dial16:before{content:"\EB46"}.mi-Dial2:before{content:"\EB47"}.mi-Dial3:before{content:"\EB48"}.mi-Dial4:before{content:"\EB49"}.mi-Dial5:before{content:"\EB4A"}.mi-Dial6:before{content:"\EB4B"}.mi-Dial7:before{content:"\EB4C"}.mi-Dial8:before{content:"\EB4D"}.mi-Dial9:before{content:"\EB4E"}.mi-DialShape1:before{content:"\EB4F"}.mi-DialShape2:before{content:"\EB50"}.mi-DialShape3:before{content:"\EB51"}.mi-DialShape4:before{content:"\EB52"}.mi-DialUp:before{content:"\EB53"}.mi-Dialpad:before{content:"\EB54"}.mi-Dictionary:before{content:"\EB55"}.mi-DictionaryAdd:before{content:"\EB56"}.mi-DictionaryCloud:before{content:"\EB57"}.mi-DirectAccess:before{content:"\EB58"}.mi-Directions:before,.mi-DirectionsLegacy:before{content:"\EB59"}.mi-DisableUpdates:before,.mi-DisableUpdatesLegacy:before{content:"\EB5A"}.mi-DisconnectDisplay:before{content:"\EB5B"}.mi-DisconnectDrive:before,.mi-DisconnectDriveLegacy:before{content:"\EB5C"}.mi-Dislike:before,.mi-DislikeLegacy:before{content:"\EB5D"}.mi-Dock:before{content:"\EB5E"}.mi-DockBottom:before,.mi-DockBottomLegacy:before{content:"\EB5F"}.mi-DockLeft:before,.mi-DockLeftLegacy:before{content:"\EB60"}.mi-DockLeftLegacyMirrored:before,.mi-DockLeftMirrored:before{content:"\EB61"}.mi-DockRight:before,.mi-DockRightLegacy:before{content:"\EB62"}.mi-DockRightLegacyMirrored:before,.mi-DockRightMirrored:before{content:"\EB63"}.mi-Document:before,.mi-DocumentLegacy:before{content:"\EB64"}.mi-DoublePinyin:before{content:"\EB65"}.mi-Down:before,.mi-DownLegacy:before{content:"\EB66"}.mi-DownShiftKey:before{content:"\EB67"}.mi-Download:before,.mi-DownloadLegacy:before{content:"\EB68"}.mi-DownloadMap:before{content:"\EB69"}.mi-Dpad:before{content:"\EB6A"}.mi-Draw:before{content:"\EB6B"}.mi-DrawSolid:before{content:"\EB6C"}.mi-Drop:before{content:"\EB6D"}.mi-DullSound:before{content:"\EB6E"}.mi-DullSoundKey:before{content:"\EB6F"}.mi-DuplexLandscapeOneSided:before{content:"\EB70"}.mi-DuplexLandscapeOneSidedMirrored:before{content:"\EB71"}.mi-DuplexLandscapeTwoSidedLongEdge:before{content:"\EB72"}.mi-DuplexLandscapeTwoSidedLongEdgeMirrored:before{content:"\EB73"}.mi-DuplexLandscapeTwoSidedShortEdge:before{content:"\EB74"}.mi-DuplexLandscapeTwoSidedShortEdgeMirrored:before{content:"\EB75"}.mi-DuplexPortraitOneSided:before{content:"\EB76"}.mi-DuplexPortraitOneSidedMirrored:before{content:"\EB77"}.mi-DuplexPortraitTwoSidedLongEdge:before{content:"\EB78"}.mi-DuplexPortraitTwoSidedLongEdgeMirrored:before{content:"\EB79"}.mi-DuplexPortraitTwoSidedShortEdge:before{content:"\EB7A"}.mi-DuplexPortraitTwoSidedShortEdgeMirrored:before{content:"\EB7B"}.mi-DynamicLock:before{content:"\EB7C"}.mi-EMI:before{content:"\EB7D"}.mi-Ear:before{content:"\EB7E"}.mi-Earbud:before{content:"\EB7F"}.mi-EaseOfAccess:before,.mi-EaseOfAccessLegacy:before{content:"\EB80"}.mi-Edit:before,.mi-EditLegacy:before{content:"\EB81"}.mi-EditLegacyMirrored:before,.mi-EditMirrored:before{content:"\EB82"}.mi-Education:before{content:"\EB83"}.mi-Emoji:before,.mi-EmojiLegacy:before{content:"\EB84"}.mi-Emoji2:before,.mi-Emoji2Legacy:before{content:"\EB85"}.mi-EmojiSwatch:before{content:"\EB86"}.mi-EmojiTabCelebrationObjects:before{content:"\EB87"}.mi-EmojiTabFavorites:before{content:"\EB88"}.mi-EmojiTabFoodPlants:before{content:"\EB89"}.mi-EmojiTabPeople:before{content:"\EB8A"}.mi-EmojiTabSmilesAnimals:before{content:"\EB8B"}.mi-EmojiTabSymbols:before{content:"\EB8C"}.mi-EmojiTabTextSmiles:before{content:"\EB8D"}.mi-EmojiTabTransitPlaces:before{content:"\EB8E"}.mi-EndPointSolid:before{content:"\EB90"}.mi-EnglishPunctuation:before{content:"\EB91"}.mi-Equalizer:before{content:"\EB92"}.mi-EraseTool:before{content:"\EB93"}.mi-EraseToolFill:before{content:"\EB94"}.mi-EraseToolFill2:before{content:"\EB95"}.mi-Error:before{content:"\EB96"}.mi-ErrorBadge:before{content:"\EB97"}.mi-ErrorBadge12:before{content:"\EB98"}.mi-Ethernet:before{content:"\EB99"}.mi-EthernetError:before{content:"\EB9A"}.mi-EthernetWarning:before{content:"\EB9B"}.mi-ExpandTile:before,.mi-ExpandTileLegacy:before{content:"\EB9C"}.mi-ExpandTileLegacyMirrored:before,.mi-ExpandTileMirrored:before{content:"\EB9D"}.mi-ExploitProtectionSettings:before{content:"\EB9E"}.mi-ExploreContent:before{content:"\EB9F"}.mi-ExploreContentSingle:before{content:"\EBA0"}.mi-Export:before,.mi-ImportLegacyMirrored:before,.mi-ImportMirrored:before{content:"\EBA1"}.mi-EyeGaze:before{content:"\EBA2"}.mi-Eyedropper:before{content:"\EBA3"}.mi-Family:before{content:"\EBA4"}.mi-FastForward:before{content:"\EBA5"}.mi-Favicon:before{content:"\EBA6"}.mi-FavoriteList:before{content:"\EBA8"}.mi-FavoriteInlineLegacy:before,.mi-FavoriteStar:before,.mi-OutlineStarLegacy:before,.mi-RatingStarLegacy:before,.mi-Unfavorite2Legacy:before{content:"\EBA9"}.mi-Favorite2Legacy:before,.mi-FavoriteLegacy:before,.mi-FavoriteStarFill:before,.mi-RatingStarFillLegacy:before,.mi-RatingStarFillReducedPaddingHTMLLegacy:before,.mi-RatingStarFillSmallLegacy:before,.mi-RatingStarFillZeroWidthLegacy:before,.mi-SolidStarLegacy:before{content:"\EBAA"}.mi-Feedback:before{content:"\EBAB"}.mi-FeedbackApp:before{content:"\EBAC"}.mi-Ferry:before{content:"\EBAD"}.mi-FerrySolid:before{content:"\EBAE"}.mi-FileExplorer:before{content:"\EBAF"}.mi-FileExplorerApp:before{content:"\EBB0"}.mi-Filter:before,.mi-FilterLegacy:before{content:"\EBB1"}.mi-FingerInking:before{content:"\EBB2"}.mi-Fingerprint:before{content:"\EBB3"}.mi-FitPage:before{content:"\EBB4"}.mi-EndPoint:before,.mi-Flag:before,.mi-FlagLegacy:before{content:"\EBB5"}.mi-Flashlight:before{content:"\EBB6"}.mi-FlickDown:before{content:"\EBB7"}.mi-FlickLeft:before{content:"\EBB8"}.mi-FlickRight:before{content:"\EBB9"}.mi-FlickUp:before{content:"\EBBA"}.mi-Folder:before{content:"\EBBB"}.mi-FolderFill:before,.mi-FolderLegacy:before{content:"\EBBC"}.mi-FolderHorizontal:before{content:"\EBBD"}.mi-FolderOpen:before{content:"\EBBE"}.mi-Font:before,.mi-FontLegacy:before{content:"\EBBF"}.mi-FontColor:before,.mi-FontColorLegacy:before{content:"\EBC0"}.mi-FontColorKorean:before,.mi-FontColorKoreanLegacy:before{content:"\EBC2"}.mi-FontDecrease:before,.mi-FontDecreaseLegacy:before{content:"\EBC3"}.mi-FontIncrease:before,.mi-FontIncreaseLegacy:before{content:"\EBC4"}.mi-FontSize:before,.mi-FontSizeLegacy:before{content:"\EBC5"}.mi-FontStyleKorean:before,.mi-FontStyleKoreanLegacy:before{content:"\EBC7"}.mi-ArrowHTMLLegacyMirrored:before,.mi-BackBttnMirroredArrow20Legacy:before,.mi-BackBttnMirroredArrow42Legacy:before,.mi-Forward:before,.mi-ForwardLegacy:before{content:"\EBC8"}.mi-ForwardMirrored:before{content:"\EBC9"}.mi-ForwardSm:before{content:"\EBCA"}.mi-FourBars:before,.mi-FourBarsLegacy:before{content:"\EBCB"}.mi-FreeFormClipping:before{content:"\EBCC"}.mi-Frigid:before{content:"\EBCD"}.mi-FullAlpha:before{content:"\EBCE"}.mi-FullCircleMask:before{content:"\EBCF"}.mi-FullHiragana:before{content:"\EBD0"}.mi-FullKatakana:before{content:"\EBD1"}.mi-FullScreen:before,.mi-FullScreenLegacy:before{content:"\EBD2"}.mi-FuzzyReading:before{content:"\EBD3"}.mi-GIF:before{content:"\EBD4"}.mi-Game:before{content:"\EBD5"}.mi-GameConsole:before{content:"\EBD6"}.mi-GiftboxOpen:before{content:"\EBD7"}.mi-GlobalNavigationButton:before{content:"\EBD8"}.mi-Globe:before,.mi-GlobeLegacy:before{content:"\EBD9"}.mi-Go:before,.mi-GoLegacy:before{content:"\EBDA"}.mi-GoLegacyMirrored:before,.mi-GoMirrored:before{content:"\EBDB"}.mi-GoToStart:before,.mi-GoToStartLegacy:before{content:"\EBDC"}.mi-GotoToday:before,.mi-GotoTodayLegacy:before{content:"\EBDD"}.mi-GridView:before{content:"\EBDE"}.mi-GripperBarHorizontal:before{content:"\EBDF"}.mi-GripperBarVertical:before{content:"\EBE0"}.mi-GripperResize:before{content:"\EBE1"}.mi-GripperResizeMirrored:before{content:"\EBE2"}.mi-GripperTool:before{content:"\EBE3"}.mi-Groceries:before{content:"\EBE4"}.mi-Group:before{content:"\EBE5"}.mi-GroupList:before{content:"\EBE6"}.mi-GuestUser:before{content:"\EBE7"}.mi-HMD:before{content:"\EBE8"}.mi-HWPInsert:before{content:"\EBE9"}.mi-HWPJoin:before{content:"\EBEA"}.mi-HWPNewLine:before{content:"\EBEB"}.mi-HWPOverwrite:before{content:"\EBEC"}.mi-HWPScratchOut:before{content:"\EBED"}.mi-HWPSplit:before{content:"\EBEE"}.mi-HWPStrikeThrough:before{content:"\EBEF"}.mi-HalfAlpha:before{content:"\EBF0"}.mi-HalfDullSound:before{content:"\EBF1"}.mi-HalfKatakana:before{content:"\EBF2"}.mi-HalfStarLeft:before{content:"\EBF3"}.mi-HalfStarRight:before{content:"\EBF4"}.mi-Handwriting:before{content:"\EBF5"}.mi-HangUp:before,.mi-HangUpLegacy:before{content:"\EBF6"}.mi-HardDrive:before{content:"\EBF7"}.mi-HeadlessDevice:before{content:"\EBF8"}.mi-Headphone:before{content:"\EBF9"}.mi-Headphone0:before{content:"\EBFA"}.mi-Headphone1:before{content:"\EBFB"}.mi-Headphone2:before{content:"\EBFC"}.mi-Headphone3:before{content:"\EBFD"}.mi-Headset:before{content:"\EBFE"}.mi-Health:before{content:"\EBFF"}.mi-Heart:before,.mi-HeartLegacy:before{content:"\EC00"}.mi-HeartBroken:before{content:"\EC01"}.mi-HeartBrokenLegacy:before,.mi-HeartBrokenZeroWidthLegacy:before{content:"\EC02"}.mi-HeartFill:before,.mi-HeartFillLegacy:before,.mi-HeartFillZeroWidthLegacy:before{content:"\EC03"}.mi-Help:before,.mi-HelpLegacy:before{content:"\EC04"}.mi-HelpLegacyMirrored:before,.mi-HelpMirrored:before{content:"\EC05"}.mi-HideBcc:before,.mi-HideBccLegacy:before{content:"\EC06"}.mi-Highlight:before,.mi-HighlightLegacy:before{content:"\EC07"}.mi-HighlightFill:before{content:"\EC08"}.mi-HighlightFill2:before{content:"\EC09"}.mi-History:before{content:"\EC0A"}.mi-HolePunchLandscapeBottom:before{content:"\EC0B"}.mi-HolePunchLandscapeLeft:before{content:"\EC0C"}.mi-HolePunchLandscapeRight:before{content:"\EC0D"}.mi-HolePunchLandscapeTop:before{content:"\EC0E"}.mi-HolePunchOff:before{content:"\EC0F"}.mi-HolePunchPortraitBottom:before{content:"\EC10"}.mi-HolePunchPortraitLeft:before{content:"\EC11"}.mi-HolePunchPortraitRight:before{content:"\EC12"}.mi-HolePunchPortraitTop:before{content:"\EC13"}.mi-HoloLensSelected:before{content:"\EC14"}.mi-Home:before,.mi-HomeLegacy:before{content:"\EC15"}.mi-HomeGroup:before{content:"\EC16"}.mi-HomeSolid:before{content:"\EC17"}.mi-HorizontalTabKey:before{content:"\EC18"}.mi-IBeam:before{content:"\EC19"}.mi-IBeamOutline:before{content:"\EC1A"}.mi-IOT:before{content:"\EC1B"}.mi-ImageExport:before{content:"\EC1C"}.mi-ExportMirrored:before,.mi-Import:before,.mi-ImportLegacy:before{content:"\EC1D"}.mi-ImportAll:before,.mi-ImportAllLegacy:before{content:"\EC1E"}.mi-ImportAllLegacyMirrored:before,.mi-ImportAllMirrored:before{content:"\EC1F"}.mi-Important:before,.mi-ImportantLegacy:before{content:"\EC20"}.mi-ImportantBadge12:before{content:"\EC21"}.mi-InPrivate:before{content:"\EC22"}.mi-IncidentTriangle:before{content:"\EC23"}.mi-IncreaseIndent:before,.mi-IncreaseIndentLegacy:before{content:"\EC25"}.mi-IncreaseIndentLegacyMirrored:before,.mi-IncreaseIndentMirrored:before{content:"\EC27"}.mi-Info:before{content:"\EC28"}.mi-Info2:before{content:"\EC29"}.mi-InfoSolid:before{content:"\EC2A"}.mi-InkingCaret:before{content:"\EC2B"}.mi-InkingColorFill:before{content:"\EC2C"}.mi-InkingColorOutline:before{content:"\EC2D"}.mi-InkingTool:before{content:"\EC2E"}.mi-InkingToolFill:before{content:"\EC2F"}.mi-InkingToolFill2:before{content:"\EC30"}.mi-Input:before{content:"\EC31"}.mi-InsiderHubApp:before{content:"\EC32"}.mi-InteractiveDashboard:before{content:"\EC33"}.mi-Italic:before,.mi-ItalicLegacy:before{content:"\EC34"}.mi-ItalicC:before,.mi-ItalicCLegacy:before{content:"\EC36"}.mi-ItalicI:before,.mi-ItalicILegacy:before{content:"\EC38"}.mi-ItalicK:before,.mi-ItalicKLegacy:before{content:"\EC3A"}.mi-ItalicKorean:before,.mi-ItalicKoreanLegacy:before{content:"\EC3C"}.mi-ItalicRussian:before,.mi-ItalicRussianLegacy:before{content:"\EC3E"}.mi-Japanese:before{content:"\EC3F"}.mi-JpnRomanji:before{content:"\EC40"}.mi-JpnRomanjiLock:before{content:"\EC41"}.mi-JpnRomanjiShift:before{content:"\EC42"}.mi-JpnRomanjiShiftLock:before{content:"\EC43"}.mi-Key12On:before{content:"\EC44"}.mi-Keyboard12Key:before{content:"\EC46"}.mi-KeyboardBrightness:before{content:"\EC47"}.mi-KeyBoardLegacy:before,.mi-KeyboardClassic:before{content:"\EC48"}.mi-KeyboardDismiss:before{content:"\EC49"}.mi-KeyboardDock:before{content:"\EC4A"}.mi-KeyboardFull:before{content:"\EC4B"}.mi-KeyboardLeftAligned:before{content:"\EC4C"}.mi-KeyboardLeftDock:before{content:"\EC4D"}.mi-KeyboardLeftHanded:before{content:"\EC4E"}.mi-KeyboardLowerBrightness:before{content:"\EC4F"}.mi-KeyboardNarrow:before{content:"\EC50"}.mi-KeyboardOneHanded:before{content:"\EC51"}.mi-KeyboardRightAligned:before{content:"\EC52"}.mi-KeyboardRightDock:before{content:"\EC53"}.mi-KeyboardRightHanded:before{content:"\EC54"}.mi-KeyboardSettings:before{content:"\EC55"}.mi-KeyboardShortcut:before{content:"\EC56"}.mi-KeyboardSplit:before,.mi-KeyboardSplitLegacy:before{content:"\EC57"}.mi-KeyboardStandard:before,.mi-KeyboardStandardLegacy:before{content:"\EC58"}.mi-KeyboardUndock:before{content:"\EC59"}.mi-KnowledgeArticle:before{content:"\EC5A"}.mi-Korean:before{content:"\EC5B"}.mi-LEDLight:before{content:"\EC5C"}.mi-Label:before{content:"\EC5D"}.mi-LandscapeOrientation:before{content:"\EC5E"}.mi-LandscapeOrientationMirrored:before{content:"\EC5F"}.mi-LangJPN:before{content:"\EC60"}.mi-LanguageChs:before{content:"\EC61"}.mi-LanguageCht:before{content:"\EC62"}.mi-LanguageJpn:before{content:"\EC63"}.mi-LanguageKor:before{content:"\EC64"}.mi-LaptopSecure:before{content:"\EC65"}.mi-LaptopSelected:before{content:"\EC66"}.mi-LargeErase:before{content:"\EC67"}.mi-Layout:before,.mi-LayoutLegacy:before{content:"\EC69"}.mi-Leaf:before{content:"\EC6A"}.mi-LeaveChat:before,.mi-LeaveChatLegacy:before{content:"\EC6B"}.mi-LeaveChatMirrored:before{content:"\EC6C"}.mi-LeftArrowKeyTime0:before{content:"\EC6D"}.mi-LeftDoubleQuote:before{content:"\EC6E"}.mi-LeftQuote:before{content:"\EC6F"}.mi-LeftStick:before{content:"\EC70"}.mi-Lexicon:before{content:"\EC71"}.mi-Library:before,.mi-LibraryLegacy:before{content:"\EC72"}.mi-Light:before{content:"\EC73"}.mi-LightningBolt:before{content:"\EC75"}.mi-Like:before,.mi-LikeInlineLegacy:before,.mi-LikeLegacy:before{content:"\EC76"}.mi-LikeDislike:before,.mi-LikeDislikeLegacy:before{content:"\EC77"}.mi-LineDisplay:before{content:"\EC78"}.mi-Link:before,.mi-LinkLegacy:before{content:"\EC79"}.mi-List:before{content:"\EC7A"}.mi-ListMirrored:before{content:"\EC7B"}.mi-Location:before,.mi-LocationLegacy:before{content:"\EC7C"}.mi-Lock:before,.mi-LockLegacy:before{content:"\EC7D"}.mi-LockFeedback:before{content:"\EC7E"}.mi-LockScreenGlance:before{content:"\EC7F"}.mi-LockscreenDesktop:before{content:"\EC80"}.mi-LowerBrightness:before{content:"\EC81"}.mi-MagStripeReader:before{content:"\EC82"}.mi-Mail:before,.mi-MailLegacy:before{content:"\EC83"}.mi-MailBadge12:before{content:"\EC84"}.mi-MailFill:before,.mi-MailFillLegacy:before,.mi-MailMessageLegacy:before{content:"\EC85"}.mi-MailForward:before,.mi-MailForwardLegacy:before{content:"\EC86"}.mi-MailForwardLegacyMirrored:before,.mi-MailForwardMirrored:before{content:"\EC87"}.mi-MailReply:before,.mi-MailReplyLegacy:before{content:"\EC88"}.mi-MailReplyAll:before,.mi-MailReplyAllLegacy:before{content:"\EC89"}.mi-MailReplyAllLegacyMirrored:before,.mi-MailReplyAllMirrored:before{content:"\EC8A"}.mi-MailReplyLegacyMirrored:before,.mi-MailReplyMirrored:before{content:"\EC8B"}.mi-Manage:before,.mi-ManageLegacy:before{content:"\EC8C"}.mi-MapCompassBottom:before{content:"\EC8D"}.mi-MapCompassTop:before{content:"\EC8E"}.mi-MapDirections:before{content:"\EC8F"}.mi-MapDrive:before,.mi-MapDriveLegacy:before{content:"\EC90"}.mi-MapLayers:before{content:"\EC91"}.mi-MapLegacy:before,.mi-MapPin:before{content:"\EC92"}.mi-MapPin2:before,.mi-MapPinLegacy:before{content:"\EC94"}.mi-Marker:before{content:"\EC95"}.mi-Marquee:before{content:"\EC96"}.mi-Media:before{content:"\EC97"}.mi-MediaStorageTower:before{content:"\EC98"}.mi-Megaphone:before{content:"\EC99"}.mi-Memo:before,.mi-MemoLegacy:before{content:"\EC9A"}.mi-CommentInlineLegacy:before,.mi-Message:before,.mi-MessageLegacy:before{content:"\EC9B"}.mi-MicClipping:before{content:"\EC9C"}.mi-MicError:before{content:"\EC9D"}.mi-MicOff:before{content:"\EC9E"}.mi-MicOn:before{content:"\EC9F"}.mi-MicSleep:before{content:"\ECA0"}.mi-Microphone:before,.mi-MicrophoneLegacy:before{content:"\ECA1"}.mi-MicrophoneListening:before{content:"\ECA2"}.mi-MiracastLogoSmall:before{content:"\ECA3"}.mi-MixVolumes:before{content:"\ECA4"}.mi-MobActionCenter:before{content:"\ECA5"}.mi-MobAirplane:before{content:"\ECA6"}.mi-MobBattery0:before{content:"\ECA7"}.mi-MobBattery1:before{content:"\ECA8"}.mi-MobBattery10:before{content:"\ECA9"}.mi-MobBattery2:before{content:"\ECAA"}.mi-MobBattery3:before{content:"\ECAB"}.mi-MobBattery4:before{content:"\ECAC"}.mi-MobBattery5:before{content:"\ECAD"}.mi-MobBattery6:before{content:"\ECAE"}.mi-MobBattery7:before{content:"\ECAF"}.mi-MobBattery8:before{content:"\ECB0"}.mi-MobBattery9:before{content:"\ECB1"}.mi-MobBatteryCharging0:before{content:"\ECB2"}.mi-MobBatteryCharging1:before{content:"\ECB3"}.mi-MobBatteryCharging10:before{content:"\ECB4"}.mi-MobBatteryCharging2:before{content:"\ECB5"}.mi-MobBatteryCharging3:before{content:"\ECB6"}.mi-MobBatteryCharging4:before{content:"\ECB7"}.mi-MobBatteryCharging5:before{content:"\ECB8"}.mi-MobBatteryCharging6:before{content:"\ECB9"}.mi-MobBatteryCharging7:before{content:"\ECBA"}.mi-MobBatteryCharging8:before{content:"\ECBB"}.mi-MobBatteryCharging9:before{content:"\ECBC"}.mi-MobBatterySaver0:before{content:"\ECBD"}.mi-MobBatterySaver1:before{content:"\ECBE"}.mi-MobBatterySaver10:before{content:"\ECBF"}.mi-MobBatterySaver2:before{content:"\ECC0"}.mi-MobBatterySaver3:before{content:"\ECC1"}.mi-MobBatterySaver4:before{content:"\ECC2"}.mi-MobBatterySaver5:before{content:"\ECC3"}.mi-MobBatterySaver6:before{content:"\ECC4"}.mi-MobBatterySaver7:before{content:"\ECC5"}.mi-MobBatterySaver8:before{content:"\ECC6"}.mi-MobBatterySaver9:before{content:"\ECC7"}.mi-MobBatteryUnknown:before{content:"\ECC8"}.mi-MobBluetooth:before{content:"\ECC9"}.mi-MobCallForwarding:before{content:"\ECCA"}.mi-MobCallForwardingMirrored:before{content:"\ECCB"}.mi-MobDrivingMode:before{content:"\ECCC"}.mi-MobLocation:before{content:"\ECCD"}.mi-MobQuietHours:before{content:"\ECCE"}.mi-MobSIMError:before{content:"\ECCF"}.mi-MobSIMLock:before{content:"\ECD0"}.mi-MobSIMMissing:before{content:"\ECD1"}.mi-MobSignal1:before{content:"\ECD2"}.mi-MobSignal2:before{content:"\ECD3"}.mi-MobSignal3:before{content:"\ECD4"}.mi-MobSignal4:before{content:"\ECD5"}.mi-MobSignal5:before{content:"\ECD6"}.mi-MobWifi1:before{content:"\ECD7"}.mi-MobWifi2:before{content:"\ECD8"}.mi-MobWifi3:before{content:"\ECD9"}.mi-MobWifi4:before{content:"\ECDA"}.mi-MobWifiHotspot:before{content:"\ECDB"}.mi-MobWifiWarning1:before{content:"\ECDC"}.mi-MobWifiWarning2:before{content:"\ECDD"}.mi-MobWifiWarning3:before{content:"\ECDE"}.mi-MobWifiWarning4:before{content:"\ECDF"}.mi-MobeSIM:before{content:"\ECE0"}.mi-MobeSIMBusy:before{content:"\ECE1"}.mi-MobeSIMLocked:before{content:"\ECE2"}.mi-MobeSIMNoProfile:before{content:"\ECE3"}.mi-MobileLocked:before{content:"\ECE4"}.mi-MobileSelected:before{content:"\ECE5"}.mi-MobileTablet:before{content:"\ECE6"}.mi-More:before,.mi-MoreLegacy:before{content:"\ECE7"}.mi-Mouse:before{content:"\ECE8"}.mi-MoveToFolder:before,.mi-MoveToFolderLegacy:before{content:"\ECE9"}.mi-Movies:before{content:"\ECEA"}.mi-MultiSelect:before,.mi-MultiSelectLegacy:before{content:"\ECEB"}.mi-MultiSelectLegacyMirrored:before,.mi-MultiSelectMirrored:before{content:"\ECEC"}.mi-MultimediaDMP:before{content:"\ECED"}.mi-MultimediaDMS:before{content:"\ECEE"}.mi-MultimediaDVR:before{content:"\ECEF"}.mi-MultimediaPMP:before{content:"\ECF0"}.mi-Multitask:before{content:"\ECF1"}.mi-Multitask16:before{content:"\ECF2"}.mi-MultitaskExpanded:before{content:"\ECF3"}.mi-MusicAlbum:before{content:"\ECF4"}.mi-MusicInfo:before,.mi-MusicInfoLegacy:before{content:"\ECF5"}.mi-MusicNote:before{content:"\ECF6"}.mi-MusicSharing:before{content:"\ECF7"}.mi-MusicSharingOff:before{content:"\ECF8"}.mi-Mute:before,.mi-MuteLegacy:before{content:"\ECF9"}.mi-MyNetwork:before{content:"\ECFA"}.mi-NUIFPContinueSlideAction:before{content:"\ECFB"}.mi-NUIFPContinueSlideHand:before{content:"\ECFC"}.mi-NUIFPPressAction:before{content:"\ECFD"}.mi-NUIFPPressHand:before{content:"\ECFE"}.mi-NUIFPPressRepeatAction:before{content:"\ECFF"}.mi-NUIFPRollLeftAction:before{content:"\ED00"}.mi-NUIFPRollLeftHand:before{content:"\ED01"}.mi-NUIFPRollRightHand:before{content:"\ED02"}.mi-NUIFPRollRightHandAction:before{content:"\ED03"}.mi-NUIFPStartSlideAction:before{content:"\ED04"}.mi-NUIFPPressRepeatHand:before,.mi-NUIFPStartSlideHand:before{content:"\ED05"}.mi-NUIFace:before{content:"\ED06"}.mi-NUIIris:before{content:"\ED07"}.mi-Narrator:before{content:"\ED08"}.mi-NarratorForward:before{content:"\ED09"}.mi-NarratorForwardMirrored:before{content:"\ED0A"}.mi-NearbySharing:before{content:"\ED0B"}.mi-Network:before{content:"\ED0C"}.mi-NetworkAdapter:before{content:"\ED0D"}.mi-NetworkConnected:before{content:"\ED0E"}.mi-NetworkConnectedCheckmark:before{content:"\ED0F"}.mi-NetworkOffline:before{content:"\ED10"}.mi-NetworkPrinter:before{content:"\ED11"}.mi-NetworkSharing:before{content:"\ED12"}.mi-NetworkTower:before{content:"\ED13"}.mi-NewFolder:before,.mi-NewFolderLegacy:before{content:"\ED14"}.mi-NewWindow:before,.mi-NewWindowLegacy:before{content:"\ED15"}.mi-Next:before,.mi-NextLegacy:before{content:"\ED16"}.mi-NoiseCancelation:before{content:"\ED17"}.mi-NoiseCancelationOff:before{content:"\ED18"}.mi-OEM:before{content:"\ED19"}.mi-OneBar:before,.mi-OneBarLegacy:before{content:"\ED1A"}.mi-OpenFile:before,.mi-OpenFileLegacy:before{content:"\ED1B"}.mi-OpenFolderHorizontal:before{content:"\ED1C"}.mi-OpenInNewWindow:before,.mi-OpenInNewWindowLegacy:before{content:"\ED1D"}.mi-OpenLocal:before,.mi-OpenLocalLegacy:before{content:"\ED1E"}.mi-OpenPane:before,.mi-OpenPaneLegacy:before{content:"\ED1F"}.mi-OpenPaneLegacyMirrored:before,.mi-OpenPaneMirrored:before{content:"\ED20"}.mi-OpenWith:before,.mi-OpenWithLegacy:before{content:"\ED21"}.mi-OpenWithLegacyMirrored:before,.mi-OpenWithMirrored:before{content:"\ED22"}.mi-Orientation:before,.mi-OrientationLegacy:before{content:"\ED23"}.mi-OtherUser:before,.mi-OtherUserLegacy:before{content:"\ED24"}.mi-OutlineHalfStarLeft:before{content:"\ED25"}.mi-OutlineHalfStarRight:before{content:"\ED26"}.mi-OutlineQuarterStarLeft:before{content:"\ED27"}.mi-OutlineQuarterStarRight:before{content:"\ED28"}.mi-OutlineStarLeftHalf:before{content:"\ED29"}.mi-OutlineStarRightHalf:before{content:"\ED2A"}.mi-OutlineThreeQuarterStarLeft:before{content:"\ED2B"}.mi-OutlineThreeQuarterStarRight:before{content:"\ED2C"}.mi-PC1:before,.mi-PC1Legacy:before{content:"\ED2D"}.mi-PINPad:before{content:"\ED2E"}.mi-PLAP:before{content:"\ED2F"}.mi-PPSFourLandscape:before{content:"\ED30"}.mi-PPSFourPortrait:before{content:"\ED31"}.mi-PPSOneLandscape:before{content:"\ED32"}.mi-PPSOnePortrait:before{content:"\ED33"}.mi-PPSTwoLandscape:before{content:"\ED34"}.mi-PPSTwoPortrait:before{content:"\ED35"}.mi-Package:before{content:"\ED36"}.mi-Page:before,.mi-PageLegacy:before{content:"\ED37"}.mi-PageLeft:before{content:"\ED38"}.mi-PageMarginLandscapeModerate:before{content:"\ED39"}.mi-PageMarginLandscapeNarrow:before{content:"\ED3A"}.mi-PageMarginLandscapeNormal:before{content:"\ED3B"}.mi-PageMarginLandscapeWide:before{content:"\ED3C"}.mi-PageMarginPortraitModerate:before{content:"\ED3D"}.mi-PageMarginPortraitNarrow:before{content:"\ED3E"}.mi-PageMarginPortraitNormal:before{content:"\ED3F"}.mi-PageMarginPortraitWide:before{content:"\ED40"}.mi-PageMirrored:before{content:"\ED41"}.mi-PageRight:before{content:"\ED42"}.mi-PageFillLegacy:before,.mi-PageSolid:before{content:"\ED43"}.mi-PaginationDotOutline10:before{content:"\ED44"}.mi-PaginationDotSolid10:before{content:"\ED45"}.mi-PanMode:before{content:"\ED46"}.mi-ParkingLocation:before{content:"\ED47"}.mi-ParkingLocationMirrored:before{content:"\ED48"}.mi-ParkingLocationSolid:before{content:"\ED49"}.mi-PartyLeader:before{content:"\ED4A"}.mi-PassiveAuthentication:before{content:"\ED4B"}.mi-PasswordKeyHide:before{content:"\ED4C"}.mi-PasswordKeyShow:before{content:"\ED4D"}.mi-Paste:before,.mi-PasteLegacy:before{content:"\ED4E"}.mi-Pause:before,.mi-PauseLegacy:before{content:"\ED4F"}.mi-PauseBadge12:before{content:"\ED50"}.mi-PaymentCard:before{content:"\ED51"}.mi-PenPalette:before{content:"\ED52"}.mi-PenPaletteMirrored:before{content:"\ED53"}.mi-PenTips:before{content:"\ED54"}.mi-PenTipsMirrored:before{content:"\ED55"}.mi-PenWorkspace:before{content:"\ED56"}.mi-PenWorkspaceMirrored:before{content:"\ED57"}.mi-Pencil:before{content:"\ED58"}.mi-PencilFill:before{content:"\ED59"}.mi-People:before,.mi-PeopleLegacy:before{content:"\ED5A"}.mi-PeriodKey:before{content:"\ED5B"}.mi-Permissions:before,.mi-PermissionsLegacy:before{content:"\ED5C"}.mi-PersonalFolder:before{content:"\ED5D"}.mi-Personalize:before{content:"\ED5E"}.mi-Phone:before,.mi-PhoneLegacy:before{content:"\ED5F"}.mi-PhoneBook:before,.mi-PhoneBookLegacy:before{content:"\ED60"}.mi-Photo:before{content:"\ED61"}.mi-Photo2:before{content:"\ED62"}.mi-Picture:before,.mi-PictureLegacy:before{content:"\ED63"}.mi-PieSingle:before{content:"\ED64"}.mi-Pin:before,.mi-PinLegacy:before{content:"\ED65"}.mi-PinFill:before{content:"\ED66"}.mi-Pinned:before{content:"\ED67"}.mi-PinnedFill:before{content:"\ED68"}.mi-PinyinIMELogo:before{content:"\ED69"}.mi-PlaceFolder:before,.mi-PlaceFolderLegacy:before{content:"\ED6B"}.mi-Play:before,.mi-PlayLegacy:before{content:"\ED6C"}.mi-Play36:before{content:"\ED6D"}.mi-PlayBadge12:before{content:"\ED6E"}.mi-PlayOn:before,.mi-PlayOnLegacy:before{content:"\ED70"}.mi-PlaySolid:before{content:"\ED71"}.mi-PlaybackRate1x:before{content:"\ED72"}.mi-PlaybackRateOther:before{content:"\ED73"}.mi-PlayerSettings:before{content:"\ED74"}.mi-PointErase:before{content:"\ED75"}.mi-PointEraseMirrored:before{content:"\ED76"}.mi-PointerHand:before{content:"\ED77"}.mi-PoliceCar:before{content:"\ED78"}.mi-PostUpdate:before,.mi-PostUpdateLegacy:before{content:"\ED79"}.mi-PowerButton:before{content:"\ED7A"}.mi-CheckboxFill:before,.mi-CheckboxFillLegacy:before,.mi-CheckboxFillZeroWidthLegacy:before,.mi-PresenceChicklet:before,.mi-PresenceChickletLegacy:before,.mi-ResizeMouseLarge:before{content:"\ED7B"}.mi-PresenceChickletVideo:before,.mi-PresenceChickletVideoLegacy:before{content:"\ED7C"}.mi-Preview:before,.mi-PreviewLegacy:before{content:"\ED7D"}.mi-PreviewLink:before,.mi-PreviewLinkLegacy:before{content:"\ED7E"}.mi-Previous:before,.mi-PreviousLegacy:before{content:"\ED7F"}.mi-Print:before,.mi-PrintLegacy:before{content:"\ED80"}.mi-PrintAllPages:before{content:"\ED81"}.mi-PrintCustomRange:before{content:"\ED82"}.mi-PrintDefault:before{content:"\ED83"}.mi-Printer3D:before{content:"\ED84"}.mi-Printer3DLegacy:before{content:"\ED85"}.mi-PrintfaxPrinterFile:before{content:"\ED86"}.mi-Priority:before,.mi-PriorityLegacy:before{content:"\ED87"}.mi-Process:before{content:"\ED88"}.mi-Processing:before{content:"\ED89"}.mi-ProgressRingDots:before{content:"\ED8A"}.mi-Project:before{content:"\ED8B"}.mi-Projector:before{content:"\ED8C"}.mi-ProtectedDocument:before,.mi-ProtectedDocumentLegacy:before{content:"\ED8D"}.mi-Protractor:before{content:"\ED8E"}.mi-ProvisioningPackage:before{content:"\ED8F"}.mi-PuncKey:before{content:"\ED90"}.mi-PuncKey0:before{content:"\ED91"}.mi-PuncKey1:before{content:"\ED92"}.mi-PuncKey2:before{content:"\ED93"}.mi-PuncKey3:before{content:"\ED94"}.mi-PuncKey4:before{content:"\ED95"}.mi-PuncKey5:before{content:"\ED96"}.mi-PuncKey6:before{content:"\ED97"}.mi-PuncKey7:before{content:"\ED98"}.mi-PuncKey8:before{content:"\ED99"}.mi-PuncKey9:before{content:"\ED9A"}.mi-PuncKeyLeftBottom:before{content:"\ED9B"}.mi-PuncKeyRightBottom:before{content:"\ED9C"}.mi-Puzzle:before{content:"\ED9D"}.mi-QWERTYOff:before{content:"\ED9E"}.mi-QWERTYOn:before{content:"\ED9F"}.mi-QuarentinedItems:before{content:"\EDA0"}.mi-QuarentinedItemsMirrored:before{content:"\EDA1"}.mi-QuarterStarLeft:before{content:"\EDA2"}.mi-QuarterStarRight:before{content:"\EDA3"}.mi-QuickNote:before{content:"\EDA4"}.mi-QuietHours:before{content:"\EDA5"}.mi-QuietHoursBadge12:before{content:"\EDA6"}.mi-Radar:before{content:"\EDA7"}.mi-RadioBtnOff:before{content:"\EDA8"}.mi-RadioBtnOn:before{content:"\EDA9"}.mi-RadioBullet:before{content:"\EDAA"}.mi-RadioBullet2:before{content:"\EDAB"}.mi-Read:before,.mi-ReadLegacy:before{content:"\EDAC"}.mi-ReadingList:before{content:"\EDAD"}.mi-ReceiptPrinter:before{content:"\EDAE"}.mi-LengthLegacy:before,.mi-Recent:before{content:"\EDAF"}.mi-Record:before,.mi-RecordLegacy:before{content:"\EDB0"}.mi-RectangularClipping:before{content:"\EDB1"}.mi-RedEye:before{content:"\EDB2"}.mi-Redo:before,.mi-RedoLegacy:before{content:"\EDB3"}.mi-ReduceTile:before,.mi-ReduceTileLegacy:before{content:"\EDB5"}.mi-ReduceTileLegacyMirrored:before,.mi-ReduceTileMirrored:before{content:"\EDB7"}.mi-Refresh:before,.mi-RefreshLegacy:before,.mi-RepeatAll:before,.mi-RepeatAllLegacy:before{content:"\EDB8"}.mi-Relationship:before{content:"\EDB9"}.mi-RememberedDevice:before{content:"\EDBA"}.mi-Reminder:before{content:"\EDBB"}.mi-ReminderFill:before{content:"\EDBC"}.mi-Remote:before,.mi-RemoteLegacy:before{content:"\EDBD"}.mi-Remove:before,.mi-RemoveLegacy:before{content:"\EDBE"}.mi-RemoveFrom:before{content:"\EDBF"}.mi-Rename:before,.mi-RenameLegacy:before{content:"\EDC0"}.mi-Repair:before,.mi-RepairLegacy:before{content:"\EDC1"}.mi-RepeatOne:before,.mi-RepeatOneLegacy:before{content:"\EDC2"}.mi-Replay:before{content:"\EDC3"}.mi-Reply:before,.mi-ReplyLegacy:before{content:"\EDC4"}.mi-ReplyMirrored:before{content:"\EDC5"}.mi-ReportDocument:before{content:"\EDC6"}.mi-ReportHacked:before,.mi-ReportHackedLegacy:before{content:"\EDC7"}.mi-ResetDevice:before{content:"\EDC8"}.mi-ResetDrive:before{content:"\EDC9"}.mi-Reshare:before,.mi-ReshareLegacy:before{content:"\EDCA"}.mi-ResizeMouseMedium:before{content:"\EDCB"}.mi-ResizeMouseMediumMirrored:before{content:"\EDCC"}.mi-ResizeMouseSmall:before{content:"\EDCD"}.mi-ResizeMouseSmallMirrored:before{content:"\EDCE"}.mi-ResizeMouseTall:before{content:"\EDCF"}.mi-ResizeMouseTallMirrored:before{content:"\EDD0"}.mi-ResizeMouseWide:before{content:"\EDD1"}.mi-ResizeTouchLarger:before{content:"\EDD2"}.mi-ResizeTouchNarrower:before{content:"\EDD3"}.mi-ResizeTouchNarrowerMirrored:before{content:"\EDD4"}.mi-ResizeTouchShorter:before{content:"\EDD5"}.mi-ResizeTouchSmaller:before{content:"\EDD6"}.mi-Resolution:before,.mi-ResolutionLegacy:before{content:"\EDD8"}.mi-ReturnKey:before{content:"\EDD9"}.mi-ReturnKeyLg:before{content:"\EDDA"}.mi-ReturnKeySm:before{content:"\EDDB"}.mi-ReturnToWindow:before,.mi-ReturnToWindowLegacy:before{content:"\EDDC"}.mi-RevToggleKey:before{content:"\EDDD"}.mi-Rewind:before{content:"\EDDE"}.mi-RightArrowKeyTime0:before{content:"\EDDF"}.mi-RightArrowKeyTime1:before{content:"\EDE0"}.mi-RightArrowKeyTime2:before{content:"\EDE1"}.mi-RightArrowKeyTime3:before{content:"\EDE2"}.mi-RightArrowKeyTime4:before{content:"\EDE3"}.mi-RightDoubleQuote:before{content:"\EDE4"}.mi-RightQuote:before{content:"\EDE5"}.mi-RightStick:before{content:"\EDE6"}.mi-Ringer:before{content:"\EDE7"}.mi-RingerBadge12:before{content:"\EDE8"}.mi-RingerSilent:before{content:"\EDE9"}.mi-RoamingDomestic:before{content:"\EDEA"}.mi-RoamingInternational:before{content:"\EDEB"}.mi-Robot:before{content:"\EDEC"}.mi-Rotate:before{content:"\EDED"}.mi-RotateCamera:before,.mi-RotateCameraLegacy:before{content:"\EDEE"}.mi-RotateLegacy:before{content:"\EDEF"}.mi-RotateMapLeft:before{content:"\EDF0"}.mi-RotateMapRight:before{content:"\EDF1"}.mi-RotationLock:before{content:"\EDF2"}.mi-Ruler:before{content:"\EDF3"}.mi-SDCard:before{content:"\EDF4"}.mi-SIMError:before{content:"\EDF5"}.mi-SIMLock:before{content:"\EDF6"}.mi-SIMMissing:before{content:"\EDF7"}.mi-SIPMove:before{content:"\EDF8"}.mi-SIPRedock:before{content:"\EDF9"}.mi-SIPUndock:before{content:"\EDFA"}.mi-Safe:before{content:"\EDFB"}.mi-Save:before,.mi-SaveLegacy:before{content:"\EDFC"}.mi-SaveAs:before,.mi-SaveAsLegacy:before{content:"\EDFD"}.mi-SaveCopy:before{content:"\EDFE"}.mi-SaveLocal:before,.mi-SaveLocalLegacy:before{content:"\EDFF"}.mi-Scan:before,.mi-ScanLegacy:before{content:"\EE00"}.mi-ScreenTime:before{content:"\EE01"}.mi-ScrollMode:before{content:"\EE02"}.mi-ScrollUpDown:before{content:"\EE03"}.mi-FindLegacy:before,.mi-Search:before,.mi-SearchboxLegacy:before{content:"\EE04"}.mi-SearchAndApps:before{content:"\EE05"}.mi-SelectAll:before,.mi-SelectAllLegacy:before{content:"\EE06"}.mi-SemanticZoom:before,.mi-SemanticZoomLegacy:before{content:"\EE08"}.mi-Send:before,.mi-SendLegacy:before{content:"\EE09"}.mi-SendFill:before{content:"\EE0A"}.mi-SendFillMirrored:before{content:"\EE0B"}.mi-SendMirrored:before{content:"\EE0C"}.mi-Sensor:before{content:"\EE0D"}.mi-Set:before{content:"\EE0E"}.mi-SetSolid:before{content:"\EE0F"}.mi-SetTile:before,.mi-SetTileLegacy:before{content:"\EE10"}.mi-SetlockScreen:before,.mi-SetlockScreenLegacy:before{content:"\EE11"}.mi-Settings:before,.mi-SettingsLegacy:before{content:"\EE12"}.mi-SettingsBattery:before{content:"\EE13"}.mi-SettingsDisplaySound:before{content:"\EE14"}.mi-Share:before{content:"\EE15"}.mi-ShareBroadband:before{content:"\EE16"}.mi-Shield:before{content:"\EE17"}.mi-Shop:before,.mi-ShopLegacy:before{content:"\EE18"}.mi-ShoppingCart:before{content:"\EE19"}.mi-ShowAllFiles1:before,.mi-ShowAllFiles1Legacy:before{content:"\EE1B"}.mi-ShowAllFiles3:before,.mi-ShowAllFiles3Legacy:before{content:"\EE1D"}.mi-ShowBcc:before,.mi-ShowBccLegacy:before{content:"\EE1E"}.mi-ShowResults:before,.mi-ShowResultsLegacy:before{content:"\EE1F"}.mi-ShowResultsLegacyMirrored:before,.mi-ShowResultsMirrored:before{content:"\EE20"}.mi-Shuffle:before,.mi-ShuffleLegacy:before{content:"\EE21"}.mi-SignalBars1:before{content:"\EE22"}.mi-SignalBars2:before{content:"\EE23"}.mi-SignalBars3:before{content:"\EE24"}.mi-SignalBars4:before{content:"\EE25"}.mi-SignalBars5:before{content:"\EE26"}.mi-SignalError:before{content:"\EE27"}.mi-SignalNotConnected:before{content:"\EE28"}.mi-SignalRoaming:before{content:"\EE29"}.mi-SignatureCapture:before{content:"\EE2A"}.mi-Size:before{content:"\EE2B"}.mi-SkipBack10:before{content:"\EE2C"}.mi-SkipForward30:before{content:"\EE2D"}.mi-SliderThumb:before{content:"\EE2E"}.mi-Slideshow:before,.mi-SlideshowLegacy:before{content:"\EE2F"}.mi-SlowMotionOn:before{content:"\EE30"}.mi-SmallErase:before{content:"\EE31"}.mi-Smartcard:before{content:"\EE32"}.mi-SmartcardVirtual:before{content:"\EE33"}.mi-Sort:before,.mi-SortLegacy:before{content:"\EE34"}.mi-SpatialVolume0:before{content:"\EE35"}.mi-SpatialVolume1:before{content:"\EE36"}.mi-SpatialVolume2:before{content:"\EE37"}.mi-SpatialVolume3:before{content:"\EE38"}.mi-Speakers:before{content:"\EE39"}.mi-Speech:before{content:"\EE3A"}.mi-SpeedHigh:before{content:"\EE3B"}.mi-SpeedMedium:before{content:"\EE3C"}.mi-SpeedOff:before{content:"\EE3D"}.mi-StaplingLandscapeBookBinding:before{content:"\EE3E"}.mi-StaplingLandscapeBottomLeft:before{content:"\EE3F"}.mi-StaplingLandscapeBottomRight:before{content:"\EE40"}.mi-StaplingLandscapeTopLeft:before{content:"\EE41"}.mi-StaplingLandscapeTopRight:before{content:"\EE42"}.mi-StaplingLandscapeTwoBottom:before{content:"\EE43"}.mi-StaplingLandscapeTwoLeft:before{content:"\EE44"}.mi-StaplingLandscapeTwoRight:before{content:"\EE45"}.mi-StaplingLandscapeTwoTop:before{content:"\EE46"}.mi-StaplingOff:before{content:"\EE47"}.mi-StaplingPortraitBookBinding:before{content:"\EE48"}.mi-StaplingPortraitBottomLeft:before{content:"\EE49"}.mi-StaplingPortraitBottomRight:before{content:"\EE4A"}.mi-StaplingPortraitTopLeft:before{content:"\EE4B"}.mi-StaplingPortraitTopRight:before{content:"\EE4C"}.mi-StaplingPortraitTwoBottom:before{content:"\EE4D"}.mi-StaplingPortraitTwoLeft:before{content:"\EE4E"}.mi-StaplingPortraitTwoRight:before{content:"\EE4F"}.mi-StaplingPortraitTwoTop:before{content:"\EE50"}.mi-StartPoint:before{content:"\EE51"}.mi-StartPointSolid:before{content:"\EE52"}.mi-StatusCheckmark:before{content:"\EE53"}.mi-StatusCheckmark7:before{content:"\EE54"}.mi-StatusCheckmarkLeft:before{content:"\EE55"}.mi-StatusCircle:before{content:"\EE56"}.mi-StatusCircle7:before{content:"\EE57"}.mi-StatusCircleBlock:before{content:"\EE58"}.mi-StatusCircleBlock2:before{content:"\EE59"}.mi-StatusCircleCheckmark:before{content:"\EE5A"}.mi-StatusCircleErrorX:before{content:"\EE5B"}.mi-StatusCircleExclamation:before{content:"\EE5C"}.mi-StatusCircleInfo:before{content:"\EE5D"}.mi-StatusCircleInner:before{content:"\EE5E"}.mi-StatusCircleLeft:before{content:"\EE5F"}.mi-StatusCircleOuter:before{content:"\EE60"}.mi-StatusCircleQuestionMark:before{content:"\EE61"}.mi-StatusCircleRing:before{content:"\EE62"}.mi-StatusCircleSync:before{content:"\EE63"}.mi-StatusConnecting1:before{content:"\EE64"}.mi-StatusConnecting2:before{content:"\EE65"}.mi-StatusDataTransfer:before{content:"\EE66"}.mi-StatusDataTransferVPN:before{content:"\EE67"}.mi-StatusDualSIM1:before{content:"\EE68"}.mi-StatusDualSIM1VPN:before{content:"\EE69"}.mi-StatusDualSIM2:before{content:"\EE6A"}.mi-StatusDualSIM2VPN:before{content:"\EE6B"}.mi-StatusError:before{content:"\EE6C"}.mi-StatusErrorCircle7:before{content:"\EE6D"}.mi-StatusErrorFull:before{content:"\EE6E"}.mi-StatusErrorLeft:before{content:"\EE6F"}.mi-StatusExclamationCircle7:before{content:"\EE70"}.mi-StatusInfo:before{content:"\EE71"}.mi-StatusInfoLeft:before{content:"\EE72"}.mi-StatusPause7:before{content:"\EE73"}.mi-StatusSGLTE:before{content:"\EE74"}.mi-StatusSGLTECell:before{content:"\EE75"}.mi-StatusSGLTEDataVPN:before{content:"\EE76"}.mi-StatusTriangle:before{content:"\EE77"}.mi-StatusTriangleExclamation:before{content:"\EE78"}.mi-StatusTriangleInner:before{content:"\EE79"}.mi-StatusTriangleLeft:before{content:"\EE7A"}.mi-StatusTriangleOuter:before{content:"\EE7B"}.mi-StatusUnsecure:before{content:"\EE7C"}.mi-StatusVPN:before{content:"\EE7D"}.mi-StatusWarning:before{content:"\EE7E"}.mi-StatusWarningLeft:before{content:"\EE7F"}.mi-Sticker2:before{content:"\EE80"}.mi-StockDown:before{content:"\EE81"}.mi-StockUp:before{content:"\EE82"}.mi-Stop:before,.mi-StopLegacy:before{content:"\EE83"}.mi-StopPoint:before{content:"\EE84"}.mi-StopPointSolid:before{content:"\EE85"}.mi-StopSlideshow:before,.mi-StopSlideshowLegacy:before{content:"\EE87"}.mi-Stopwatch:before{content:"\EE88"}.mi-StorageNetworkWireless:before{content:"\EE89"}.mi-StorageOptical:before{content:"\EE8A"}.mi-StorageTape:before{content:"\EE8B"}.mi-Streaming:before{content:"\EE8C"}.mi-StreamingEnterprise:before{content:"\EE8D"}.mi-Street:before,.mi-StreetLegacy:before{content:"\EE8E"}.mi-StreetsideSplitExpand:before{content:"\EE8F"}.mi-StreetsideSplitMinimize:before{content:"\EE90"}.mi-StrokeErase:before{content:"\EE91"}.mi-StrokeErase2:before{content:"\EE92"}.mi-StrokeEraseMirrored:before{content:"\EE93"}.mi-Subtitles:before{content:"\EE94"}.mi-SubtitlesAudio:before{content:"\EE95"}.mi-SurfaceHub:before{content:"\EE96"}.mi-SurfaceHubSelected:before{content:"\EE97"}.mi-Sustainable:before{content:"\EE98"}.mi-Swipe:before{content:"\EE99"}.mi-SwipeRevealArt:before{content:"\EE9A"}.mi-Switch:before,.mi-SwitchLegacy:before{content:"\EE9B"}.mi-SwitchApps:before,.mi-SwitchAppsLegacy:before{content:"\EE9C"}.mi-SwitchUser:before{content:"\EE9D"}.mi-Sync:before,.mi-SyncLegacy:before{content:"\EE9E"}.mi-SyncBadge12:before{content:"\EE9F"}.mi-SyncError:before{content:"\EEA0"}.mi-SyncFolder:before,.mi-SyncFolderLegacy:before{content:"\EEA1"}.mi-System:before{content:"\EEA2"}.mi-TVMonitor:before{content:"\EEA3"}.mi-TVMonitorSelected:before{content:"\EEA4"}.mi-Tablet:before{content:"\EEA5"}.mi-TabletMode:before{content:"\EEA6"}.mi-TabletSelected:before{content:"\EEA7"}.mi-Tag:before,.mi-TagLegacy:before{content:"\EEA8"}.mi-TapAndSend:before{content:"\EEA9"}.mi-TaskView:before{content:"\EEAA"}.mi-TaskViewExpanded:before{content:"\EEAB"}.mi-TaskViewSettings:before{content:"\EEAC"}.mi-TaskbarPhone:before{content:"\EEAD"}.mi-ThisPC:before{content:"\EEAE"}.mi-ThoughtBubble:before{content:"\EEAF"}.mi-ThreeBars:before,.mi-ThreeBarsLegacy:before{content:"\EEB0"}.mi-ThreeQuarterStarLeft:before{content:"\EEB1"}.mi-ThreeQuarterStarRight:before{content:"\EEB2"}.mi-Tiles:before{content:"\EEB3"}.mi-TiltDown:before{content:"\EEB4"}.mi-TiltUp:before{content:"\EEB5"}.mi-TimeLanguage:before{content:"\EEB6"}.mi-ToggleBorder:before{content:"\EEB7"}.mi-ToggleFilled:before{content:"\EEB8"}.mi-ToggleThumb:before{content:"\EEB9"}.mi-TollSolid:before{content:"\EEBA"}.mi-Lightbulb:before,.mi-ToolTip:before{content:"\EEBB"}.mi-Touch:before{content:"\EEBC"}.mi-TouchPointer:before,.mi-TouchPointerLegacy:before{content:"\EEBD"}.mi-Touchpad:before{content:"\EEBE"}.mi-Touchscreen:before{content:"\EEBF"}.mi-Trackers:before{content:"\EEC0"}.mi-TrackersMirrored:before{content:"\EEC1"}.mi-TrafficCongestionSolid:before{content:"\EEC2"}.mi-TrafficLight:before{content:"\EEC3"}.mi-Train:before{content:"\EEC4"}.mi-TrainSolid:before{content:"\EEC5"}.mi-TreeFolderFolder:before{content:"\EEC6"}.mi-TreeFolderFolderFill:before{content:"\EEC7"}.mi-TreeFolderFolderOpen:before{content:"\EEC8"}.mi-TreeFolderFolderOpenFill:before{content:"\EEC9"}.mi-TriggerLeft:before{content:"\EECA"}.mi-TriggerRight:before{content:"\EECB"}.mi-Trim:before,.mi-TrimLegacy:before{content:"\EECC"}.mi-TwoBars:before,.mi-TwoBarsLegacy:before{content:"\EECD"}.mi-TwoPage:before,.mi-TwoPageLegacy:before{content:"\EECE"}.mi-Type:before,.mi-TypeLegacy:before{content:"\EECF"}.mi-TypingIndicatorLegacy:before{content:"\EED0"}.mi-USB:before{content:"\EED1"}.mi-USBSafeConnect:before{content:"\EED2"}.mi-Underline:before,.mi-UnderlineLegacy:before{content:"\EED3"}.mi-UnderlineLKorean:before,.mi-UnderlineLKoreanLegacy:before{content:"\EED5"}.mi-UnderlineRussian:before,.mi-UnderlineRussianLegacy:before{content:"\EED7"}.mi-UnderlineS:before,.mi-UnderlineSLegacy:before{content:"\EED9"}.mi-UnderlineU:before,.mi-UnderlineULegacy:before{content:"\EEDB"}.mi-UnderscoreSpace:before{content:"\EEDC"}.mi-Undo:before,.mi-UndoLegacy:before{content:"\EEDD"}.mi-Unfavorite:before,.mi-UnfavoriteLegacy:before{content:"\EEDE"}.mi-Unit:before{content:"\EEDF"}.mi-Unknown:before{content:"\EEE0"}.mi-UnknownMirrored:before{content:"\EEE1"}.mi-Unlock:before,.mi-UnlockLegacy:before{content:"\EEE2"}.mi-Unpin:before,.mi-UnpinLegacy:before{content:"\EEE3"}.mi-UnsyncFolder:before,.mi-UnsyncFolderLegacy:before{content:"\EEE4"}.mi-Up:before,.mi-UpLegacy:before{content:"\EEE5"}.mi-UpArrowShiftKey:before{content:"\EEE6"}.mi-UpShiftKey:before{content:"\EEE7"}.mi-UpdateRestore:before{content:"\EEE8"}.mi-Upload:before,.mi-UploadLegacy:before,.mi-UploadSkyDriveLegacy:before{content:"\EEE9"}.mi-UserAPN:before{content:"\EEEA"}.mi-VPN:before{content:"\EEEB"}.mi-VerticalBattery0:before{content:"\EEEC"}.mi-VerticalBattery1:before{content:"\EEED"}.mi-VerticalBattery10:before{content:"\EEEE"}.mi-VerticalBattery2:before{content:"\EEEF"}.mi-VerticalBattery3:before{content:"\EEF0"}.mi-VerticalBattery4:before{content:"\EEF1"}.mi-VerticalBattery5:before{content:"\EEF2"}.mi-VerticalBattery6:before{content:"\EEF3"}.mi-VerticalBattery7:before{content:"\EEF4"}.mi-VerticalBattery8:before{content:"\EEF5"}.mi-VerticalBattery9:before{content:"\EEF6"}.mi-VerticalBatteryCharging0:before{content:"\EEF7"}.mi-VerticalBatteryCharging1:before{content:"\EEF8"}.mi-VerticalBatteryCharging10:before{content:"\EEF9"}.mi-VerticalBatteryCharging2:before{content:"\EEFA"}.mi-VerticalBatteryCharging3:before{content:"\EEFB"}.mi-VerticalBatteryCharging4:before{content:"\EEFC"}.mi-VerticalBatteryCharging5:before{content:"\EEFD"}.mi-VerticalBatteryCharging6:before{content:"\EEFE"}.mi-VerticalBatteryCharging7:before{content:"\EEFF"}.mi-VerticalBatteryCharging8:before{content:"\EF00"}.mi-VerticalBatteryCharging9:before{content:"\EF01"}.mi-VerticalBatteryUnknown:before{content:"\EF02"}.mi-Vibrate:before{content:"\EF03"}.mi-Video:before,.mi-VideoInlineLegacy:before,.mi-VideoLegacy:before{content:"\EF04"}.mi-Video360:before{content:"\EF05"}.mi-VideoChat:before,.mi-VideoChatLegacy:before{content:"\EF06"}.mi-VideoSolid:before{content:"\EF07"}.mi-RevealPasswordLegacy:before,.mi-View:before,.mi-ViewLegacy:before{content:"\EF08"}.mi-ShowAllFilesLegacy:before,.mi-ViewAll:before,.mi-ViewAllLegacy:before{content:"\EF09"}.mi-ViewDashboard:before{content:"\EF0A"}.mi-Volume:before,.mi-VolumeLegacy:before{content:"\EF0B"}.mi-Volume0:before{content:"\EF0C"}.mi-Volume1:before{content:"\EF0D"}.mi-Volume2:before{content:"\EF0E"}.mi-Volume3:before{content:"\EF0F"}.mi-VolumeBars:before{content:"\EF10"}.mi-Walk:before{content:"\EF11"}.mi-WalkSolid:before{content:"\EF12"}.mi-Warning:before{content:"\EF13"}.mi-Webcam:before,.mi-WebcamLegacy:before{content:"\EF14"}.mi-Webcam2:before{content:"\EF15"}.mi-Website:before{content:"\EF16"}.mi-Wheel:before{content:"\EF17"}.mi-Wifi:before{content:"\EF18"}.mi-Wifi1:before{content:"\EF19"}.mi-Wifi2:before{content:"\EF1A"}.mi-Wifi3:before{content:"\EF1B"}.mi-WifiAttentionOverlay:before{content:"\EF1C"}.mi-WifiCall0:before{content:"\EF1D"}.mi-WifiCall1:before{content:"\EF1E"}.mi-WifiCall2:before{content:"\EF1F"}.mi-WifiCall3:before{content:"\EF20"}.mi-WifiCall4:before{content:"\EF21"}.mi-WifiCallBars:before{content:"\EF22"}.mi-WifiError0:before{content:"\EF23"}.mi-WifiError1:before{content:"\EF24"}.mi-WifiError2:before{content:"\EF25"}.mi-WifiError3:before{content:"\EF26"}.mi-WifiError4:before{content:"\EF27"}.mi-WifiEthernet:before{content:"\EF28"}.mi-InternetSharing:before,.mi-WifiHotspot:before{content:"\EF29"}.mi-WifiWarning0:before{content:"\EF2A"}.mi-WifiWarning1:before{content:"\EF2B"}.mi-WifiWarning2:before{content:"\EF2C"}.mi-WifiWarning3:before{content:"\EF2D"}.mi-WifiWarning4:before{content:"\EF2E"}.mi-WindDirection:before{content:"\EF2F"}.mi-WindowsInsider:before{content:"\EF30"}.mi-WiredUSB:before{content:"\EF31"}.mi-WirelessUSB:before{content:"\EF32"}.mi-Work:before{content:"\EF33"}.mi-WorkSolid:before{content:"\EF34"}.mi-World:before,.mi-WorldLegacy:before{content:"\EF35"}.mi-XboxOneConsole:before{content:"\EF36"}.mi-ZeroBars:before,.mi-ZeroBarsLegacy:before{content:"\EF37"}.mi-Zoom:before,.mi-ZoomLegacy:before{content:"\EF38"}.mi-ZoomIn:before,.mi-ZoomInLegacy:before{content:"\EF39"}.mi-ZoomMode:before{content:"\EF3A"}.mi-ZoomOut:before,.mi-ZoomOutLegacy:before{content:"\EF3B"}.mi-eSIM:before{content:"\EF3C"}.mi-eSIMBusy:before{content:"\EF3D"}.mi-eSIMLocked:before{content:"\EF3E"}.mi-eSIMNoProfile:before{content:"\EF3F"}.mi-E80B:before,.mi-uniE80B:before{content:"\EF40"}.mi-EA0D:before,.mi-uniEA0D:before{content:"\EF41"}.mi-EA3F:before,.mi-uniEA3F:before{content:"\EF42"}.mi-EA90:before,.mi-uniEA90:before{content:"\EF43"}.mi-EAC2:before,.mi-uniEAC2:before{content:"\EF44"}.mi-EC6C:before,.mi-uniEC6C:before{content:"\EF45"}.mi-EEA3:before,.mi-uniEEA3:before{content:"\EF46"}.mi-F2B7:before,.mi-uniF2B7:before{content:"\EF47"}.mi-F5AA:before,.mi-uniF5AA:before{content:"\EF48"}.mi-F614:before,.mi-uniF614:before{content:"\EF49"}.mi-F615:before,.mi-uniF615:before{content:"\EF4A"}.mi-F616:before,.mi-uniF616:before{content:"\EF4B"}.mi-F617:before,.mi-uniF617:before{content:"\EF4C"}.mi-F657:before,.mi-uniF657:before{content:"\EF4D"}.mi-F658:before,.mi-uniF658:before{content:"\EF4E"}.mi-F659:before,.mi-uniF659:before{content:"\EF4F"}.mi-F65A:before,.mi-uniF65A:before{content:"\EF50"}.mi-F65B:before,.mi-uniF65B:before{content:"\EF51"}.mi-F65C:before,.mi-uniF65C:before{content:"\EF52"}.mi-F69E:before,.mi-uniF69E:before{content:"\EF53"}.mi-F6FA:before,.mi-uniF6FA:before{content:"\EF54"}.mi-F712:before,.mi-uniF712:before{content:"\EF55"}.mi-F71C:before,.mi-uniF71C:before{content:"\EF56"}.mi-F71D:before,.mi-uniF71D:before{content:"\EF57"}.mi-F71E:before,.mi-uniF71E:before{content:"\EF58"}.mi-F738:before,.mi-uniF738:before{content:"\EF59"}.mi-F739:before,.mi-uniF739:before{content:"\EF5A"}.mi-F73D:before,.mi-uniF73D:before{content:"\EF5B"}.mi-F73E:before,.mi-uniF73E:before{content:"\EF5C"}.mi-F73F:before,.mi-uniF73F:before{content:"\EF5D"}.mi-F740:before,.mi-uniF740:before{content:"\EF5E"}.mi-F741:before,.mi-uniF741:before{content:"\EF5F"}.mi-F742:before,.mi-uniF742:before{content:"\EF60"}.mi-F743:before,.mi-uniF743:before{content:"\EF61"}.mi-F744:before,.mi-uniF744:before{content:"\EF62"}.mi-F745:before,.mi-uniF745:before{content:"\EF63"}.mi-F746:before,.mi-uniF746:before{content:"\EF64"}.mi-F785:before,.mi-uniF785:before{content:"\EF65"}.mi-500px:before{content:"\EF66"}.mi-accessible-icon:before{content:"\EF67"}.mi-accusoft:before{content:"\EF68"}.mi-acquisitions-incorporated:before{content:"\EF69"}.mi-adn:before{content:"\EF6A"}.mi-adobe:before{content:"\EF6B"}.mi-adversal:before{content:"\EF6C"}.mi-affiliatetheme:before{content:"\EF6D"}.mi-algolia:before{content:"\EF6E"}.mi-alipay:before{content:"\EF6F"}.mi-amazon-pay:before{content:"\EF70"}.mi-amazon:before{content:"\EF71"}.mi-amilia:before{content:"\EF72"}.mi-android:before{content:"\EF73"}.mi-angellist:before{content:"\EF74"}.mi-angrycreative:before{content:"\EF75"}.mi-angular:before{content:"\EF76"}.mi-app-store-ios:before{content:"\EF77"}.mi-app-store:before{content:"\EF78"}.mi-apper:before{content:"\EF79"}.mi-apple-pay:before{content:"\EF7A"}.mi-apple:before{content:"\EF7B"}.mi-artstation:before{content:"\EF7C"}.mi-asymmetrik:before{content:"\EF7D"}.mi-atlassian:before{content:"\EF7E"}.mi-audible:before{content:"\EF7F"}.mi-autoprefixer:before{content:"\EF80"}.mi-avianex:before{content:"\EF81"}.mi-aviato:before{content:"\EF82"}.mi-aws:before{content:"\EF83"}.mi-bandcamp:before{content:"\EF84"}.mi-behance-square:before{content:"\EF85"}.mi-behance:before{content:"\EF86"}.mi-bimobject:before{content:"\EF87"}.mi-bitbucket:before{content:"\EF88"}.mi-bitcoin:before{content:"\EF89"}.mi-bity:before{content:"\EF8A"}.mi-black-tie:before{content:"\EF8B"}.mi-blackberry:before{content:"\EF8C"}.mi-blogger-b:before{content:"\EF8D"}.mi-blogger:before{content:"\EF8E"}.mi-bluetooth-b:before{content:"\EF8F"}.mi-bluetooth:before{content:"\EF90"}.mi-btc:before{content:"\EF91"}.mi-buromobelexperte:before{content:"\EF92"}.mi-buysellads:before{content:"\EF93"}.mi-canadian-maple-leaf:before{content:"\EF94"}.mi-cc-amazon-pay:before{content:"\EF95"}.mi-cc-amex:before{content:"\EF96"}.mi-cc-apple-pay:before{content:"\EF97"}.mi-cc-diners-club:before{content:"\EF98"}.mi-cc-discover:before{content:"\EF99"}.mi-cc-jcb:before{content:"\EF9A"}.mi-cc-mastercard:before{content:"\EF9B"}.mi-cc-paypal:before{content:"\EF9C"}.mi-cc-stripe:before{content:"\EF9D"}.mi-cc-visa:before{content:"\EF9E"}.mi-centercode:before{content:"\EF9F"}.mi-centos:before{content:"\EFA0"}.mi-chrome:before{content:"\EFA1"}.mi-cloudscale:before{content:"\EFA2"}.mi-cloudsmith:before{content:"\EFA3"}.mi-cloudversify:before{content:"\EFA4"}.mi-codepen:before{content:"\EFA5"}.mi-codiepie:before{content:"\EFA6"}.mi-confluence:before{content:"\EFA7"}.mi-connectdevelop:before{content:"\EFA8"}.mi-contao:before{content:"\EFA9"}.mi-cpanel:before{content:"\EFAA"}.mi-creative-commons-by:before{content:"\EFAB"}.mi-creative-commons-nc-eu:before{content:"\EFAC"}.mi-creative-commons-nc-jp:before{content:"\EFAD"}.mi-creative-commons-nc:before{content:"\EFAE"}.mi-creative-commons-nd:before{content:"\EFAF"}.mi-creative-commons-pd-alt:before{content:"\EFB0"}.mi-creative-commons-pd:before{content:"\EFB1"}.mi-creative-commons-remix:before{content:"\EFB2"}.mi-creative-commons-sa:before{content:"\EFB3"}.mi-creative-commons-sampling-plus:before{content:"\EFB4"}.mi-creative-commons-sampling:before{content:"\EFB5"}.mi-creative-commons-share:before{content:"\EFB6"}.mi-creative-commons-zero:before{content:"\EFB7"}.mi-creative-commons:before{content:"\EFB8"}.mi-critical-role:before{content:"\EFB9"}.mi-css3-alt:before{content:"\EFBA"}.mi-css3:before{content:"\EFBB"}.mi-cuttlefish:before{content:"\EFBC"}.mi-d-and-d-beyond:before{content:"\EFBD"}.mi-d-and-d:before{content:"\EFBE"}.mi-dashcube:before{content:"\EFBF"}.mi-delicious:before{content:"\EFC0"}.mi-deploydog:before{content:"\EFC1"}.mi-deskpro:before{content:"\EFC2"}.mi-dev:before{content:"\EFC3"}.mi-deviantart:before{content:"\EFC4"}.mi-dhl:before{content:"\EFC5"}.mi-diaspora:before{content:"\EFC6"}.mi-digg:before{content:"\EFC7"}.mi-digital-ocean:before{content:"\EFC8"}.mi-discord:before{content:"\EFC9"}.mi-discourse:before{content:"\EFCA"}.mi-dochub:before{content:"\EFCB"}.mi-docker:before{content:"\EFCC"}.mi-draft2digital:before{content:"\EFCD"}.mi-dribbble-square:before{content:"\EFCE"}.mi-dribbble:before{content:"\EFCF"}.mi-dropbox:before{content:"\EFD0"}.mi-drupal:before{content:"\EFD1"}.mi-dyalog:before{content:"\EFD2"}.mi-earlybirds:before{content:"\EFD3"}.mi-ebay:before{content:"\EFD4"}.mi-edge:before{content:"\EFD5"}.mi-elementor:before{content:"\EFD6"}.mi-ello:before{content:"\EFD7"}.mi-ember:before{content:"\EFD8"}.mi-empire:before{content:"\EFD9"}.mi-envira:before{content:"\EFDA"}.mi-erlang:before{content:"\EFDB"}.mi-ethereum:before{content:"\EFDC"}.mi-etsy:before{content:"\EFDD"}.mi-expeditedssl:before{content:"\EFDE"}.mi-facebook-f:before{content:"\EFDF"}.mi-facebook-messenger:before{content:"\EFE0"}.mi-facebook-square:before{content:"\EFE1"}.mi-facebook:before{content:"\EFE2"}.mi-fedex:before{content:"\EFE3"}.mi-fedora:before{content:"\EFE4"}.mi-figma:before{content:"\EFE5"}.mi-firefox:before{content:"\EFE6"}.mi-first-order-alt:before{content:"\EFE7"}.mi-first-order:before{content:"\EFE8"}.mi-firstdraft:before{content:"\EFE9"}.mi-flickr:before{content:"\EFEA"}.mi-flipboard:before{content:"\EFEB"}.mi-fly:before{content:"\EFEC"}.mi-font-awesome-alt:before{content:"\EFED"}.mi-font-awesome-flag:before{content:"\EFEE"}.mi-font-awesome:before{content:"\EFEF"}.mi-fonticons-fi:before{content:"\EFF0"}.mi-fonticons:before{content:"\EFF1"}.mi-fort-awesome-alt:before{content:"\EFF2"}.mi-fort-awesome:before{content:"\EFF3"}.mi-forumbee:before{content:"\EFF4"}.mi-foursquare:before{content:"\EFF5"}.mi-free-code-camp:before{content:"\EFF6"}.mi-freebsd:before{content:"\EFF7"}.mi-fulcrum:before{content:"\EFF8"}.mi-galactic-republic:before{content:"\EFF9"}.mi-galactic-senate:before{content:"\EFFA"}.mi-get-pocket:before{content:"\EFFB"}.mi-gg-circle:before{content:"\EFFC"}.mi-gg:before{content:"\EFFD"}.mi-git-square:before{content:"\EFFE"}.mi-github-alt:before{content:"\EFFF"}.mi-github-square:before{content:"\F000"}.mi-github:before{content:"\F001"}.mi-gitkraken:before{content:"\F002"}.mi-gitlab:before{content:"\F003"}.mi-gitter:before{content:"\F004"}.mi-glide-g:before{content:"\F005"}.mi-glide:before{content:"\F006"}.mi-gofore:before{content:"\F007"}.mi-goodreads-g:before{content:"\F008"}.mi-goodreads:before{content:"\F009"}.mi-google-drive:before{content:"\F00A"}.mi-google-play:before{content:"\F00B"}.mi-google-plus-g:before{content:"\F00C"}.mi-google-plus-square:before{content:"\F00D"}.mi-google-plus:before{content:"\F00E"}.mi-google-wallet:before{content:"\F00F"}.mi-google:before{content:"\F010"}.mi-gratipay:before{content:"\F011"}.mi-grav:before{content:"\F012"}.mi-gripfire:before{content:"\F013"}.mi-grunt:before{content:"\F014"}.mi-gulp:before{content:"\F015"}.mi-hacker-news-square:before{content:"\F016"}.mi-hacker-news:before{content:"\F017"}.mi-hackerrank:before{content:"\F018"}.mi-hire-a-helper:before{content:"\F019"}.mi-hooli:before{content:"\F01A"}.mi-hornbill:before{content:"\F01B"}.mi-hotjar:before{content:"\F01C"}.mi-houzz:before{content:"\F01D"}.mi-html5:before{content:"\F01E"}.mi-hubspot:before{content:"\F01F"}.mi-imdb:before{content:"\F020"}.mi-instagram:before{content:"\F021"}.mi-intercom:before{content:"\F022"}.mi-internet-explorer:before{content:"\F023"}.mi-invision:before{content:"\F024"}.mi-ioxhost:before{content:"\F025"}.mi-itunes-note:before{content:"\F026"}.mi-itunes:before{content:"\F027"}.mi-java:before{content:"\F028"}.mi-jedi-order:before{content:"\F029"}.mi-jenkins:before{content:"\F02A"}.mi-jira:before{content:"\F02B"}.mi-joget:before{content:"\F02C"}.mi-joomla:before{content:"\F02D"}.mi-js-square:before{content:"\F02E"}.mi-js:before{content:"\F02F"}.mi-jsfiddle:before{content:"\F030"}.mi-kaggle:before{content:"\F031"}.mi-keybase:before{content:"\F032"}.mi-keycdn:before{content:"\F033"}.mi-kickstarter-k:before{content:"\F034"}.mi-kickstarter:before{content:"\F035"}.mi-korvue:before{content:"\F036"}.mi-laravel:before{content:"\F037"}.mi-lastfm-square:before{content:"\F038"}.mi-lastfm:before{content:"\F039"}.mi-leanpub:before{content:"\F03A"}.mi-less:before{content:"\F03B"}.mi-line:before{content:"\F03C"}.mi-linkedin-in:before{content:"\F03D"}.mi-linkedin:before{content:"\F03E"}.mi-linode:before{content:"\F03F"}.mi-linux:before{content:"\F040"}.mi-lyft:before{content:"\F041"}.mi-magento:before{content:"\F042"}.mi-mailchimp:before{content:"\F043"}.mi-mandalorian:before{content:"\F044"}.mi-markdown:before{content:"\F045"}.mi-mastodon:before{content:"\F046"}.mi-maxcdn:before{content:"\F047"}.mi-medapps:before{content:"\F048"}.mi-medium-m:before{content:"\F049"}.mi-medium:before{content:"\F04A"}.mi-medrt:before{content:"\F04B"}.mi-meetup:before{content:"\F04C"}.mi-megaport:before{content:"\F04D"}.mi-mendeley:before{content:"\F04E"}.mi-microsoft:before{content:"\F04F"}.mi-mix:before{content:"\F050"}.mi-mixcloud:before{content:"\F051"}.mi-mizuni:before{content:"\F052"}.mi-modx:before{content:"\F053"}.mi-monero:before{content:"\F054"}.mi-napster:before{content:"\F055"}.mi-neos:before{content:"\F056"}.mi-nimblr:before{content:"\F057"}.mi-nintendo-switch:before{content:"\F058"}.mi-node-js:before{content:"\F059"}.mi-node:before{content:"\F05A"}.mi-npm:before{content:"\F05B"}.mi-ns8:before{content:"\F05C"}.mi-nutritionix:before{content:"\F05D"}.mi-odnoklassniki-square:before{content:"\F05E"}.mi-odnoklassniki:before{content:"\F05F"}.mi-old-republic:before{content:"\F060"}.mi-opencart:before{content:"\F061"}.mi-openid:before{content:"\F062"}.mi-opera:before{content:"\F063"}.mi-optin-monster:before{content:"\F064"}.mi-osi:before{content:"\F065"}.mi-page4:before{content:"\F066"}.mi-pagelines:before{content:"\F067"}.mi-palfed:before{content:"\F068"}.mi-patreon:before{content:"\F069"}.mi-paypal:before{content:"\F06A"}.mi-penny-arcade:before{content:"\F06B"}.mi-periscope:before{content:"\F06C"}.mi-phabricator:before{content:"\F06D"}.mi-phoenix-framework:before{content:"\F06E"}.mi-phoenix-squadron:before{content:"\F06F"}.mi-php:before{content:"\F070"}.mi-pied-piper-alt:before{content:"\F071"}.mi-pied-piper-hat:before{content:"\F072"}.mi-pied-piper-pp:before{content:"\F073"}.mi-pied-piper:before{content:"\F074"}.mi-pinterest-p:before{content:"\F075"}.mi-pinterest-square:before{content:"\F076"}.mi-pinterest:before{content:"\F077"}.mi-playstation:before{content:"\F078"}.mi-product-hunt:before{content:"\F079"}.mi-pushed:before{content:"\F07A"}.mi-python:before{content:"\F07B"}.mi-qq:before{content:"\F07C"}.mi-quinscape:before{content:"\F07D"}.mi-quora:before{content:"\F07E"}.mi-r-project:before{content:"\F07F"}.mi-raspberry-pi:before{content:"\F080"}.mi-ravelry:before{content:"\F081"}.mi-react:before{content:"\F082"}.mi-reacteurope:before{content:"\F083"}.mi-readme:before{content:"\F084"}.mi-rebel:before{content:"\F085"}.mi-red-river:before{content:"\F086"}.mi-reddit-alien:before{content:"\F087"}.mi-reddit-square:before{content:"\F088"}.mi-reddit:before{content:"\F089"}.mi-redhat:before{content:"\F08A"}.mi-renren:before{content:"\F08B"}.mi-replyd:before{content:"\F08C"}.mi-researchgate:before{content:"\F08D"}.mi-resolving:before{content:"\F08E"}.mi-rev:before{content:"\F08F"}.mi-rocketchat:before{content:"\F090"}.mi-rockrms:before{content:"\F091"}.mi-safari:before{content:"\F092"}.mi-sass:before{content:"\F093"}.mi-schlix:before{content:"\F094"}.mi-scribd:before{content:"\F095"}.mi-searchengin:before{content:"\F096"}.mi-sellcast:before{content:"\F097"}.mi-sellsy:before{content:"\F098"}.mi-servicestack:before{content:"\F099"}.mi-shirtsinbulk:before{content:"\F09A"}.mi-shopware:before{content:"\F09B"}.mi-simplybuilt:before{content:"\F09C"}.mi-sistrix:before{content:"\F09D"}.mi-sith:before{content:"\F09E"}.mi-sketch:before{content:"\F09F"}.mi-skyatlas:before{content:"\F0A0"}.mi-skype:before{content:"\F0A1"}.mi-slack-hash:before{content:"\F0A2"}.mi-slack:before{content:"\F0A3"}.mi-slideshare:before{content:"\F0A4"}.mi-snapchat-ghost:before{content:"\F0A5"}.mi-snapchat-square:before{content:"\F0A6"}.mi-snapchat:before{content:"\F0A7"}.mi-soundcloud:before{content:"\F0A8"}.mi-sourcetree:before{content:"\F0A9"}.mi-speakap:before{content:"\F0AA"}.mi-spotify:before{content:"\F0AB"}.mi-squarespace:before{content:"\F0AC"}.mi-stack-exchange:before{content:"\F0AD"}.mi-stack-overflow:before{content:"\F0AE"}.mi-staylinked:before{content:"\F0AF"}.mi-steam-square:before{content:"\F0B0"}.mi-steam:before{content:"\F0B1"}.mi-sticker-mule:before{content:"\F0B2"}.mi-strava:before{content:"\F0B3"}.mi-stripe-s:before{content:"\F0B4"}.mi-stripe:before{content:"\F0B5"}.mi-studiovinari:before{content:"\F0B6"}.mi-stumbleupon-circle:before{content:"\F0B7"}.mi-stumbleupon:before{content:"\F0B8"}.mi-superpowers:before{content:"\F0B9"}.mi-supple:before{content:"\F0BA"}.mi-suse:before{content:"\F0BB"}.mi-teamspeak:before{content:"\F0BC"}.mi-telegram-plane:before{content:"\F0BD"}.mi-telegram:before{content:"\F0BE"}.mi-tencent-weibo:before{content:"\F0BF"}.mi-the-red-yeti:before{content:"\F0C0"}.mi-themeco:before{content:"\F0C1"}.mi-themeisle:before{content:"\F0C2"}.mi-think-peaks:before{content:"\F0C3"}.mi-trade-federation:before{content:"\F0C4"}.mi-trello:before{content:"\F0C5"}.mi-tripadvisor:before{content:"\F0C6"}.mi-tumblr-square:before{content:"\F0C7"}.mi-tumblr:before{content:"\F0C8"}.mi-twitch:before{content:"\F0C9"}.mi-twitter-square:before{content:"\F0CA"}.mi-typo3:before{content:"\F0CB"}.mi-ubuntu:before{content:"\F0CC"}.mi-uikit:before{content:"\F0CD"}.mi-uniregistry:before{content:"\F0CE"}.mi-untappd:before{content:"\F0CF"}.mi-ups:before{content:"\F0D0"}.mi-usb:before{content:"\F0D1"}.mi-usps:before{content:"\F0D2"}.mi-ussunnah:before{content:"\F0D3"}.mi-vaadin:before{content:"\F0D4"}.mi-viacoin:before{content:"\F0D5"}.mi-viadeo-square:before{content:"\F0D6"}.mi-viadeo:before{content:"\F0D7"}.mi-viber:before{content:"\F0D8"}.mi-vimeo-square:before{content:"\F0D9"}.mi-vimeo-v:before{content:"\F0DA"}.mi-vimeo:before{content:"\F0DB"}.mi-vine:before{content:"\F0DC"}.mi-vk:before{content:"\F0DD"}.mi-vnv:before{content:"\F0DE"}.mi-vuejs:before{content:"\F0DF"}.mi-weebly:before{content:"\F0E0"}.mi-weibo:before{content:"\F0E1"}.mi-weixin:before{content:"\F0E2"}.mi-whatsapp-square:before{content:"\F0E3"}.mi-whatsapp:before{content:"\F0E4"}.mi-whmcs:before{content:"\F0E5"}.mi-wikipedia-w:before{content:"\F0E6"}.mi-windows:before{content:"\F0E7"}.mi-wix:before{content:"\F0E8"}.mi-wizards-of-the-coast:before{content:"\F0E9"}.mi-wolf-pack-battalion:before{content:"\F0EA"}.mi-wordpress-simple:before{content:"\F0EB"}.mi-wordpress:before{content:"\F0EC"}.mi-wpbeginner:before{content:"\F0ED"}.mi-wpexplorer:before{content:"\F0EE"}.mi-wpforms:before{content:"\F0EF"}.mi-wpressr:before{content:"\F0F0"}.mi-xbox:before{content:"\F0F1"}.mi-xing-square:before{content:"\F0F2"}.mi-xing:before{content:"\F0F3"}.mi-y-combinator:before{content:"\F0F4"}.mi-yahoo:before{content:"\F0F5"}.mi-yandex-international:before{content:"\F0F6"}.mi-yandex:before{content:"\F0F7"}.mi-yarn:before{content:"\F0F8"}.mi-yelp:before{content:"\F0F9"}.mi-yoast:before{content:"\F0FA"}.mi-youtube-square:before{content:"\F0FB"}.mi-youtube:before{content:"\F0FC"}.mi-zhihu:before{content:"\F0FD"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.uib-datepicker .uib-title,.uib-left,.uib-right{width:100%}.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}.uib-day button,.uib-month button,.uib-year button{min-width:100%}.uib-position-measure{display:block!important;visibility:hidden!important;position:absolute!important;top:-9999px!important;left:-9999px!important}.uib-position-scrollbar-measure{position:absolute!important;top:-9999px!important;width:50px!important;height:50px!important;overflow:scroll!important}.uib-position-body-scrollbar-measure{overflow:scroll!important}.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0}.uib-button-bar{padding:10px 9px 2px}[uib-popover-html-popup].popover.bottom-left>.arrow,[uib-popover-html-popup].popover.bottom-right>.arrow,[uib-popover-html-popup].popover.left-bottom>.arrow,[uib-popover-html-popup].popover.left-top>.arrow,[uib-popover-html-popup].popover.right-bottom>.arrow,[uib-popover-html-popup].popover.right-top>.arrow,[uib-popover-html-popup].popover.top-left>.arrow,[uib-popover-html-popup].popover.top-right>.arrow,[uib-popover-popup].popover.bottom-left>.arrow,[uib-popover-popup].popover.bottom-right>.arrow,[uib-popover-popup].popover.left-bottom>.arrow,[uib-popover-popup].popover.left-top>.arrow,[uib-popover-popup].popover.right-bottom>.arrow,[uib-popover-popup].popover.right-top>.arrow,[uib-popover-popup].popover.top-left>.arrow,[uib-popover-popup].popover.top-right>.arrow,[uib-popover-template-popup].popover.bottom-left>.arrow,[uib-popover-template-popup].popover.bottom-right>.arrow,[uib-popover-template-popup].popover.left-bottom>.arrow,[uib-popover-template-popup].popover.left-top>.arrow,[uib-popover-template-popup].popover.right-bottom>.arrow,[uib-popover-template-popup].popover.right-top>.arrow,[uib-popover-template-popup].popover.top-left>.arrow,[uib-popover-template-popup].popover.top-right>.arrow,[uib-tooltip-html-popup].tooltip.bottom-left>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left>.tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right>.tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left>.tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right>.tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom>.tooltip-arrow,[uib-tooltip-popup].tooltip.left-top>.tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom>.tooltip-arrow,[uib-tooltip-popup].tooltip.right-top>.tooltip-arrow,[uib-tooltip-popup].tooltip.top-left>.tooltip-arrow,[uib-tooltip-popup].tooltip.top-right>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left>.tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right>.tooltip-arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0}[uib-popover-html-popup].popover,[uib-popover-popup].popover,[uib-popover-template-popup].popover{display:block!important}.uib-time input{width:50px}[uib-typeahead-popup].dropdown-menu{display:block} \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/portal-extend.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/portal-extend.css deleted file mode 100644 index 909c9fd93..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/portal-extend.css +++ /dev/null @@ -1,2305 +0,0 @@ -a, -.btn-link { - text-decoration: none !important; - color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; -} - -.dropdown-item.active, .dropdown-item:active { - color: #fff !important; - text-decoration: none; - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; -} - -.btn-link, -.text-primary { - color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; -} - -.btn-outline-primary { - color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - border-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; -} - - .btn-outline-primary:hover { - color: #fff !important; - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - border-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - } - -.form-check-input:checked, -.nav-pills .nav-link.active, .nav-pills .show > .nav-link, -.page-item.active .page-link, -.btn-primary { - color: #fff !important; - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - border-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; -} - -.card { - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); -} - - .card .card-header { - border-top: 3px solid hsla(var(--primary-color-hue, 211), 100%, 90%, 1); - background-color: hsla(var(--primary-color-hue, 211), 100%, 98%, 1); - } - -.nav-tabs { - border-color: hsla(var(--primary-color-hue, 211), 100%, 90%, 1); -} - - .nav-tabs .nav-link { - padding: .5rem 2.5rem; - border-top: 3px solid; - border-color: transparent; - } - - .nav-tabs .nav-link.active { - border-top: 3px solid hsla(var(--primary-color-hue, 211), 100%, 90%, 1); - background-color: hsla(var(--primary-color-hue, 211), 100%, 98%, 1); - } - -.main-sidebar { - width: 15%; - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), 100%, 1); - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - border-right: 1px solid rgba(0, 0, 0, 0.125); -} - - .main-sidebar .btn { - font-weight: 550; - } - - .main-sidebar .sidebar-menu-item-main { - border-radius: 0; - } - - .main-sidebar .sidebar-menu-item-main:hover { - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - } - - .main-sidebar .sidebar-menu-item-main:hover span { - color: #fff !important; - } - - .main-sidebar .sidebar-menu-item-main:hover .btn-group .btn { - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - border-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - color: #fff !important; - } - - .main-sidebar .sidebar-menu-item-main .btn-group .btn:last-child { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - - .main-sidebar .sidebar-menu-item-main .btn-group:hover .btn { - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), 100%, 1); - border-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), var(--primary-color-brightness, 50%), 1) !important; - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - } - - .main-sidebar .sidebar-menu-item-main:hover .btn-group { - display: inherit !important; - } - -.content-body { - width: 100%; -} - -.sub-sidebar { - width: 35%; -} - -.bd-navbar { - padding: .75rem 0; - min-height: 4rem; - max-height: 4rem; - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), 100%, 1); - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - z-index: 1020; - border-bottom: 1px solid rgba(0, 0, 0, 0.125); -} - - .bd-navbar .navbar-toggler { - padding: 0; - border: 0; - } - - .bd-navbar .navbar-toggler .bi { - width: 2rem; - fill: currentColor; - } - - .bd-navbar .navbar-nav .nav-link { - padding-right: .25rem; - padding-left: .25rem; - } - - .bd-navbar .navbar-nav .nav-link.active { - font-weight: 600; - } - - .bd-navbar .navbar-nav-svg { - width: 1rem; - height: 1rem; - } - -.bd-subnavbar { - position: relative; - z-index: 1020; - background-color: rgba(255, 255, 255, 0.95); - -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05), inset 0 -1px 0 rgba(0, 0, 0, 0.15); -} - - .bd-subnavbar .dropdown-menu { - font-size: .875rem; - -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); - } - - .bd-subnavbar .dropdown-item.current { - font-weight: 600; - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23292b2c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); - background-repeat: no-repeat; - background-position: right 1rem top 0.6rem; - background-size: .75rem .75rem; - } - -.table-striped > tbody > tr:nth-of-type(odd) { - --bs-table-accent-bg: hsla(var(--primary-color-hue,211),100%,98%,0.5); -} - -.table .thead-light th { - font-weight: 500; - background-color: hsla(var(--primary-color-hue, 211), 100%, 98%, 1); -} - -.accordion { - background-color: hsla(var(--primary-color-hue, 211), var(--primary-color-saturation, 100%), 100%, 1); - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); -} - - .accordion .accordion-button:not(.collapsed) { - border-top: 3px solid hsla(var(--primary-color-hue, 211), 100%, 90%, 1); - background-color: hsla(var(--primary-color-hue, 211), 100%, 98%, 1); - } - -@media (min-width: 768px) { - .bd-navbar { - position: -webkit-sticky; - position: sticky; - top: 0; - } -} - -.bd-search { - position: relative; -} - - .bd-search::after { - position: absolute; - top: .4rem; - right: .4rem; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - height: 1.5rem; - padding-right: .25rem; - padding-left: .25rem; - font-size: .75rem; - color: #6c757d; - content: "Ctrl + /"; - border: 1px solid #dee2e6; - border-radius: .125rem; - } - -@media (max-width: 767.98px) { - .bd-search { - width: 100%; - } -} - -.bd-search .form-control { - padding-right: 3.75rem; -} - - .bd-search .form-control:focus { - border-color: #7952b3; - -webkit-box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - } - -.bd-sidebar-toggle { - color: #6c757d; -} - - .bd-sidebar-toggle:hover, .bd-sidebar-toggle:focus { - color: #7952b3; - } - - .bd-sidebar-toggle:focus { - -webkit-box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - } - - .bd-sidebar-toggle .bi { - fill: currentColor; - } - - .bd-sidebar-toggle .bi-collapse { - display: none; - } - - .bd-sidebar-toggle:not(.collapsed) .bi-expand { - display: none; - } - - .bd-sidebar-toggle:not(.collapsed) .bi-collapse { - display: inline-block; - } - -.bd-masthead { - padding: 3rem 0; - background: linear-gradient(165deg, #f7f5fb 50%, #fff 50%); -} - - .bd-masthead h1 { - font-size: calc(1.525rem + 3.3vw); - line-height: 1; - } - -@media (min-width: 1200px) { - .bd-masthead h1 { - font-size: 4rem; - } -} - -.bd-masthead p:not(.lead) { - color: #495057; -} - -.bd-masthead .btn { - padding: .8rem 2rem; - font-weight: 600; -} - -.bd-masthead .lead { - font-size: calc(1.275rem + .3vw); - font-weight: 400; - color: #495057; -} - -@media (min-width: 1200px) { - .bd-masthead .lead { - font-size: 1.5rem; - } -} - -@media (min-width: 768px) { - .mw-md-75 { - max-width: 75%; - } -} - -.masthead-followup-icon { - padding: .75rem; - background-image: -webkit-gradient(linear, left top, right bottom, from(rgba(255, 255, 255, 0.2)), to(rgba(255, 255, 255, 0.01))); - background-image: linear-gradient(to bottom right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.01)); - border-radius: .75rem; - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1); - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1); -} - -.masthead-followup-svg { - -webkit-filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.125)); - filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.125)); -} - -#carbonads { - position: static; - display: block; - max-width: 400px; - padding: 15px 15px 15px 160px; - margin: 2rem 0; - overflow: hidden; - font-size: .8125rem; - line-height: 1.4; - text-align: left; - background-color: rgba(0, 0, 0, 0.05); -} - - #carbonads a { - color: #343a40; - text-decoration: none; - } - -@media (min-width: 576px) { - #carbonads { - max-width: 330px; - border-radius: 4px; - } -} - -.carbon-img { - float: left; - margin-left: -145px; -} - -.carbon-poweredby { - display: block; - margin-top: .75rem; - color: #495057 !important; -} - -@media (min-width: 768px) { - .bd-content > [id] { - scroll-margin-top: 4rem; - } -} - -.bd-content > h2:not(:first-child) { - margin-top: 3rem; -} - -.bd-content > h3 { - margin-top: 2rem; -} - -.bd-content > ul li, .bd-content > ol li { - margin-bottom: .25rem; -} - -.bd-content > .table { - max-width: 100%; - margin-bottom: 1.5rem; - font-size: .875rem; -} - -@media (max-width: 991.98px) { - .bd-content > .table { - display: block; - overflow-x: auto; - } - - .bd-content > .table.table-bordered { - border: 0; - } -} - -.bd-content > .table th:first-child, .bd-content > .table td:first-child { - padding-left: 0; -} - -.bd-content > .table th:not(:last-child), .bd-content > .table td:not(:last-child) { - padding-right: 1.5rem; -} - -.bd-content > .table td:first-child > code { - white-space: nowrap; -} - -.bd-title { - font-size: calc(1.425rem + 2.1vw); -} - -@media (min-width: 1200px) { - .bd-title { - font-size: 3rem; - } -} - -.bd-lead { - font-size: calc(1.275rem + .3vw); - font-weight: 300; -} - -@media (min-width: 1200px) { - .bd-lead { - font-size: 1.5rem; - } -} - -.bd-text-purple-bright { - color: #7952b3; -} - -.bd-bg-purple-bright { - background-color: #7952b3; -} - -.skippy { - background-color: #563d7c; -} - - .skippy a { - color: #fff; - } - - .skippy:focus-within a { - position: static !important; - width: auto !important; - height: auto !important; - padding: .5rem !important; - margin: .25rem !important; - overflow: visible !important; - clip: auto !important; - white-space: normal !important; - } - -@media (max-width: 767.98px) { - .bd-sidebar { - margin: 0 -.75rem 1rem; - } -} - -.bd-links { - overflow: auto; -} - -@media (min-width: 768px) { - .bd-links { - position: -webkit-sticky; - position: sticky; - top: 4rem; - display: block !important; - height: calc(100vh - 4.1rem); - padding-left: .25rem; - margin-left: -.25rem; - overflow-y: auto; - } -} - -@media (max-width: 767.98px) { - .bd-links > ul { - padding: 1.5rem .75rem; - background-color: #f8f9fa; - border-bottom: 1px solid #e9ecef; - } -} - -@media (prefers-reduced-motion: reduce) { - .bd-links .btn::before { - -webkit-transition: none; - transition: none; - } -} - -.bd-links .btn[aria-expanded="true"] { - color: rgba(0, 0, 0, 0.85); -} - -.bd-links .active { - font-weight: 600; - color: rgba(0, 0, 0, 0.85); -} - -@media (min-width: 768px) { - .bd-layout { - display: -ms-grid; - display: grid; - gap: 1.5rem; - grid-template-areas: "sidebar main"; - -ms-grid-columns: 1fr 3fr; - grid-template-columns: 1fr 3fr; - } -} - -@media (min-width: 992px) { - .bd-layout { - -ms-grid-columns: 1fr 5fr; - grid-template-columns: 1fr 5fr; - } -} - -.bd-sidebar { - grid-area: sidebar; -} - -.bd-main { - grid-area: main; -} - -@media (min-width: 768px) { - .bd-main { - display: -ms-grid; - display: grid; - gap: inherit; - grid-template-areas: "intro" "toc" "content"; - -ms-grid-rows: auto auto 1fr; - grid-template-rows: auto auto 1fr; - } -} - -@media (min-width: 992px) { - .bd-main { - grid-template-areas: "intro toc" "content toc"; - -ms-grid-columns: 4fr 1fr; - grid-template-columns: 4fr 1fr; - -ms-grid-rows: auto 1fr; - grid-template-rows: auto 1fr; - } -} - -.bd-intro { - grid-area: intro; -} - -.bd-toc { - grid-area: toc; -} - -.bd-content { - grid-area: content; - min-width: 1px; -} - -@media (min-width: 992px) { - .bd-toc { - position: -webkit-sticky; - position: sticky; - top: 5rem; - right: 0; - z-index: 2; - height: calc(100vh - 7rem); - overflow-y: auto; - } -} - -.bd-toc nav { - font-size: .875rem; -} - - .bd-toc nav ul { - padding-left: 0; - list-style: none; - } - - .bd-toc nav ul ul { - padding-left: 1rem; - margin-top: .25rem; - } - - .bd-toc nav li { - margin-bottom: .25rem; - } - - .bd-toc nav a { - color: inherit; - } - - .bd-toc nav a:not(:hover) { - text-decoration: none; - } - - .bd-toc nav a code { - font: inherit; - } - -.bd-footer { - font-size: .875rem; - color: #63707c; -} - - .bd-footer a { - font-weight: 600; - color: #495057; - } - - .bd-footer a:hover, .bd-footer a:focus { - color: #0d6efd; - } - -.bd-example-row .row > .col, .bd-example-row .row > [class^="col-"] { - padding-top: .75rem; - padding-bottom: .75rem; - background-color: rgba(39, 41, 43, 0.03); - border: 1px solid rgba(39, 41, 43, 0.1); -} - -.bd-example-row .row + .row { - margin-top: 1rem; -} - -.bd-example-row-flex-cols .row { - min-height: 10rem; - background-color: rgba(255, 0, 0, 0.1); -} - -.bd-highlight { - background-color: rgba(86, 61, 124, 0.15); - border: 1px solid rgba(86, 61, 124, 0.15); -} - -.example-container { - width: 800px; - width: 100%; - padding-right: var(--bs-gutter-x, 0.75rem); - padding-left: var(--bs-gutter-x, 0.75rem); - margin-right: auto; - margin-left: auto; -} - -.example-row { - --bs-gutter-x: 1.5rem; - --bs-gutter-y: 0; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - margin-top: calc(var(--bs-gutter-y) * -1); - margin-right: calc(var(--bs-gutter-x) / -2); - margin-left: calc(var(--bs-gutter-x) / -2); -} - -.example-content-main { - -ms-flex-negative: 0; - flex-shrink: 0; - width: 100%; - max-width: 100%; - padding-right: calc(var(--bs-gutter-x) / 2); - padding-left: calc(var(--bs-gutter-x) / 2); - margin-top: var(--bs-gutter-y); -} - -@media (min-width: 576px) { - .example-content-main { - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - width: 50%; - } -} - -@media (min-width: 992px) { - .example-content-main { - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - width: 66.666667%; - } -} - -.example-content-secondary { - -ms-flex-negative: 0; - flex-shrink: 0; - width: 100%; - max-width: 100%; - padding-right: calc(var(--bs-gutter-x) / 2); - padding-left: calc(var(--bs-gutter-x) / 2); - margin-top: var(--bs-gutter-y); -} - -@media (min-width: 576px) { - .example-content-secondary { - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - width: 50%; - } -} - -@media (min-width: 992px) { - .example-content-secondary { - -webkit-box-flex: 0; - -ms-flex: 0 0 auto; - flex: 0 0 auto; - width: 33.333333%; - } -} - -.bd-example { - position: relative; - padding: 1rem; - margin: 1rem -.75rem 0; - border: solid #dee2e6; - border-width: 1px 0 0; -} - - .bd-example::after { - display: block; - clear: both; - content: ""; - } - -@media (min-width: 576px) { - .bd-example { - padding: 1.5rem; - margin-right: 0; - margin-left: 0; - border-width: 1px; - border-top-left-radius: .25rem; - border-top-right-radius: .25rem; - } - - .bd-example + .bd-clipboard + .highlight { - border-bottom-right-radius: .25rem; - border-bottom-left-radius: .25rem; - } -} - -.bd-example + p { - margin-top: 2rem; -} - -.bd-example > .form-control + .form-control { - margin-top: .5rem; -} - -.bd-example > .nav + .nav, .bd-example > .alert + .alert, .bd-example > .navbar + .navbar, .bd-example > .progress + .progress { - margin-top: 1rem; -} - -.bd-example > .dropdown-menu { - position: static; - display: block; -} - -.bd-example > :last-child { - margin-bottom: 0; -} - -.bd-example > svg + svg, .bd-example > img + img { - margin-left: .5rem; -} - -.bd-example > .btn, .bd-example > .btn-group { - margin: .25rem .125rem; -} - -.bd-example > .btn-toolbar + .btn-toolbar { - margin-top: .5rem; -} - -.bd-example > .list-group { - max-width: 400px; -} - -.bd-example > [class*="list-group-horizontal"] { - max-width: 100%; -} - -.bd-example .fixed-top, .bd-example .sticky-top { - position: static; - margin: -1rem -1rem 1rem; -} - -.bd-example .fixed-bottom { - position: static; - margin: 1rem -1rem -1rem; -} - -@media (min-width: 576px) { - .bd-example .fixed-top, .bd-example .sticky-top { - margin: -1.5rem -1.5rem 1rem; - } - - .bd-example .fixed-bottom { - margin: 1rem -1.5rem -1.5rem; - } -} - -.bd-example .pagination { - margin-top: .5rem; - margin-bottom: .5rem; -} - -.bd-example-ratios .ratio { - display: inline-block; - width: 10rem; - color: #6c757d; - background-color: #f8f9fa; - border: 1px solid #dee2e6; -} - - .bd-example-ratios .ratio > div { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - } - -.bd-example-ratios-breakpoint .ratio-4x3 { - width: 16rem; -} - -@media (min-width: 768px) { - .bd-example-ratios-breakpoint .ratio-4x3 { - --aspect-ratio: 50%; - } -} - -.bd-example-modal { - background-color: #fafafa; -} - - .bd-example-modal .modal { - position: static; - display: block; - } - -.tooltip-demo a { - white-space: nowrap; -} - -.scrollspy-example { - position: relative; - height: 200px; - margin-top: .5rem; - overflow: auto; -} - -.scrollspy-example-2 { - position: relative; - height: 350px; - overflow: auto; -} - -.bd-example-border-utils [class^="border"] { - display: inline-block; - width: 5rem; - height: 5rem; - margin: .25rem; - background-color: #f5f5f5; -} - -.bd-example-border-utils-0 [class^="border"] { - border: 1px solid #dee2e6; -} - -.bd-example-rounded-utils [class*="rounded"] { - margin: .25rem; -} - -.bd-example-position-utils { - position: relative; - padding: 3em; -} - - .bd-example-position-utils .position-relative { - height: 200px; - background-color: #f5f5f5; - } - - .bd-example-position-utils .position-absolute { - width: 2em; - height: 2em; - background-color: #212529; - border-radius: .25rem; - } - -.bd-example-position-examples::after { - content: none; -} - -.bd-example-toasts { - min-height: 240px; -} - -.highlight { - padding: 1rem; - margin-bottom: 1rem; - background-color: #f8f9fa; -} - -@media (min-width: 576px) { - .highlight { - padding: 1rem 1.5rem; - } -} - -.highlight pre { - padding: 0; - margin-top: .65rem; - margin-bottom: .65rem; - white-space: pre; - background-color: transparent; - border: 0; -} - - .highlight pre code { - font-size: inherit; - color: #212529; - word-wrap: normal; - } - -.bd-content .highlight { - margin-right: -.75rem; - margin-left: -.75rem; -} - -@media (min-width: 576px) { - .bd-content .highlight { - margin-right: 0; - margin-left: 0; - } -} - -.btn-bd-primary { - font-weight: 600; - color: #fff; - background-color: #7952b3; - border-color: #7952b3; -} - - .btn-bd-primary:hover, .btn-bd-primary:active { - color: #fff; - background-color: #61428f; - border-color: #61428f; - } - - .btn-bd-primary:focus { - -webkit-box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - } - -.btn-bd-download { - font-weight: 600; - color: #ffe484; - border-color: #ffe484; -} - - .btn-bd-download:hover, .btn-bd-download:active { - color: #2a2730; - background-color: #ffe484; - border-color: #ffe484; - } - - .btn-bd-download:focus { - -webkit-box-shadow: 0 0 0 3px rgba(255, 228, 132, 0.25); - box-shadow: 0 0 0 3px rgba(255, 228, 132, 0.25); - } - -.btn-bd-light { - color: #6c757d; - border-color: #dee2e6; -} - - .show > .btn-bd-light, .btn-bd-light:hover, .btn-bd-light:active { - color: #7952b3; - background-color: #fff; - border-color: #7952b3; - } - - .btn-bd-light:focus { - -webkit-box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.25); - } - -.bd-callout { - padding: 1.25rem; - margin-top: 1.25rem; - margin-bottom: 1.25rem; - border: 1px solid #e9ecef; - border-left-width: .25rem; - border-radius: .25rem; -} - - .bd-callout h4 { - margin-bottom: .25rem; - } - - .bd-callout p:last-child { - margin-bottom: 0; - } - - .bd-callout code { - border-radius: .25rem; - } - - .bd-callout + .bd-callout { - margin-top: -.25rem; - } - -.bd-callout-info { - border-left-color: #5bc0de; -} - -.bd-callout-warning { - border-left-color: #f0ad4e; -} - -.bd-callout-danger { - border-left-color: #d9534f; -} - -.bd-brand-logos { - color: #7952b3; -} - - .bd-brand-logos .inverse { - color: #fff; - background-color: #7952b3; - } - -.bd-brand-item + .bd-brand-item { - border-top: 1px solid #fff; -} - -@media (min-width: 768px) { - .bd-brand-item + .bd-brand-item { - border-top: 0; - border-left: 1px solid #fff; - } -} - -.color-swatches { - margin: 0 -5px; -} - - .color-swatches .bd-purple { - background-color: #563d7c; - } - - .color-swatches .bd-purple-light { - background-color: #cbbde2; - } - - .color-swatches .bd-purple-lighter { - background-color: #e5e1ea; - } - - .color-swatches .bd-gray { - background-color: #f9f9f9; - } - -.color-swatch { - width: 4rem; - height: 4rem; -} - -@media (min-width: 768px) { - .color-swatch { - width: 6rem; - height: 6rem; - } -} - -.swatch-blue { - color: #fff; - background-color: #0d6efd; -} - - .swatch-blue::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "4.50" "\a" "4.50" "\a" "4.66"; - background-color: #0d6efd; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-indigo { - color: #fff; - background-color: #6610f2; -} - - .swatch-indigo::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "7.18" "\a" "7.18" "\a" "2.92"; - background-color: #6610f2; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-purple { - color: #fff; - background-color: #6f42c1; -} - - .swatch-purple::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "6.51" "\a" "6.51" "\a" "3.22"; - background-color: #6f42c1; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-pink { - color: #fff; - background-color: #d63384; -} - - .swatch-pink::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "4.50" "\a" "4.50" "\a" "4.66"; - background-color: #d63384; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-red { - color: #fff; - background-color: #dc3545; -} - - .swatch-red::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "4.52" "\a" "4.52" "\a" "4.63"; - background-color: #dc3545; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-orange { - color: #000; - background-color: #fd7e14; -} - - .swatch-orange::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "8.17" "\a" "2.57" "\a" "8.17"; - background-color: #fd7e14; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-yellow { - color: #000; - background-color: #ffc107; -} - - .swatch-yellow::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "12.8" "\a" "1.63" "\a" "12.8"; - background-color: #ffc107; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-green { - color: #fff; - background-color: #198754; -} - - .swatch-green::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "4.53" "\a" "4.53" "\a" "4.63"; - background-color: #198754; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-teal { - color: #000; - background-color: #20c997; -} - - .swatch-teal::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "9.86" "\a" "2.12" "\a" "9.86"; - background-color: #20c997; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-cyan { - color: #000; - background-color: #0dcaf0; -} - - .swatch-cyan::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "10.7" "\a" "1.95" "\a" "10.7"; - background-color: #0dcaf0; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-white { - color: #000; - background-color: #fff; -} - - .swatch-white::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "21" "\a" "1" "\a" "21"; - background-color: #fff; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-gray { - color: #fff; - background-color: #6c757d; -} - - .swatch-gray::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "4.68" "\a" "4.68" "\a" "4.47"; - background-color: #6c757d; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-gray-dark { - color: #fff; - background-color: #343a40; -} - - .swatch-gray-dark::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "11.5" "\a" "11.5" "\a" "1.82"; - background-color: #343a40; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #fff), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #fff 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.swatch-gray-500 { - color: #000; - background-color: #adb5bd; -} - - .swatch-gray-500::after { - position: absolute; - top: 1rem; - right: 1rem; - padding-left: 1rem; - font-size: .75rem; - line-height: 1.35; - white-space: pre; - content: "10.1" "\a" "2.07" "\a" "10.1"; - background-color: #adb5bd; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.25rem, transparent), color-stop(0.25rem, #000), color-stop(0.75rem, transparent), color-stop(1.25rem, #fff), color-stop(1.75rem, transparent), color-stop(2.25rem, #000), color-stop(2.75rem, transparent)); - background-image: linear-gradient(to bottom, transparent 0.25rem, #000 0.25rem 0.75rem, transparent 0.75rem 1.25rem, #fff 1.25rem 1.75rem, transparent 1.75rem 2.25rem, #000 2.25rem 2.75rem, transparent 2.75rem); - background-repeat: no-repeat; - background-size: .5rem 100%; - } - -.bd-blue-100 { - color: #000; - background-color: #cfe2ff; -} - -.bd-blue-200 { - color: #000; - background-color: #9ec5fe; -} - -.bd-blue-300 { - color: #000; - background-color: #6ea8fe; -} - -.bd-blue-400 { - color: #000; - background-color: #3d8bfd; -} - -.bd-blue-500 { - color: #fff; - background-color: #0d6efd; -} - -.bd-blue-600 { - color: #fff; - background-color: #0a58ca; -} - -.bd-blue-700 { - color: #fff; - background-color: #084298; -} - -.bd-blue-800 { - color: #fff; - background-color: #052c65; -} - -.bd-blue-900 { - color: #fff; - background-color: #031633; -} - -.bd-indigo-100 { - color: #000; - background-color: #e0cffc; -} - -.bd-indigo-200 { - color: #000; - background-color: #c29ffa; -} - -.bd-indigo-300 { - color: #000; - background-color: #a370f7; -} - -.bd-indigo-400 { - color: #fff; - background-color: #8540f5; -} - -.bd-indigo-500 { - color: #fff; - background-color: #6610f2; -} - -.bd-indigo-600 { - color: #fff; - background-color: #520dc2; -} - -.bd-indigo-700 { - color: #fff; - background-color: #3d0a91; -} - -.bd-indigo-800 { - color: #fff; - background-color: #290661; -} - -.bd-indigo-900 { - color: #fff; - background-color: #140330; -} - -.bd-purple-100 { - color: #000; - background-color: #e2d9f3; -} - -.bd-purple-200 { - color: #000; - background-color: #c5b3e6; -} - -.bd-purple-300 { - color: #000; - background-color: #a98eda; -} - -.bd-purple-400 { - color: #000; - background-color: #8c68cd; -} - -.bd-purple-500 { - color: #fff; - background-color: #6f42c1; -} - -.bd-purple-600 { - color: #fff; - background-color: #59359a; -} - -.bd-purple-700 { - color: #fff; - background-color: #432874; -} - -.bd-purple-800 { - color: #fff; - background-color: #2c1a4d; -} - -.bd-purple-900 { - color: #fff; - background-color: #160d27; -} - -.bd-pink-100 { - color: #000; - background-color: #f7d6e6; -} - -.bd-pink-200 { - color: #000; - background-color: #efadce; -} - -.bd-pink-300 { - color: #000; - background-color: #e685b5; -} - -.bd-pink-400 { - color: #000; - background-color: #de5c9d; -} - -.bd-pink-500 { - color: #fff; - background-color: #d63384; -} - -.bd-pink-600 { - color: #fff; - background-color: #ab296a; -} - -.bd-pink-700 { - color: #fff; - background-color: #801f4f; -} - -.bd-pink-800 { - color: #fff; - background-color: #561435; -} - -.bd-pink-900 { - color: #fff; - background-color: #2b0a1a; -} - -.bd-red-100 { - color: #000; - background-color: #f8d7da; -} - -.bd-red-200 { - color: #000; - background-color: #f1aeb5; -} - -.bd-red-300 { - color: #000; - background-color: #ea868f; -} - -.bd-red-400 { - color: #000; - background-color: #e35d6a; -} - -.bd-red-500 { - color: #fff; - background-color: #dc3545; -} - -.bd-red-600 { - color: #fff; - background-color: #b02a37; -} - -.bd-red-700 { - color: #fff; - background-color: #842029; -} - -.bd-red-800 { - color: #fff; - background-color: #58151c; -} - -.bd-red-900 { - color: #fff; - background-color: #2c0b0e; -} - -.bd-orange-100 { - color: #000; - background-color: #ffe5d0; -} - -.bd-orange-200 { - color: #000; - background-color: #fecba1; -} - -.bd-orange-300 { - color: #000; - background-color: #feb272; -} - -.bd-orange-400 { - color: #000; - background-color: #fd9843; -} - -.bd-orange-500 { - color: #000; - background-color: #fd7e14; -} - -.bd-orange-600 { - color: #000; - background-color: #ca6510; -} - -.bd-orange-700 { - color: #fff; - background-color: #984c0c; -} - -.bd-orange-800 { - color: #fff; - background-color: #653208; -} - -.bd-orange-900 { - color: #fff; - background-color: #331904; -} - -.bd-yellow-100 { - color: #000; - background-color: #fff3cd; -} - -.bd-yellow-200 { - color: #000; - background-color: #ffe69c; -} - -.bd-yellow-300 { - color: #000; - background-color: #ffda6a; -} - -.bd-yellow-400 { - color: #000; - background-color: #ffcd39; -} - -.bd-yellow-500 { - color: #000; - background-color: #ffc107; -} - -.bd-yellow-600 { - color: #000; - background-color: #cc9a06; -} - -.bd-yellow-700 { - color: #000; - background-color: #997404; -} - -.bd-yellow-800 { - color: #fff; - background-color: #664d03; -} - -.bd-yellow-900 { - color: #fff; - background-color: #332701; -} - -.bd-green-100 { - color: #000; - background-color: #d1e7dd; -} - -.bd-green-200 { - color: #000; - background-color: #a3cfbb; -} - -.bd-green-300 { - color: #000; - background-color: #75b798; -} - -.bd-green-400 { - color: #000; - background-color: #479f76; -} - -.bd-green-500 { - color: #fff; - background-color: #198754; -} - -.bd-green-600 { - color: #fff; - background-color: #146c43; -} - -.bd-green-700 { - color: #fff; - background-color: #0f5132; -} - -.bd-green-800 { - color: #fff; - background-color: #0a3622; -} - -.bd-green-900 { - color: #fff; - background-color: #051b11; -} - -.bd-teal-100 { - color: #000; - background-color: #d2f4ea; -} - -.bd-teal-200 { - color: #000; - background-color: #a6e9d5; -} - -.bd-teal-300 { - color: #000; - background-color: #79dfc1; -} - -.bd-teal-400 { - color: #000; - background-color: #4dd4ac; -} - -.bd-teal-500 { - color: #000; - background-color: #20c997; -} - -.bd-teal-600 { - color: #000; - background-color: #1aa179; -} - -.bd-teal-700 { - color: #fff; - background-color: #13795b; -} - -.bd-teal-800 { - color: #fff; - background-color: #0d503c; -} - -.bd-teal-900 { - color: #fff; - background-color: #06281e; -} - -.bd-cyan-100 { - color: #000; - background-color: #cff4fc; -} - -.bd-cyan-200 { - color: #000; - background-color: #9eeaf9; -} - -.bd-cyan-300 { - color: #000; - background-color: #6edff6; -} - -.bd-cyan-400 { - color: #000; - background-color: #3dd5f3; -} - -.bd-cyan-500 { - color: #000; - background-color: #0dcaf0; -} - -.bd-cyan-600 { - color: #000; - background-color: #0aa2c0; -} - -.bd-cyan-700 { - color: #fff; - background-color: #087990; -} - -.bd-cyan-800 { - color: #fff; - background-color: #055160; -} - -.bd-cyan-900 { - color: #fff; - background-color: #032830; -} - -.bd-gray-100 { - color: #000; - background-color: #f8f9fa; -} - -.bd-gray-200 { - color: #000; - background-color: #e9ecef; -} - -.bd-gray-300 { - color: #000; - background-color: #dee2e6; -} - -.bd-gray-400 { - color: #000; - background-color: #ced4da; -} - -.bd-gray-500 { - color: #000; - background-color: #adb5bd; -} - -.bd-gray-600 { - color: #fff; - background-color: #6c757d; -} - -.bd-gray-700 { - color: #fff; - background-color: #495057; -} - -.bd-gray-800 { - color: #fff; - background-color: #343a40; -} - -.bd-gray-900 { - color: #fff; - background-color: #212529; -} - -.bd-white { - color: #000; - background-color: #fff; -} - -.bd-black { - color: #fff; - background-color: #000; -} - -.bd-clipboard { - position: relative; - display: none; - float: right; -} - - .bd-clipboard + .highlight { - margin-top: 0; - } - -@media (min-width: 768px) { - .bd-clipboard { - display: block; - } -} - -.bd-placeholder-img { - font-size: 1.125rem; - text-anchor: middle; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.bd-placeholder-img-lg { - font-size: calc(1.475rem + 2.7vw); -} - -@media (min-width: 1200px) { - .bd-placeholder-img-lg { - font-size: 3.5rem; - } -} - -.chroma .c { - color: #727272; -} - -.chroma .ch { - font-style: italic; - color: #60a0b0; -} - -.chroma .cm { - color: #727272; -} - -.chroma .cp { - color: #008085; -} - -.chroma .cpf { - color: #007020; -} - -.chroma .c1 { - color: #727272; -} - -.chroma .cs { - color: #727272; -} - -.chroma .gd { - background-color: #fcc; - border: 1px solid #c00; -} - -.chroma .ge { - font-style: italic; -} - -.chroma .gr { - color: #f00; -} - -.chroma .gh { - color: #030; -} - -.chroma .gi { - background-color: #cfc; - border: 1px solid #0c0; -} - -.chroma .go { - color: #aaa; -} - -.chroma .gp { - color: #009; -} - -.chroma .gs { - font-weight: 700; -} - -.chroma .gu { - color: #030; -} - -.chroma .gt { - color: #9c6; -} - -.chroma .gl { - text-decoration: underline; -} - -.chroma .k { - color: #069; -} - -.chroma .kc { - color: #069; -} - -.chroma .kd { - color: #069; -} - -.chroma .kn { - color: #069; -} - -.chroma .kp { - color: #069; -} - -.chroma .kr { - color: #069; -} - -.chroma .kt { - color: #078; -} - -.chroma .m { - color: #c24f19; -} - -.chroma .mb { - color: #40a070; -} - -.chroma .mf { - color: #c24f19; -} - -.chroma .mh { - color: #c24f19; -} - -.chroma .mi { - color: #c24f19; -} - -.chroma .il { - color: #c24f19; -} - -.chroma .mo { - color: #c24f19; -} - -.chroma .s { - color: #d73038; -} - -.chroma .sa { - color: #4070a0; -} - -.chroma .sb { - color: #c30; -} - -.chroma .sc { - color: #c30; -} - -.chroma .dl { - color: #4070a0; -} - -.chroma .sd { - font-style: italic; - color: #c30; -} - -.chroma .s2 { - color: #c30; -} - -.chroma .se { - color: #c30; -} - -.chroma .sh { - color: #c30; -} - -.chroma .si { - color: #a00; -} - -.chroma .sx { - color: #c30; -} - -.chroma .sr { - color: #337e7e; -} - -.chroma .s1 { - color: #c30; -} - -.chroma .ss { - color: #fc3; -} - -.chroma .na { - color: #006ee0; -} - -.chroma .nb { - color: #366; -} - -.chroma .nc { - color: #168174; -} - -.chroma .no { - color: #360; -} - -.chroma .nd { - color: #6b62de; -} - -.chroma .ni { - color: #727272; -} - -.chroma .ne { - color: #c00; -} - -.chroma .nf { - color: #b715f4; -} - -.chroma .nl { - color: #6b62de; -} - -.chroma .nn { - color: #007ca5; -} - -.chroma .nt { - color: #2f6f9f; -} - -.chroma .nv { - color: #033; -} - -.chroma .o { - color: #555; -} - -.chroma .ow { - color: #000; -} - -.chroma .w { - color: #bbb; -} - -.chroma .language-bash::before, .chroma .language-sh::before { - color: #009; - content: "$ "; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.chroma .language-powershell::before { - color: #009; - content: "PM> "; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.anchorjs-link { - font-weight: 400; - color: rgba(13, 110, 253, 0.5); - -webkit-transition: color 0.15s ease-in-out; - transition: color 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .anchorjs-link { - -webkit-transition: none; - transition: none; - } -} - -.anchorjs-link:focus, .anchorjs-link:hover { - color: #0d6efd; - text-decoration: none; -} - -.algolia-autocomplete { - width: 100%; -} - -.ds-dropdown-menu { - width: 100%; - padding: .5rem 0; - margin: .125rem 0 0; - font-size: .875rem; - background-color: #fff; - border: 1px solid rgba(0, 0, 0, 0.15); - border-radius: .25rem; -} - -@media (min-width: 768px) { - .ds-dropdown-menu { - width: 400px; - } -} - -.algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - font-weight: 600; - color: #7952b3; -} - -:not(.algolia-docsearch-suggestion__main) > .algolia-docsearch-suggestion--category-header { - display: none; -} - -.ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.algolia-docsearch-suggestion--content { - padding: .25rem 1rem; -} - -.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(203, 189, 226, 0.2); -} - -.algolia-docsearch-suggestion { - display: block; - text-decoration: none; -} - -.algolia-docsearch-suggestion--subcategory-column { - display: none; -} - -.algolia-docsearch-suggestion--subcategory-inline { - display: inline; - color: #495057; -} - - .algolia-docsearch-suggestion--subcategory-inline::after { - padding: 0 .25rem; - content: "/"; - } - -.algolia-docsearch-suggestion--title { - display: inline; - font-weight: 500; - color: #343a40; -} - -.algolia-docsearch-suggestion--text { - color: #343a40; - font-size: .75rem; -} - -.algolia-docsearch-suggestion--highlight { - color: #6f42c1; - background-color: rgba(111, 66, 193, 0.1); -} - -.algolia-docsearch-footer { - padding: .5rem 1rem 0; - margin-top: .625rem; - font-size: .75rem; - color: #6c757d; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.algolia-docsearch-footer--logo { - color: inherit; -} -/*# sourceMappingURL=portal-extend.css.map */ diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/portal.min.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/portal.min.css deleted file mode 100644 index 02680a452..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/portal.min.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Wed Feb 24 2021 09:23:11 GMT+0700 (Indochina Time) */@charset "UTF-8";/*! - * Bootstrap v5.0.0-beta2 (https://getbootstrap.com/) - * Copyright 2011-2021 The Bootstrap Authors - * Copyright 2011-2021 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */.CodeMirror pre,body{-webkit-tap-highlight-color:transparent}dl,ol,p,pre,ul{margin-top:0}hr,pre code{color:inherit}.card,code{word-wrap:break-word}dd,legend{margin-bottom:.5rem}label,output{display:inline-block}.badge,progress,sub,sup{vertical-align:baseline}.dropdown-header,.dropdown-item,.dropdown-toggle,.input-group-text,.navbar-brand{white-space:nowrap}.fa-ul,.nc-icon-ul{list-style-type:none}.breadcrumb,.carousel-indicators,.dropdown-menu,.list-inline,.list-unstyled,.nav,.navbar-nav,.pagination,.te-heading-add ul{list-style:none}:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0))}*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-font-sans-serif);font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{margin:1rem 0;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}address,dl,ol,p,pre,ul{margin-bottom:1rem}blockquote,figure{margin:0 0 1rem}address,legend{line-height:inherit}.h1,h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){.h1,h1{font-size:2.5rem}}.h2,h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.h2,h2{font-size:2rem}}.h3,h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){.h3,h3{font-size:1.75rem}}.h4,h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){.h4,h4{font-size:1.5rem}}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.btn,.form-control-color:not(:disabled):not([readonly]),.form-control[type=file]:not(:disabled):not([readonly]),[role=button],[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled),summary{cursor:pointer}address{font-style:normal}ol,ul{padding-left:2rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-left:0}b,strong{font-weight:bolder}.small,small{font-size:.875em}.mark,mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:var(--bs-font-monospace);font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;overflow:auto;font-size:.875em}pre code{font-size:inherit;word-break:normal}code,kbd{font-size:.875em}code{color:#d63384}a>code{color:inherit}kbd{padding:.2rem .4rem;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}button{border-radius:0}fieldset,iframe{border:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}select{word-wrap:normal}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0}legend{float:left;width:100%;padding:0;font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.display-1,.display-2,.display-3,.display-4,.display-5,.display-6{font-weight:300;line-height:1.2}summary{display:list-item}[hidden]{display:none!important}.figure,.list-inline-item{display:inline-block}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw)}@media (min-width:1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw)}@media (min-width:1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw)}@media (min-width:1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw)}@media (min-width:1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw)}@media (min-width:1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw)}.btn,.btn-link,.dropdown-item,.form-control,.form-select{font-weight:400}@media (min-width:1200px){.display-6{font-size:2.5rem}}.list-inline,.list-unstyled{padding-left:0}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer,.figure-caption{font-size:.875em;color:#6c757d}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem}.blockquote-footer::before{content:"— "}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure-img{margin-bottom:.5rem;line-height:1}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{width:100%;padding-right:var(--bs-gutter-x,.75rem);padding-left:var(--bs-gutter-x,.75rem);margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}@media (min-width:1400px){.container,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(var(--bs-gutter-y) * -1);margin-right:calc(var(--bs-gutter-x)/ -2);margin-left:calc(var(--bs-gutter-x)/ -2)}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x)/ 2);padding-left:calc(var(--bs-gutter-x)/ 2);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.6666666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.3333333333%}.col-2,.col-3{flex:0 0 auto}.col-2{width:16.6666666667%}.col-3{width:25%}.col-4,.col-5{flex:0 0 auto}.col-4{width:33.3333333333%}.col-5{width:41.6666666667%}.col-6,.col-7{flex:0 0 auto}.col-6{width:50%}.col-7{width:58.3333333333%}.col-8,.col-9{flex:0 0 auto}.col-8{width:66.6666666667%}.col-9{width:75%}.col-10{flex:0 0 auto;width:83.3333333333%}.col-11{flex:0 0 auto;width:91.6666666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media (min-width:576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.6666666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.3333333333%}.col-sm-2{flex:0 0 auto;width:16.6666666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.3333333333%}.col-sm-5{flex:0 0 auto;width:41.6666666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.3333333333%}.col-sm-8{flex:0 0 auto;width:66.6666666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.3333333333%}.col-sm-11{flex:0 0 auto;width:91.6666666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media (min-width:768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.6666666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.3333333333%}.col-md-2{flex:0 0 auto;width:16.6666666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.3333333333%}.col-md-5{flex:0 0 auto;width:41.6666666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.3333333333%}.col-md-8{flex:0 0 auto;width:66.6666666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.3333333333%}.col-md-11{flex:0 0 auto;width:91.6666666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media (min-width:992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.6666666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.3333333333%}.col-lg-2{flex:0 0 auto;width:16.6666666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.3333333333%}.col-lg-5{flex:0 0 auto;width:41.6666666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.3333333333%}.col-lg-8{flex:0 0 auto;width:66.6666666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.3333333333%}.col-lg-11{flex:0 0 auto;width:91.6666666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media (min-width:1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.6666666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.3333333333%}.col-xl-2{flex:0 0 auto;width:16.6666666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.3333333333%}.col-xl-5{flex:0 0 auto;width:41.6666666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.3333333333%}.col-xl-8{flex:0 0 auto;width:66.6666666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.3333333333%}.col-xl-11{flex:0 0 auto;width:91.6666666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media (min-width:1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.6666666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.3333333333%}.col-xxl-2{flex:0 0 auto;width:16.6666666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.3333333333%}.col-xxl-5{flex:0 0 auto;width:41.6666666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.3333333333%}.col-xxl-8{flex:0 0 auto;width:66.6666666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.3333333333%}.col-xxl-11{flex:0 0 auto;width:91.6666666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.3333333333%}.offset-xxl-2{margin-left:16.6666666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.3333333333%}.offset-xxl-5{margin-left:41.6666666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.3333333333%}.offset-xxl-8{margin-left:66.6666666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.3333333333%}.offset-xxl-11{margin-left:91.6666666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}.table{--bs-table-bg:transparent;--bs-table-striped-color:#212529;--bs-table-striped-bg:rgba(0, 0, 0, 0.05);--bs-table-active-color:#212529;--bs-table-active-bg:rgba(0, 0, 0, 0.1);--bs-table-hover-color:#212529;--bs-table-hover-bg:rgba(0, 0, 0, 0.075);width:100%;margin-bottom:1rem;color:#212529;vertical-align:top;border-color:#dee2e6}.table>:not(caption)>*>*{padding:.5rem;background-color:var(--bs-table-bg);border-bottom-width:1px;box-shadow:inset 0 0 0 9999px var(--bs-table-accent-bg)}.form-check-input:focus,.form-control:focus,.form-select:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.25);outline:0}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table>:not(:last-child)>:last-child>*{border-bottom-color:currentColor}.caption-top{caption-side:top}.table-sm>:not(caption)>*>*{padding:.25rem}.table-bordered>:not(caption)>*{border-width:1px 0}.table-bordered>:not(caption)>*>*{border-width:0 1px}.table-borderless>:not(caption)>*>*{border-bottom-width:0}.table-striped>tbody>tr:nth-of-type(odd){--bs-table-accent-bg:var(--bs-table-striped-bg);color:var(--bs-table-striped-color)}.table-active{--bs-table-accent-bg:var(--bs-table-active-bg);color:var(--bs-table-active-color)}.table-hover>tbody>tr:hover{--bs-table-accent-bg:var(--bs-table-hover-bg);color:var(--bs-table-hover-color)}.table-primary{--bs-table-bg:#cfe2ff;--bs-table-striped-bg:#c5d7f2;--bs-table-striped-color:#000;--bs-table-active-bg:#bacbe6;--bs-table-active-color:#000;--bs-table-hover-bg:#bfd1ec;--bs-table-hover-color:#000;color:#000;border-color:#bacbe6}.table-secondary{--bs-table-bg:#e2e3e5;--bs-table-striped-bg:#d7d8da;--bs-table-striped-color:#000;--bs-table-active-bg:#cbccce;--bs-table-active-color:#000;--bs-table-hover-bg:#d1d2d4;--bs-table-hover-color:#000;color:#000;border-color:#cbccce}.table-success{--bs-table-bg:#d1e7dd;--bs-table-striped-bg:#c7dbd2;--bs-table-striped-color:#000;--bs-table-active-bg:#bcd0c7;--bs-table-active-color:#000;--bs-table-hover-bg:#c1d6cc;--bs-table-hover-color:#000;color:#000;border-color:#bcd0c7}.table-info{--bs-table-bg:#cff4fc;--bs-table-striped-bg:#c5e8ef;--bs-table-striped-color:#000;--bs-table-active-bg:#badce3;--bs-table-active-color:#000;--bs-table-hover-bg:#bfe2e9;--bs-table-hover-color:#000;color:#000;border-color:#badce3}.table-warning{--bs-table-bg:#fff3cd;--bs-table-striped-bg:#f2e7c3;--bs-table-striped-color:#000;--bs-table-active-bg:#e6dbb9;--bs-table-active-color:#000;--bs-table-hover-bg:#ece1be;--bs-table-hover-color:#000;color:#000;border-color:#e6dbb9}.table-danger{--bs-table-bg:#f8d7da;--bs-table-striped-bg:#eccccf;--bs-table-striped-color:#000;--bs-table-active-bg:#dfc2c4;--bs-table-active-color:#000;--bs-table-hover-bg:#e5c7ca;--bs-table-hover-color:#000;color:#000;border-color:#dfc2c4}.table-light{--bs-table-bg:#f8f9fa;--bs-table-striped-bg:#ecedee;--bs-table-striped-color:#000;--bs-table-active-bg:#dfe0e1;--bs-table-active-color:#000;--bs-table-hover-bg:#e5e6e7;--bs-table-hover-color:#000;color:#000;border-color:#dfe0e1}.table-dark{--bs-table-bg:#212529;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;color:#fff;border-color:#373b3e}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}@media (max-width:575.98px){.table-responsive-sm{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:767.98px){.table-responsive-md{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:991.98px){.table-responsive-lg{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1199.98px){.table-responsive-xl{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1399.98px){.table-responsive-xxl{overflow-x:auto;-webkit-overflow-scrolling:touch}}.collapsing,.form-control[type=file]{overflow:hidden}.form-label{margin-bottom:.5rem}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem}.form-text{margin-top:.25rem;font-size:.875em;color:#6c757d}.form-control,.form-control:focus{color:#212529;background-color:#fff}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;background-clip:padding-box;border:1px solid #ced4da;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.form-check-input,.form-select{-moz-appearance:none;background-repeat:no-repeat}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control:focus{border-color:#86b7fe}.form-control::-webkit-date-and-time-value{height:1.5em}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}.form-control::file-selector-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control::file-selector-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#dde0e3}.form-control::-webkit-file-upload-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}}.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:#dde0e3}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{min-height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.form-control-sm::file-selector-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-sm::-webkit-file-upload-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-lg{min-height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.form-control-lg::file-selector-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.form-control-lg::-webkit-file-upload-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}textarea.form-control{min-height:calc(1.5em + .75rem + 2px)}textarea.form-control-sm{min-height:calc(1.5em + .5rem + 2px)}textarea.form-control-lg{min-height:calc(1.5em + 1rem + 2px)}.form-control-color{max-width:3rem;height:auto;padding:.375rem}.form-control-color::-moz-color-swatch{height:1.5em;border-radius:.25rem}.form-control-color::-webkit-color-swatch{height:1.5em;border-radius:.25rem}.form-select{display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;font-size:1rem;line-height:1.5;color:#212529;background-color:#fff;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");background-position:right .75rem center;background-size:16px 12px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;appearance:none}.form-select:focus{border-color:#86b7fe}.form-select[multiple],.form-select[size]:not([size="1"]){padding-right:.75rem;background-image:none}.form-select:disabled{color:#6c757d;background-color:#e9ecef}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #212529}.form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.form-check{display:block;min-height:1.5rem;padding-left:1.5em;margin-bottom:.125rem}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-input{width:1em;height:1em;margin-top:.25em;vertical-align:top;background-color:#fff;background-position:center;background-size:contain;border:1px solid rgba(0,0,0,.25);-webkit-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact}.form-check-input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio]{border-radius:50%}.form-check-input:active{filter:brightness(90%)}.form-check-input:focus{border-color:#86b7fe}.form-check-input:checked{background-color:#0d6efd;border-color:#0d6efd}.form-check-input:checked[type=checkbox]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e")}.form-check-input:checked[type=radio]{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e")}.form-check-input[type=checkbox]:indeterminate{background-color:#0d6efd;border-color:#0d6efd;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e")}.form-check-input:disabled{pointer-events:none;filter:none;opacity:.5}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{opacity:.5}.form-switch{padding-left:2.5em}.form-switch .form-check-input{width:2em;margin-left:-2.5em;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");background-position:left center;border-radius:2em;transition:background-position .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-switch .form-check-input{transition:none}}.form-switch .form-check-input:focus{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2386b7fe'/%3e%3c/svg%3e")}.form-switch .form-check-input:checked{background-position:right center;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.form-check-inline{display:inline-block;margin-right:1rem}.btn-check{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.btn-check:disabled+.btn,.btn-check[disabled]+.btn{pointer-events:none;filter:none;opacity:.65}.form-range{width:100%;height:1.5rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.form-range:focus{outline:0}.form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range::-moz-focus-outer{border:0}.form-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#0d6efd;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.form-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}.form-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.form-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#0d6efd;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.form-range::-moz-range-thumb{-moz-transition:none;transition:none}}.form-range::-moz-range-thumb:active{background-color:#b6d4fe}.form-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.form-range:disabled{pointer-events:none}.form-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.form-range:disabled::-moz-range-thumb{background-color:#adb5bd}.form-floating{position:relative}.form-floating>.form-control,.form-floating>.form-select{height:calc(3.5rem + 2px);padding:1rem .75rem}.form-floating>label{position:absolute;top:0;left:0;height:100%;padding:1rem .75rem;pointer-events:none;border:1px solid transparent;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media (prefers-reduced-motion:reduce){.form-floating>label{transition:none}}.form-floating>.form-control::-webkit-input-placeholder{color:transparent}.form-floating>.form-control::-moz-placeholder{color:transparent}.form-floating>.form-control::placeholder{color:transparent}.form-floating>.form-control:not(:-moz-placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:focus,.form-floating>.form-control:not(:placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:-webkit-autofill{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-select{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:not(:-moz-placeholder-shown)~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control:focus~label,.form-floating>.form-control:not(:placeholder-shown)~label,.form-floating>.form-select~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control:-webkit-autofill~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-select{position:relative;flex:1 1 auto;width:1%;min-width:0}.input-group>.form-control:focus,.input-group>.form-select:focus{z-index:3}.input-group .btn{position:relative;z-index:2}.input-group .btn:focus{z-index:3}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:center;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-lg>.btn,.input-group-lg>.form-control,.input-group-lg>.form-select,.input-group-lg>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.input-group-sm>.btn,.input-group-sm>.form-control,.input-group-sm>.form-select,.input-group-sm>.input-group-text{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.input-group-lg>.form-select,.input-group-sm>.form-select{padding-right:3rem}.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu),.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}.form-check-inline .form-check-input~.invalid-feedback,.form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.invalid-tooltip,.valid-tooltip{position:absolute;z-index:5;border-radius:.25rem;top:100%;max-width:100%}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#198754}.valid-tooltip{display:none;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(25,135,84,.9)}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#198754;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-valid,.was-validated .form-select:valid{border-color:#198754;padding-right:4.125rem;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"),url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-valid:focus,.was-validated .form-select:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-check-input.is-valid,.was-validated .form-check-input:valid{border-color:#198754}.form-check-input.is-valid:checked,.was-validated .form-check-input:valid:checked{background-color:#198754}.form-check-input.is-valid:focus,.was-validated .form-check-input:valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#198754}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#dc3545}.invalid-tooltip{display:none;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(220,53,69,.9)}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-invalid,.was-validated .form-select:invalid{border-color:#dc3545;padding-right:4.125rem;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"),url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-invalid:focus,.was-validated .form-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-check-input.is-invalid,.was-validated .form-check-input:invalid{border-color:#dc3545}.form-check-input.is-invalid:checked,.was-validated .form-check-input:invalid:checked{background-color:#dc3545}.form-check-input.is-invalid:focus,.was-validated .form-check-input:invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.btn,.btn:hover{color:#212529}.btn{display:inline-block;line-height:1.5;text-align:center;text-decoration:none;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.dropdown-toggle::after,.dropup .dropdown-toggle::after{vertical-align:.255em;content:""}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn-check:focus+.btn,.btn:focus{outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.btn-check:active+.btn-primary:focus,.btn-check:checked+.btn-primary:focus,.btn-check:focus+.btn-primary,.btn-primary.active:focus,.btn-primary:active:focus,.btn-primary:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(49,132,253,.5)}.btn.disabled,.btn:disabled,fieldset:disabled .btn{pointer-events:none;opacity:.65}.btn-primary{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.btn-check:focus+.btn-primary,.btn-primary:focus,.btn-primary:hover{background-color:#0b5ed7;border-color:#0a58ca;color:#fff}.btn-check:active+.btn-primary,.btn-check:checked+.btn-primary,.btn-primary.active,.btn-primary:active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0a58ca;border-color:#0a53be}.btn-check:active+.btn-secondary:focus,.btn-check:checked+.btn-secondary:focus,.btn-check:focus+.btn-secondary,.btn-secondary.active:focus,.btn-secondary:active:focus,.btn-secondary:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(130,138,145,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-check:focus+.btn-secondary,.btn-secondary:focus,.btn-secondary:hover{background-color:#5c636a;border-color:#565e64;color:#fff}.btn-check:active+.btn-secondary,.btn-check:checked+.btn-secondary,.btn-secondary.active,.btn-secondary:active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#565e64;border-color:#51585e}.btn-check:active+.btn-success:focus,.btn-check:checked+.btn-success:focus,.btn-check:focus+.btn-success,.btn-success.active:focus,.btn-success:active:focus,.btn-success:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(60,153,110,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-success{color:#fff;background-color:#198754;border-color:#198754}.btn-check:focus+.btn-success,.btn-success:focus,.btn-success:hover{background-color:#157347;border-color:#146c43;color:#fff}.btn-check:active+.btn-success,.btn-check:checked+.btn-success,.btn-success.active,.btn-success:active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#146c43;border-color:#13653f}.btn-check:active+.btn-info:focus,.btn-check:checked+.btn-info:focus,.btn-check:focus+.btn-info,.btn-info.active:focus,.btn-info:active:focus,.btn-info:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(11,172,204,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#198754;border-color:#198754}.btn-info{color:#000;background-color:#0dcaf0;border-color:#0dcaf0}.btn-check:focus+.btn-info,.btn-info:focus,.btn-info:hover{color:#000;background-color:#31d2f2;border-color:#25cff2}.btn-check:active+.btn-info,.btn-check:checked+.btn-info,.btn-info.active,.btn-info:active,.show>.btn-info.dropdown-toggle{color:#000;background-color:#3dd5f3;border-color:#25cff2}.btn-info.disabled,.btn-info:disabled{color:#000;background-color:#0dcaf0;border-color:#0dcaf0}.btn-warning{color:#000;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#000;background-color:#ffca2c;border-color:#ffc720}.btn-check:focus+.btn-warning,.btn-warning:focus{color:#000;background-color:#ffca2c;border-color:#ffc720;box-shadow:0 0 0 .25rem rgba(217,164,6,.5)}.btn-check:active+.btn-warning,.btn-check:checked+.btn-warning,.btn-warning.active,.btn-warning:active,.show>.btn-warning.dropdown-toggle{color:#000;background-color:#ffcd39;border-color:#ffc720}.btn-check:active+.btn-warning:focus,.btn-check:checked+.btn-warning:focus,.btn-warning.active:focus,.btn-warning:active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(217,164,6,.5)}.btn-check:active+.btn-danger:focus,.btn-check:checked+.btn-danger:focus,.btn-check:focus+.btn-danger,.btn-danger.active:focus,.btn-danger:active:focus,.btn-danger:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(225,83,97,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#000;background-color:#ffc107;border-color:#ffc107}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-check:focus+.btn-danger,.btn-danger:focus,.btn-danger:hover{background-color:#bb2d3b;border-color:#b02a37;color:#fff}.btn-check:active+.btn-danger,.btn-check:checked+.btn-danger,.btn-danger.active,.btn-danger:active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#b02a37;border-color:#a52834}.btn-check:active+.btn-light:focus,.btn-check:checked+.btn-light:focus,.btn-check:focus+.btn-light,.btn-light.active:focus,.btn-light:active:focus,.btn-light:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(211,212,213,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-light{color:#000;background-color:#f8f9fa;border-color:#f8f9fa}.btn-check:active+.btn-light,.btn-check:checked+.btn-light,.btn-check:focus+.btn-light,.btn-light.active,.btn-light:active,.btn-light:focus,.btn-light:hover,.show>.btn-light.dropdown-toggle{background-color:#f9fafb;border-color:#f9fafb;color:#000}.btn-check:active+.btn-dark:focus,.btn-check:checked+.btn-dark:focus,.btn-check:focus+.btn-dark,.btn-dark.active:focus,.btn-dark:active:focus,.btn-dark:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .25rem rgba(66,70,73,.5)}.btn-light.disabled,.btn-light:disabled{color:#000;background-color:#f8f9fa;border-color:#f8f9fa}.btn-dark{color:#fff;background-color:#212529;border-color:#212529}.btn-check:focus+.btn-dark,.btn-dark:focus,.btn-dark:hover{background-color:#1c1f23;border-color:#1a1e21;color:#fff}.btn-check:active+.btn-dark,.btn-check:checked+.btn-dark,.btn-dark.active,.btn-dark:active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1a1e21;border-color:#191c1f}.btn-check:active+.btn-outline-primary:focus,.btn-check:checked+.btn-outline-primary:focus,.btn-check:focus+.btn-outline-primary,.btn-outline-primary.active:focus,.btn-outline-primary.dropdown-toggle.show:focus,.btn-outline-primary:active:focus,.btn-outline-primary:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#212529;border-color:#212529}.btn-outline-primary{color:#0d6efd;border-color:#0d6efd}.btn-check:active+.btn-outline-primary,.btn-check:checked+.btn-outline-primary,.btn-outline-primary.active,.btn-outline-primary.dropdown-toggle.show,.btn-outline-primary:active,.btn-outline-primary:hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd}.btn-check:active+.btn-outline-secondary:focus,.btn-check:checked+.btn-outline-secondary:focus,.btn-check:focus+.btn-outline-secondary,.btn-outline-secondary.active:focus,.btn-outline-secondary.dropdown-toggle.show:focus,.btn-outline-secondary:active:focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .25rem rgba(108,117,125,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#0d6efd;background-color:transparent}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-check:active+.btn-outline-secondary,.btn-check:checked+.btn-outline-secondary,.btn-outline-secondary.active,.btn-outline-secondary.dropdown-toggle.show,.btn-outline-secondary:active,.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-check:active+.btn-outline-success:focus,.btn-check:checked+.btn-outline-success:focus,.btn-check:focus+.btn-outline-success,.btn-outline-success.active:focus,.btn-outline-success.dropdown-toggle.show:focus,.btn-outline-success:active:focus,.btn-outline-success:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-success{color:#198754;border-color:#198754}.btn-check:active+.btn-outline-success,.btn-check:checked+.btn-outline-success,.btn-outline-success.active,.btn-outline-success.dropdown-toggle.show,.btn-outline-success:active,.btn-outline-success:hover{color:#fff;background-color:#198754;border-color:#198754}.btn-check:active+.btn-outline-info:focus,.btn-check:checked+.btn-outline-info:focus,.btn-check:focus+.btn-outline-info,.btn-outline-info.active:focus,.btn-outline-info.dropdown-toggle.show:focus,.btn-outline-info:active:focus,.btn-outline-info:focus{box-shadow:0 0 0 .25rem rgba(13,202,240,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#198754;background-color:transparent}.btn-outline-info{color:#0dcaf0;border-color:#0dcaf0}.btn-check:active+.btn-outline-info,.btn-check:checked+.btn-outline-info,.btn-outline-info.active,.btn-outline-info.dropdown-toggle.show,.btn-outline-info:active,.btn-outline-info:hover{color:#000;background-color:#0dcaf0;border-color:#0dcaf0}.btn-check:active+.btn-outline-warning:focus,.btn-check:checked+.btn-outline-warning:focus,.btn-check:focus+.btn-outline-warning,.btn-outline-warning.active:focus,.btn-outline-warning.dropdown-toggle.show:focus,.btn-outline-warning:active:focus,.btn-outline-warning:focus{box-shadow:0 0 0 .25rem rgba(255,193,7,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#0dcaf0;background-color:transparent}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-check:active+.btn-outline-warning,.btn-check:checked+.btn-outline-warning,.btn-outline-warning.active,.btn-outline-warning.dropdown-toggle.show,.btn-outline-warning:active,.btn-outline-warning:hover{color:#000;background-color:#ffc107;border-color:#ffc107}.btn-check:active+.btn-outline-danger:focus,.btn-check:checked+.btn-outline-danger:focus,.btn-check:focus+.btn-outline-danger,.btn-outline-danger.active:focus,.btn-outline-danger.dropdown-toggle.show:focus,.btn-outline-danger:active:focus,.btn-outline-danger:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-check:active+.btn-outline-danger,.btn-check:checked+.btn-outline-danger,.btn-outline-danger.active,.btn-outline-danger.dropdown-toggle.show,.btn-outline-danger:active,.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-check:active+.btn-outline-light:focus,.btn-check:checked+.btn-outline-light:focus,.btn-check:focus+.btn-outline-light,.btn-outline-light.active:focus,.btn-outline-light.dropdown-toggle.show:focus,.btn-outline-light:active:focus,.btn-outline-light:focus{box-shadow:0 0 0 .25rem rgba(248,249,250,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-check:active+.btn-outline-light,.btn-check:checked+.btn-outline-light,.btn-outline-light.active,.btn-outline-light.dropdown-toggle.show,.btn-outline-light:active,.btn-outline-light:hover{color:#000;background-color:#f8f9fa;border-color:#f8f9fa}.btn-check:active+.btn-outline-dark:focus,.btn-check:checked+.btn-outline-dark:focus,.btn-check:focus+.btn-outline-dark,.btn-outline-dark.active:focus,.btn-outline-dark.dropdown-toggle.show:focus,.btn-outline-dark:active:focus,.btn-outline-dark:focus{box-shadow:0 0 0 .25rem rgba(33,37,41,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-dark{color:#212529;border-color:#212529}.btn-check:active+.btn-outline-dark,.btn-check:checked+.btn-outline-dark,.btn-outline-dark.active,.btn-outline-dark.dropdown-toggle.show,.btn-outline-dark:active,.btn-outline-dark:hover{color:#fff;background-color:#212529;border-color:#212529}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#212529;background-color:transparent}.btn-link{color:#0d6efd;text-decoration:underline}.card-link:hover,.dropdown-item,.nav-link,.navbar-brand,.navbar-toggler:focus,.navbar-toggler:hover,.page-link{text-decoration:none}.btn-link:hover{color:#0a58ca}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropend,.dropstart,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;margin-left:.255em;border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;z-index:1000;display:none;min-width:10rem;padding:.5rem 0;margin:0;font-size:1rem;color:#212529;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu[data-bs-popper]{left:0;margin-top:.125rem}.dropdown-menu-start{--bs-position:start}.dropdown-menu-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-end{--bs-position:end}.dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-start{--bs-position:start}.dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-sm-end{--bs-position:end}.dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-start{--bs-position:start}.dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-md-end{--bs-position:end}.dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-start{--bs-position:start}.dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-lg-end{--bs-position:end}.dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-start{--bs-position:start}.dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xl-end{--bs-position:end}.dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1400px){.dropdown-menu-xxl-start{--bs-position:start}.dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xxl-end{--bs-position:end}.dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%}.dropup .dropdown-menu[data-bs-popper]{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropend .dropdown-toggle::after,.dropstart .dropdown-toggle::before{border-top:.3em solid transparent;border-bottom:.3em solid transparent;content:""}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-menu{top:0;right:auto;left:100%}.dropend .dropdown-menu[data-bs-popper]{margin-top:0;margin-left:.125rem}.dropend .dropdown-toggle::after{display:inline-block;margin-left:.255em;border-right:0;border-left:.3em solid;vertical-align:0}.dropend .dropdown-toggle:empty::after{margin-left:0}.dropstart .dropdown-menu{top:0;right:100%;left:auto}.dropstart .dropdown-menu[data-bs-popper]{margin-top:0;margin-right:.125rem}.dropstart .dropdown-toggle::after{margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropstart .dropdown-toggle::before{display:inline-block;margin-right:.255em;border-right:.3em solid;vertical-align:0}.dropstart .dropdown-toggle:empty::after{margin-left:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid rgba(0,0,0,.15)}.dropdown-item{display:block;width:100%;padding:.25rem 1rem;clear:both;color:#212529;text-align:inherit;background-color:transparent;border:0}.alert-link,.badge{font-weight:700}.dropdown-menu-dark,.dropdown-menu-dark .dropdown-divider{border-color:rgba(0,0,0,.15)}.dropdown-item:focus,.dropdown-item:hover{color:#1e2125;background-color:#e9ecef}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#0d6efd}.dropdown-item.disabled,.dropdown-item:disabled{color:#adb5bd;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1rem;margin-bottom:0;font-size:.875rem;color:#6c757d}.dropdown-item-text{display:block;padding:.25rem 1rem;color:#212529}.dropdown-menu-dark{color:#dee2e6;background-color:#343a40}.dropdown-menu-dark .dropdown-item{color:#dee2e6}.dropdown-menu-dark .dropdown-item:focus,.dropdown-menu-dark .dropdown-item:hover{color:#fff;background-color:rgba(255,255,255,.15)}.dropdown-menu-dark .dropdown-item.active,.dropdown-menu-dark .dropdown-item:active{color:#fff;background-color:#0d6efd}.dropdown-menu-dark .dropdown-item.disabled,.dropdown-menu-dark .dropdown-item:disabled{color:#adb5bd}.dropdown-menu-dark .dropdown-item-text{color:#dee2e6}.dropdown-menu-dark .dropdown-header{color:#adb5bd}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn-check:checked+.btn,.btn-group-vertical>.btn-check:focus+.btn,.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn-check:checked+.btn,.btn-group>.btn-check:focus+.btn,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.card>hr,.dropdown-toggle-split::after,.dropend .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:nth-child(n+3),.btn-group>:not(.btn-check)+.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropstart .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn~.btn{border-top-left-radius:0;border-top-right-radius:0}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0}.nav-link{display:block;padding:.5rem 1rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion:reduce){.nav-link{transition:none}}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-link{margin-bottom:-1px;background:0 0;border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6;isolation:isolate}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{background:0 0;border:0;border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#0d6efd}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem}.navbar>.container,.navbar>.container-fluid,.navbar>.container-lg,.navbar>.container-md,.navbar>.container-sm,.navbar>.container-xl,.navbar>.container-xxl{display:flex;flex-wrap:inherit;align-items:center;justify-content:space-between}.navbar-brand{padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem;transition:box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-toggler:focus{outline:0;box-shadow:0 0 0 .25rem}.accordion-button:focus,.btn-close:focus,.page-link:focus{box-shadow:0 0 0 .25rem rgba(13,110,253,.25);outline:0}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height,75vh);overflow-y:auto}@media (min-width:576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (min-width:768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (min-width:992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (min-width:1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media (min-width:1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.card,.progress-bar{flex-direction:column}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.55)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.55);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.55)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.55)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.55);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.55)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:flex;min-width:0;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:1rem}.card-footer,.card-header{padding:.5rem 1rem;background-color:rgba(0,0,0,.03)}.card-title{margin-bottom:.5rem}.accordion-header,.card-header,.card-subtitle,.card-text:last-child{margin-bottom:0}.card-subtitle{margin-top:-.25rem}.card-link+.card-link{margin-left:1rem}.card-header-pills,.card-header-tabs{margin-right:-.5rem;margin-left:-.5rem}.card-header{border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.5rem;border-bottom:0}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(.25rem - 1px)}.accordion-button,.alert,.btn .badge,.page-link{position:relative}.accordion-body,.accordion-button{padding:1rem 1.25rem}.card-img,.card-img-bottom,.card-img-top{width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-group>.card{margin-bottom:.75rem}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.accordion-button{display:flex;align-items:center;width:100%;font-size:1rem;color:#212529;text-align:left;background-color:transparent;border:1px solid rgba(0,0,0,.125);border-radius:0;overflow-anchor:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,border-radius .15s ease}.badge,.progress-bar{text-align:center;white-space:nowrap}.modal-open,.progress,.progress-bar{overflow:hidden}@media (prefers-reduced-motion:reduce){.accordion-button{transition:none}}.accordion-button.collapsed{border-bottom-width:0}.accordion-button:not(.collapsed){color:#0c63e4;background-color:#e7f1ff}.accordion-button:not(.collapsed)::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230c63e4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");transform:rotate(180deg)}.accordion-button::after{flex-shrink:0;width:1.25rem;height:1.25rem;margin-left:auto;content:"";background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-size:1.25rem;transition:transform .2s ease-in-out}@media (prefers-reduced-motion:reduce){.accordion-button::after{transition:none}}.accordion-button:hover{z-index:2}.accordion-button:focus{z-index:3;border-color:#86b7fe}.alert,.breadcrumb{margin-bottom:1rem}.accordion-item:first-of-type .accordion-button{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.accordion-item:last-of-type .accordion-button.collapsed,.accordion-item:last-of-type .accordion-collapse{border-bottom-width:1px;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.accordion-collapse{border:solid rgba(0,0,0,.125);border-width:0 1px}.accordion-flush .accordion-button{border-right:0;border-left:0;border-radius:0}.accordion-flush .accordion-collapse{border-width:0}.accordion-flush .accordion-item:first-of-type .accordion-button{border-top-width:0;border-top-left-radius:0;border-top-right-radius:0}.accordion-flush .accordion-item:last-of-type .accordion-button.collapsed{border-bottom-width:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.breadcrumb{display:flex;flex-wrap:wrap;padding:0}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{float:left;padding-right:.5rem;color:#6c757d;content:var(--bs-breadcrumb-divider,"/")}.breadcrumb-item.active{color:#6c757d}.pagination{display:flex;padding-left:0}.page-link{display:block;color:#0d6efd;background-color:#fff;border:1px solid #dee2e6;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;padding:.375rem .75rem}.page-link:focus,.page-link:hover{color:#0a58ca;background-color:#e9ecef}@media (prefers-reduced-motion:reduce){.page-link{transition:none}}.page-link:hover{z-index:2;border-color:#dee2e6}.page-link:focus{z-index:3}.page-item:not(:first-child) .page-link{margin-left:-1px}.page-item.active .page-link{z-index:3;color:#fff;background-color:#0d6efd;border-color:#0d6efd}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;background-color:#fff;border-color:#dee2e6}.page-item:first-child .page-link{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.35em .65em;font-size:.75em;line-height:1;color:#fff;border-radius:.25rem}.badge:empty{display:none}.btn .badge{top:-1px}.alert{padding:1rem;border:1px solid transparent;border-radius:.25rem}.list-group,.progress{display:flex;border-radius:.25rem}.alert-heading{color:inherit}.alert-dismissible{padding-right:3rem}.alert-dismissible .btn-close{position:absolute;top:0;right:0;z-index:2;padding:1.25rem 1rem}.alert-primary{color:#084298;background-color:#cfe2ff;border-color:#b6d4fe}.alert-primary .alert-link{color:#06357a}.alert-secondary{color:#41464b;background-color:#e2e3e5;border-color:#d3d6d8}.alert-secondary .alert-link{color:#34383c}.alert-success{color:#0f5132;background-color:#d1e7dd;border-color:#badbcc}.alert-success .alert-link{color:#0c4128}.alert-info{color:#055160;background-color:#cff4fc;border-color:#b6effb}.alert-info .alert-link{color:#04414d}.alert-warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5}.alert-warning .alert-link{color:#523e02}.alert-danger{color:#842029;background-color:#f8d7da;border-color:#f5c2c7}.alert-danger .alert-link{color:#6a1a21}.alert-light{color:#636464;background-color:#fefefe;border-color:#fdfdfe}.alert-light .alert-link{color:#4f5050}.alert-dark{color:#141619;background-color:#d3d3d4;border-color:#bcbebf}.alert-dark .alert-link{color:#101214}@-webkit-keyframes progress-bar-stripes{0%{background-position-x:1rem}}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{height:1rem;font-size:.75rem;background-color:#e9ecef}.progress-bar{display:flex;justify-content:center;color:#fff;background-color:#0d6efd;transition:width .6s ease}.popover,.tooltip{font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;text-decoration:none}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:1s linear infinite progress-bar-stripes;animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}.progress-bar-animated{-webkit-animation:none;animation:none}}.list-group{flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.5rem 1rem;text-decoration:none;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#0d6efd;border-color:#0d6efd}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1400px){.list-group-horizontal-xxl{flex-direction:row}.list-group-horizontal-xxl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xxl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xxl>.list-group-item.active{margin-top:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#084298;background-color:#cfe2ff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#084298;background-color:#bacbe6}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#084298;border-color:#084298}.list-group-item-secondary{color:#41464b;background-color:#e2e3e5}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#41464b;background-color:#cbccce}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#41464b;border-color:#41464b}.list-group-item-success{color:#0f5132;background-color:#d1e7dd}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#0f5132;background-color:#bcd0c7}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#0f5132;border-color:#0f5132}.list-group-item-info{color:#055160;background-color:#cff4fc}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#055160;background-color:#badce3}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#055160;border-color:#055160}.list-group-item-warning{color:#664d03;background-color:#fff3cd}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#664d03;background-color:#e6dbb9}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#664d03;border-color:#664d03}.list-group-item-danger{color:#842029;background-color:#f8d7da}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#842029;background-color:#dfc2c4}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#842029;border-color:#842029}.list-group-item-light{color:#636464;background-color:#fefefe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#636464;background-color:#e5e5e5}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#636464;border-color:#636464}.list-group-item-dark{color:#141619;background-color:#d3d3d4}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#141619;background-color:#bebebf}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#141619;border-color:#141619}.btn-close{box-sizing:content-box;width:1em;height:1em;padding:.25em;color:#000;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;border:0;border-radius:.25rem;opacity:.5}.toast,.toast-header{background-color:rgba(255,255,255,.85)}.modal-content,.popover,.toast,.toast-header{background-clip:padding-box}.btn-close:hover{color:#000;text-decoration:none;opacity:.75}.btn-close:focus{opacity:1}.btn-close.disabled,.btn-close:disabled{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:.25}.modal-backdrop.fade,.toast:not(.showing):not(.show){opacity:0}.btn-close-white{filter:invert(1) grayscale(100%) brightness(200%)}.toast{width:350px;max-width:100%;font-size:.875rem;pointer-events:auto;border:1px solid rgba(0,0,0,.1);box-shadow:0 .5rem 1rem rgba(0,0,0,.15);border-radius:.25rem}.toast.hide{display:none}.toast-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:100%;pointer-events:none}.toast-container>:not(:last-child){margin-bottom:.75rem}.toast-header{display:flex;align-items:center;padding:.5rem .75rem;color:#6c757d;border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-header .btn-close{margin-right:-.375rem;margin-left:.75rem}.toast-body{padding:.75rem;word-wrap:break-word}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .btn-close{padding:.5rem;margin:-.5rem -.5rem -.5rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;flex-shrink:0;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{height:calc(100% - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.modal-fullscreen{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen .modal-footer,.modal-fullscreen .modal-header{border-radius:0}.modal-fullscreen .modal-body{overflow-y:auto}@media (max-width:575.98px){.modal-fullscreen-sm-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-sm-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-sm-down .modal-footer,.modal-fullscreen-sm-down .modal-header{border-radius:0}.modal-fullscreen-sm-down .modal-body{overflow-y:auto}}@media (max-width:767.98px){.modal-fullscreen-md-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-md-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-md-down .modal-footer,.modal-fullscreen-md-down .modal-header{border-radius:0}.modal-fullscreen-md-down .modal-body{overflow-y:auto}}@media (max-width:991.98px){.modal-fullscreen-lg-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-lg-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-lg-down .modal-footer,.modal-fullscreen-lg-down .modal-header{border-radius:0}.modal-fullscreen-lg-down .modal-body{overflow-y:auto}}@media (max-width:1199.98px){.modal-fullscreen-xl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xl-down .modal-footer,.modal-fullscreen-xl-down .modal-header{border-radius:0}.modal-fullscreen-xl-down .modal-body{overflow-y:auto}}@media (max-width:1399.98px){.modal-fullscreen-xxl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xxl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xxl-down .modal-footer,.modal-fullscreen-xxl-down .modal-header{border-radius:0}.modal-fullscreen-xxl-down .modal-body{overflow-y:auto}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;text-align:left;text-align:start;opacity:0}.tooltip.show{opacity:.9}.tooltip .tooltip-arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .tooltip-arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[data-popper-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow,.bs-tooltip-top .tooltip-arrow{bottom:0}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,.bs-tooltip-top .tooltip-arrow::before{top:-1px;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[data-popper-placement^=right],.bs-tooltip-end{padding:0 .4rem}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow,.bs-tooltip-end .tooltip-arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before,.bs-tooltip-end .tooltip-arrow::before{right:-1px;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[data-popper-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.bs-tooltip-bottom .tooltip-arrow{top:0}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before,.bs-tooltip-bottom .tooltip-arrow::before{bottom:-1px;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[data-popper-placement^=left],.bs-tooltip-start{padding:0 .4rem}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.bs-tooltip-start .tooltip-arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before,.bs-tooltip-start .tooltip-arrow::before{left:-1px;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;text-align:left;text-align:start;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .popover-arrow{position:absolute;display:block;width:1rem;height:.5rem}.popover .popover-arrow::after,.popover .popover-arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow,.bs-popover-top>.popover-arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after,.bs-popover-top>.popover-arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow,.bs-popover-end>.popover-arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after,.bs-popover-end>.popover-arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow,.bs-popover-bottom>.popover-arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::before{top:0;border-width:0 .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after,.bs-popover-bottom>.popover-arrow::after{top:1px;border-width:0 .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[data-popper-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f0f0f0}.carousel,.carousel-inner,.carousel-item{position:relative}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow,.bs-popover-start>.popover-arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after,.bs-popover-start>.popover-arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem 1rem;margin-bottom:0;font-size:1rem;background-color:#f0f0f0;border-bottom:1px solid #d8d8d8;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:1rem;color:#212529}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-end,.carousel-item-next:not(.carousel-item-start){transform:translateX(100%)}.active.carousel-item-start,.carousel-item-prev:not(.carousel-item-end){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:0 0;border:0;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:2rem;height:2rem;background-repeat:no-repeat;background-position:50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;justify-content:center;padding:0;margin-right:15%;margin-bottom:1rem;margin-left:15%}.spinner-border,.spinner-grow{display:inline-block;vertical-align:text-bottom}.carousel-indicators [data-bs-target]{box-sizing:content-box;flex:0 1 auto;width:30px;height:3px;padding:0;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border:0;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:1.25rem;left:15%;padding-top:1.25rem;padding-bottom:1.25rem;color:#fff;text-align:center}.carousel-dark .carousel-control-next-icon,.carousel-dark .carousel-control-prev-icon{filter:invert(1) grayscale(100)}.carousel-dark .carousel-indicators [data-bs-target]{background-color:#000}.carousel-dark .carousel-caption{color:#000}@-webkit-keyframes spinner-border{to{transform:rotate(360deg)}}@keyframes spinner-border{to{transform:rotate(360deg)}}.spinner-border{width:2rem;height:2rem;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:.75s linear infinite spinner-border;animation:.75s linear infinite spinner-border}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{width:2rem;height:2rem;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:.75s linear infinite spinner-grow;animation:.75s linear infinite spinner-grow}.clearfix::after,.ratio::before{display:block;content:""}.spinner-grow-sm{width:1rem;height:1rem}@media (prefers-reduced-motion:reduce){.carousel-indicators [data-bs-target]{transition:none}.spinner-border,.spinner-grow{-webkit-animation-duration:1.5s;animation-duration:1.5s}}.clearfix::after{clear:both}.link-primary{color:#0d6efd}.link-primary:focus,.link-primary:hover{color:#0a58ca}.link-secondary{color:#6c757d}.link-secondary:focus,.link-secondary:hover{color:#565e64}.link-success{color:#198754}.link-success:focus,.link-success:hover{color:#146c43}.link-info{color:#0dcaf0}.link-info:focus,.link-info:hover{color:#3dd5f3}.link-warning{color:#ffc107}.link-warning:focus,.link-warning:hover{color:#ffcd39}.link-danger{color:#dc3545}.link-danger:focus,.link-danger:hover{color:#b02a37}.link-light{color:#f8f9fa}.link-light:focus,.link-light:hover{color:#f9fafb}.link-dark{color:#212529}.link-dark:focus,.link-dark:hover{color:#1a1e21}.ratio{position:relative;width:100%}.ratio::before{padding-top:var(--bs-aspect-ratio)}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.fixed-bottom,.fixed-top{position:fixed;z-index:1030;right:0;left:0}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:calc(3 / 4 * 100%)}.ratio-16x9{--bs-aspect-ratio:calc(9 / 16 * 100%)}.ratio-21x9{--bs-aspect-ratio:calc(9 / 21 * 100%)}.fixed-top{top:0}.fixed-bottom{bottom:0}.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}@media (min-width:576px){.sticky-sm-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:768px){.sticky-md-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:992px){.sticky-lg-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:1200px){.sticky-xl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}@media (min-width:1400px){.sticky-xxl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translateX(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:1px solid #dee2e6!important}.border-0{border:0!important}.border-top{border-top:1px solid #dee2e6!important}.border-top-0{border-top:0!important}.border-end{border-right:1px solid #dee2e6!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:1px solid #dee2e6!important}.border-start-0{border-left:0!important}.border-primary{border-color:#0d6efd!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#198754!important}.border-info{border-color:#0dcaf0!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#212529!important}.border-white{border-color:#fff!important}.border-0{border-width:0!important}.border-1{border-width:1px!important}.border-2{border-width:2px!important}.border-3{border-width:3px!important}.border-4{border-width:4px!important}.border-5{border-width:5px!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.img-container>img,.img-preview>img{max-width:100%}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-right:0!important;margin-left:0!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-right:0!important;padding-left:0!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-light{font-weight:300!important}.fw-lighter{font-weight:lighter!important}.fw-normal{font-weight:400!important}.fw-bold{font-weight:700!important}.fw-bolder{font-weight:bolder!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-primary{color:#0d6efd!important}.text-secondary{color:#6c757d!important}.text-success{color:#198754!important}.text-info{color:#0dcaf0!important}.text-warning{color:#ffc107!important}.text-danger{color:#dc3545!important}.text-light{color:#f8f9fa!important}.text-dark{color:#212529!important}.text-white{color:#fff!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-reset{color:inherit!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.bg-primary{background-color:#0d6efd!important}.bg-secondary{background-color:#6c757d!important}.bg-success{background-color:#198754!important}.bg-info{background-color:#0dcaf0!important}.bg-warning{background-color:#ffc107!important}.bg-danger{background-color:#dc3545!important}.bg-light{background-color:#f8f9fa!important}.bg-dark{background-color:#212529!important}.bg-body,.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.bg-gradient{background-image:var(--bs-gradient)!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:.25rem!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:.2rem!important}.rounded-2{border-radius:.25rem!important}.rounded-3{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-end,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-end{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-start{border-bottom-left-radius:.25rem!important}.rounded-start,.rounded-top{border-top-left-radius:.25rem!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media (min-width:576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-right:0!important;padding-left:0!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media (min-width:1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-right:0!important;margin-left:0!important}.mx-xxl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xxl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xxl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xxl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xxl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xxl-auto{margin-right:auto!important;margin-left:auto!important}.my-xxl-0{margin-top:0!important;margin-bottom:0!important}.my-xxl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xxl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xxl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xxl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xxl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xxl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-right:0!important;padding-left:0!important}.px-xxl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xxl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xxl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xxl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xxl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xxl-0{padding-top:0!important;padding-bottom:0!important}.py-xxl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xxl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xxl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xxl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xxl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}}.img-container,.img-preview{background-color:#f7f7f7;text-align:center;width:100%}.img-container{margin-bottom:1rem;max-height:497px;min-height:200px}.docs-data>.input-group,.docs-toggles>.btn,.docs-toggles>.btn-group,.docs-toggles>.dropdown,.img-preview{margin-bottom:.5rem}@media (min-width:768px){.img-container{min-height:497px}}.docs-preview{margin-right:-1rem}.img-preview{float:left;margin-right:.5rem;overflow:hidden}.preview-lg{height:9rem;width:16rem}.preview-md{height:4.5rem;width:8rem}.preview-sm{height:2.25rem;width:4rem}.preview-xs{height:1.125rem;margin-right:0;width:2rem}.docs-data>.input-group>label{justify-content:center;min-width:5rem}.docs-data>.input-group>span{justify-content:center;min-width:3rem}.docs-buttons>.btn,.docs-buttons>.btn-group,.docs-buttons>.form-control{margin-bottom:.5rem;margin-right:.25rem}.custom-file-val{position:absolute;bottom:0}.sw-content{width:100%!important}input[type=date]::-webkit-inner-spin-button{display:none}.ace_razor{background-color:#ff0}.ace_punctuation.ace_block.ace_razor,.ace_punctuation.ace_short.ace_razor{color:#000}.loader-container{top:0;left:0;width:100%;height:100%;position:fixed;background-color:#041323;opacity:.2;z-index:9999}#loader,.cm-fat-cursor div.CodeMirror-cursors{z-index:1}#loader{position:absolute;left:50%;top:50%;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #3498db;width:120px;height:120px;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@media screen and (max-width:580px){.hide-on-mb{display:none}}#modal-files img{height:30px}#modal-files img.preview{width:100%;height:auto}@media screen and (min-width:580px){.hide-on-desktop{display:none}}.bootstrap-tagsinput,.cm-tab,.fa-stack,.now-ui-icons{display:inline-block}@media screen and (max-width:991px){.navbar .navbar-nav{min-height:unset}}@font-face{font-family:'Nucleo Outline';src:url(../fonts/nucleo-outline.eot);src:url(../fonts/nucleo-outline.eot) format("embedded-opentype"),url(../fonts/nucleo-outline.woff2) format("woff2"),url(../fonts/nucleo-outline.woff) format("woff"),url(../fonts/nucleo-outline.ttf) format("truetype"),url(../fonts/nucleo-outline.svg) format("svg");font-weight:400;font-style:normal}.now-ui-icons{font:normal normal normal 14px/1 'Nucleo Outline';font-size:inherit;speak:none;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.now-ui-icons.circle{padding:.33333333em;vertical-align:-16%;background-color:#eee;border-radius:50%}.nc-icon-ul{padding-left:0;margin-left:2.14285714em}.nc-icon-ul>li{position:relative}.nc-icon-ul>li>.now-ui-icons{position:absolute;left:-1.57142857em;top:.14285714em;text-align:center}.nc-icon-ul>li>.now-ui-icons.circle{top:-.19047619em;left:-1.9047619em}.now-ui-icons.spin{-webkit-animation:nc-icon-spin 2s infinite linear;-moz-animation:nc-icon-spin 2s infinite linear;animation:nc-icon-spin 2s infinite linear}@-webkit-keyframes nc-icon-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes nc-icon-spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(360deg)}}@keyframes nc-icon-spin{0%{-webkit-transform:rotate(0);-moz-transform:rotate(0);-ms-transform:rotate(0);-o-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-ms-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.now-ui-icons.ui-1_check:before{content:"\ea22"}.now-ui-icons.ui-1_email-85:before{content:"\ea2a"}.now-ui-icons.arrows-1_cloud-download-93:before{content:"\ea21"}.now-ui-icons.arrows-1_cloud-upload-94:before{content:"\ea24"}.now-ui-icons.arrows-1_minimal-down:before{content:"\ea39"}.now-ui-icons.arrows-1_minimal-left:before{content:"\ea3a"}.now-ui-icons.arrows-1_minimal-right:before{content:"\ea3b"}.now-ui-icons.arrows-1_minimal-up:before{content:"\ea3c"}.now-ui-icons.arrows-1_refresh-69:before{content:"\ea44"}.now-ui-icons.arrows-1_share-66:before{content:"\ea4c"}.now-ui-icons.business_badge:before{content:"\ea09"}.now-ui-icons.business_bank:before{content:"\ea0a"}.now-ui-icons.business_briefcase-24:before{content:"\ea13"}.now-ui-icons.business_bulb-63:before{content:"\ea15"}.now-ui-icons.business_chart-bar-32:before{content:"\ea1e"}.now-ui-icons.business_chart-pie-36:before{content:"\ea1f"}.now-ui-icons.business_globe:before{content:"\ea2f"}.now-ui-icons.business_money-coins:before{content:"\ea40"}.now-ui-icons.clothes_tie-bow:before{content:"\ea5b"}.now-ui-icons.design_vector:before{content:"\ea61"}.now-ui-icons.design_app:before{content:"\ea08"}.now-ui-icons.design_bullet-list-67:before{content:"\ea14"}.now-ui-icons.design_image:before{content:"\ea33"}.now-ui-icons.design_palette:before{content:"\ea41"}.now-ui-icons.design_scissors:before{content:"\ea4a"}.now-ui-icons.design-2_html5:before{content:"\ea32"}.now-ui-icons.design-2_ruler-pencil:before{content:"\ea48"}.now-ui-icons.emoticons_satisfied:before{content:"\ea49"}.now-ui-icons.files_box:before{content:"\ea12"}.now-ui-icons.files_paper:before{content:"\ea43"}.now-ui-icons.files_single-copy-04:before{content:"\ea52"}.now-ui-icons.health_ambulance:before{content:"\ea07"}.now-ui-icons.loader_gear:before{content:"\ea4e"}.now-ui-icons.loader_refresh:before{content:"\ea44"}.now-ui-icons.location_bookmark:before{content:"\ea10"}.now-ui-icons.location_compass-05:before{content:"\ea25"}.now-ui-icons.location_map-big:before{content:"\ea3d"}.now-ui-icons.location_pin:before{content:"\ea47"}.now-ui-icons.location_world:before{content:"\ea63"}.now-ui-icons.media-1_album:before{content:"\ea02"}.now-ui-icons.media-1_button-pause:before{content:"\ea16"}.now-ui-icons.media-1_button-play:before{content:"\ea18"}.now-ui-icons.media-1_button-power:before{content:"\ea19"}.now-ui-icons.media-1_camera-compact:before{content:"\ea1c"}.now-ui-icons.media-2_note-03:before{content:"\ea3f"}.now-ui-icons.media-2_sound-wave:before{content:"\ea57"}.now-ui-icons.objects_diamond:before{content:"\ea29"}.now-ui-icons.objects_globe:before{content:"\ea2f"}.now-ui-icons.objects_key-25:before{content:"\ea38"}.now-ui-icons.objects_planet:before{content:"\ea46"}.now-ui-icons.objects_spaceship:before{content:"\ea55"}.now-ui-icons.objects_support-17:before{content:"\ea56"}.now-ui-icons.objects_umbrella-13:before{content:"\ea5f"}.now-ui-icons.education_agenda-bookmark:before{content:"\ea01"}.now-ui-icons.education_atom:before{content:"\ea0c"}.now-ui-icons.education_glasses:before{content:"\ea2d"}.now-ui-icons.education_hat:before{content:"\ea30"}.now-ui-icons.education_paper:before{content:"\ea42"}.now-ui-icons.shopping_bag-16:before{content:"\ea0d"}.now-ui-icons.shopping_basket:before{content:"\ea0b"}.now-ui-icons.shopping_box:before{content:"\ea11"}.now-ui-icons.shopping_cart-simple:before{content:"\ea1d"}.now-ui-icons.shopping_credit-card:before{content:"\ea28"}.now-ui-icons.shopping_delivery-fast:before{content:"\ea27"}.now-ui-icons.shopping_shop:before{content:"\ea50"}.now-ui-icons.shopping_tag-content:before{content:"\ea59"}.now-ui-icons.sport_trophy:before{content:"\ea5d"}.now-ui-icons.sport_user-run:before{content:"\ea60"}.now-ui-icons.tech_controller-modern:before{content:"\ea26"}.now-ui-icons.tech_headphones:before{content:"\ea31"}.now-ui-icons.tech_laptop:before{content:"\ea36"}.now-ui-icons.tech_mobile:before{content:"\ea3e"}.now-ui-icons.tech_tablet:before{content:"\ea58"}.now-ui-icons.tech_tv:before{content:"\ea5e"}.now-ui-icons.tech_watch-time:before{content:"\ea62"}.now-ui-icons.text_align-center:before{content:"\ea05"}.now-ui-icons.text_align-left:before{content:"\ea06"}.now-ui-icons.text_bold:before{content:"\ea0e"}.now-ui-icons.text_caps-small:before{content:"\ea1b"}.now-ui-icons.gestures_tap-01:before{content:"\ea5a"}.now-ui-icons.transportation_air-baloon:before{content:"\ea03"}.now-ui-icons.transportation_bus-front-12:before{content:"\ea17"}.now-ui-icons.travel_info:before{content:"\ea04"}.now-ui-icons.travel_istanbul:before{content:"\ea34"}.now-ui-icons.ui-1_bell-53:before{content:"\ea0f"}.now-ui-icons.ui-1_calendar-60:before{content:"\ea1a"}.now-ui-icons.ui-1_lock-circle-open:before{content:"\ea35"}.now-ui-icons.ui-1_send:before{content:"\ea4d"}.now-ui-icons.ui-1_settings-gear-63:before{content:"\ea4e"}.now-ui-icons.ui-1_simple-add:before{content:"\ea4f"}.now-ui-icons.ui-1_simple-delete:before{content:"\ea54"}.now-ui-icons.ui-1_simple-remove:before{content:"\ea53"}.now-ui-icons.ui-1_zoom-bold:before{content:"\ea64"}.now-ui-icons.ui-2_chat-round:before{content:"\ea20"}.now-ui-icons.ui-2_favourite-28:before{content:"\ea2b"}.now-ui-icons.ui-2_like:before{content:"\ea37"}.now-ui-icons.ui-2_settings-90:before{content:"\ea4b"}.now-ui-icons.ui-2_time-alarm:before{content:"\ea5c"}.now-ui-icons.users_circle-08:before{content:"\ea23"}.now-ui-icons.users_single-02:before{content:"\ea51"}.bootstrap-tagsinput{background-color:#fff;border:1px solid #ccc;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);padding:4px 6px;color:#555;vertical-align:middle;border-radius:4px;max-width:100%;line-height:22px;cursor:text}.bootstrap-tagsinput input,.bootstrap-tagsinput input:focus{border:none;box-shadow:none}.bootstrap-tagsinput input{outline:0;background-color:transparent;padding:0 6px;margin:0;width:auto;max-width:inherit}.bootstrap-tagsinput.form-control input::-moz-placeholder{color:#777;opacity:1}.bootstrap-tagsinput.form-control input:-ms-input-placeholder{color:#777}.bootstrap-tagsinput.form-control input::-webkit-input-placeholder{color:#777}.bootstrap-tagsinput .tag{margin-right:2px;color:#fff}.bootstrap-tagsinput .tag [data-role=remove]{margin-left:8px;cursor:pointer}.bootstrap-tagsinput .tag [data-role=remove]:after{content:"x";padding:0 2px}.bootstrap-tagsinput .tag [data-role=remove]:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.bootstrap-tagsinput .tag [data-role=remove]:hover:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}/*! - * Font Awesome Free 5.12.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.cm-em,.hljs-emphasis,.tui-editor-contents address,.tui-editor-contents cite,.tui-editor-contents dfn,.tui-editor-contents em,.tui-editor-contents i,.tui-editor-contents var{font-style:italic}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.CodeMirror pre,.fa-stack-1x{line-height:inherit}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-bahai:before{content:"\f666"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-alt:before{content:"\f422"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\f952"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-alt:before{content:"\f424"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\f907"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-ideal:before{content:"\f913"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-instagram-square:before{content:"\f955"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microblog:before{content:"\f91a"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\f956"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-square:before{content:"\f91e"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopify:before{content:"\f957"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\f941"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\f949"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.fab,.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}.CodeMirror{height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.hljs{display:block;overflow-x:auto;padding:.5em;color:#333;background:#f8f8f8}.hljs-comment,.hljs-quote{color:#998;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#333;font-weight:700}.hljs-literal,.hljs-number,.hljs-tag .hljs-attr,.hljs-template-variable,.hljs-variable{color:teal}.hljs-doctag,.hljs-string{color:#d14}.hljs-section,.hljs-selector-id,.hljs-title{color:#900;font-weight:700}.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-type{color:#458;font-weight:700}.hljs-attribute,.hljs-name,.hljs-tag{color:navy;font-weight:400}.hljs-meta,.hljs-strong,.tui-editor-contents h1,.tui-editor-contents h2,.tui-editor-contents h3,.tui-editor-contents h5,.tui-editor-contents strong{font-weight:700}.hljs-link,.hljs-regexp{color:#009926}.hljs-bullet,.hljs-symbol{color:#990073}.hljs-built_in,.hljs-builtin-name{color:#0086b3}.hljs-meta{color:#999}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.CodeMirror{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.tui-editor-contents :not(table){line-height:160%;box-sizing:content-box}.tui-editor-contents p{margin:10px 0;color:#555}.tui-editor-contents>div>div:first-of-type h1,.tui-editor-contents>h1:first-of-type{margin-top:14px}.tui-editor-contents h1{font-size:1.6rem;line-height:28px;border-bottom:3px double #999;margin:52px 0 15px;padding-bottom:7px;color:#000}.tui-editor-contents h2{font-size:1.3rem;line-height:23px;border-bottom:1px solid #dbdbdb;margin:30px 0 13px;padding-bottom:7px;color:#333}.tui-editor-contents h3,.tui-editor-contents h4{font-size:1.2rem;line-height:18px;margin:20px 0 2px;color:#333}.tui-editor-contents h5,.tui-editor-contents h6{font-size:1rem;line-height:17px;margin:10px 0 -4px;color:#333}.tui-editor-contents blockquote{margin:15px 0;border-left:4px solid #ddd;padding:0 15px;color:#777}.tui-editor-contents blockquote>:first-child{margin-top:0}.tui-editor-contents blockquote>:last-child{margin-bottom:0}.tui-editor-contents code,.tui-editor-contents pre{font-family:Consolas,Courier,"Apple SD 산돌고딕 Neo",-apple-system,"Lucida Grande","Apple SD Gothic Neo","맑은 고딕","Malgun Gothic","Segoe UI","돋움",dotum,sans-serif;border:0;border-radius:0}.te-input-language input,.te-ww-block-overlay.code-block-header,.tui-editor-defaultUI{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.tui-editor-contents pre{margin:2px 0 8px;padding:18px;background-color:#f5f7f8}.tui-editor-contents code{color:#c1788b;padding:4px 4px 2px 0;letter-spacing:-.3px}.tui-editor-contents pre code{padding:0;color:inherit;white-space:pre-wrap;background-color:transparent}.tui-editor-contents pre.addon{border:1px solid #e8ebed;background-color:#fff}.tui-editor-contents img{margin:4px 0 10px;box-sizing:border-box;vertical-align:top;max-width:100%}.tui-editor-contents table{margin:2px 0 14px;color:#555;width:auto;border-collapse:collapse;box-sizing:border-box}.tui-editor-contents table td,.tui-editor-contents table th{height:32px;padding:5px 14px 5px 12px}.tui-editor-contents table td{border:1px solid #eaeaea}.tui-editor-contents table th{border:1px solid #72777b;border-top:0;background-color:#7b8184;font-weight:300;color:#fff;padding-top:6px}.tui-editor-contents dir,.tui-editor-contents menu,.tui-editor-contents ol,.tui-editor-contents ul{display:block;list-style-type:disc;padding-left:17px;margin:6px 0 10px;color:#555}.tui-editor-contents ol{list-style-type:decimal}.tui-editor-contents ol ol,.tui-editor-contents ol ul,.tui-editor-contents ul ol,.tui-editor-contents ul ul{margin-top:0!important;margin-bottom:0!important}.tui-editor-contents ol li,.tui-editor-contents ul li{position:relative}.tui-editor-contents ul p,ol p{margin:0}.tui-editor-contents ol li.task-list-item:before,.tui-editor-contents pre ul li:before,.tui-editor-contents ul li.task-list-item:before{content:""}.tui-editor-contents hr{border-top:1px solid #eee;margin:16px 0}.tui-editor-contents a{text-decoration:underline;color:#5286bc}.tui-editor-contents a:hover{color:#007cff}.tui-editor-contents{font-size:13px;margin:0;padding:0}.tui-editor-contents .task-list-item{border:0;list-style:none;padding-left:22px;margin-left:-22px}.tui-editor-contents .task-list-item:before{background-repeat:no-repeat;background-size:16px 16px;background-position:center;content:"";height:18px;width:18px;position:absolute;left:0;top:1px;cursor:pointer;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAADdJREFUKBVjvHv37n8GMgALSI+SkhJJWu/du8fARJIOJMWjGpECA505GjjoIYLEB6dVUNojFQAA/1MJUFWet/4AAAAASUVORK5CYII=)}.tui-editor-contents .task-list-item.checked:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMpJREFUKBVjjJ/64D8DGYCJDD1gLbTVyM3OxJDiJMzAxcYIdyALnIWDAdJU7i/OICfCxsDMxMgwc88bwk5F1vTs/W+GFUffwY2H+1FBlI2hLliCQYCbGSyJrqlzwwuGj9//YWoMtRBgUBJnZ6gMEGeQFWaFOw9kE7omkG5GWDyCPF7mJ86gIMbO8P//fwZGRkYGXJpAGuFO/fbrP0PXppcMD179JKgJRSOIA9N8/NZXrM4DqYEBjOgAaYYFOUwRNhruVGyS+MTI1ggAx8NTGcUtFVQAAAAASUVORK5CYII=)}.tui-editor-contents .task-list-item .task-list-item-checkbox,.tui-editor-contents .task-list-item input[type=checkbox]{margin-left:-17px;margin-right:3.8px;margin-top:3px}.tui-editor-contents-placeholder:before{content:attr(data-placeholder);color:grey;line-height:160%;position:absolute}.auto-height,.auto-height .tui-editor-defaultUI{height:auto}.auto-height .tui-editor{position:relative}:not(.auto-height)>.tui-editor-defaultUI,:not(.auto-height)>.tui-editor-defaultUI>.te-editor-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:not(.auto-height)>.tui-editor-defaultUI>.te-editor-section{-ms-flex:1;flex:1}.tui-editor-defaultUI-toolbar:after,.tui-editor:after{content:"";display:block;height:0;clear:both}.tui-editor{position:absolute;line-height:1;color:#181818;width:100%;height:inherit}.te-editor-section{min-height:0;position:relative;height:inherit}.te-md-container{display:none;overflow:hidden;height:100%}.te-md-container .te-editor{line-height:1.5}.te-md-container .te-editor,.te-md-container .te-preview{box-sizing:border-box;padding:0;height:inherit}.te-md-container .CodeMirror{font-size:13px;height:inherit}.te-md-container .te-preview{overflow:auto;padding:0 25px;height:100%}.te-md-container .te-preview>p:first-child{margin-top:0!important}.te-md-container .te-preview .tui-editor-contents{padding-top:11px}.tui-editor .te-preview-style-tab>.te-editor,.tui-editor .te-preview-style-tab>.te-preview{float:left;width:100%;display:none}.tui-editor .te-preview-style-tab>.te-tab-active{display:block}.tui-editor .te-preview-style-vertical>.te-tab-section{display:none}.tui-editor .te-preview-style-tab>.te-tab-section{display:block}.tui-editor .te-preview-style-vertical .te-editor,.tui-editor .te-preview-style-vertical .te-preview{float:left;width:50%}.tui-editor .te-md-splitter{display:none;position:absolute;left:50%;top:0;height:100%;width:1px;border-left:1px solid #e5e5e5}.tui-editor .te-preview-style-vertical .te-md-splitter{display:block}.te-ww-container{display:none;overflow:hidden;z-index:10;height:inherit;background-color:#fff}.te-ww-container>.te-editor{overflow:auto;height:inherit}.te-ww-container .tui-editor-contents:focus{outline:0}.te-ww-container .tui-editor-contents{padding:0 25px}.te-ww-container .tui-editor-contents:first-child{box-sizing:border-box;margin:0;padding:16px 25px 0;height:inherit}.te-ww-container .tui-editor-contents:last-child{margin-bottom:16px}.te-md-mode .te-md-container,.te-ww-mode .te-ww-container{display:block;z-index:100}.tui-editor-defaultUI.te-hide,.tui-editor.te-hide{display:none}.tui-editor-defaultUI .CodeMirror-lines{padding-top:13px;padding-bottom:13px}.tui-editor-defaultUI .CodeMirror-line{padding-left:25px;padding-right:25px}.tui-editor-defaultUI .CodeMirror pre.CodeMirror-placeholder{padding-left:25px;color:grey}.tui-editor-defaultUI .CodeMirror-scroll{cursor:text}.tui-editor-contents td.te-cell-selected{background-color:#d8dfec}.tui-editor-contents td.te-cell-selected::selection{background-color:#d8dfec}.tui-editor-contents th.te-cell-selected{background-color:#908f8f}.tui-editor-contents th.te-cell-selected::selection{background-color:#908f8f}.tui-editor-defaultUI{position:relative;border:1px solid #e5e5e5;height:100%}.tui-editor-defaultUI button{color:#fff;padding:0 14px 0 15px;height:28px;font-size:12px;border:none;cursor:pointer;outline:0}.tui-editor-defaultUI button.te-ok-button{background-color:#4b96e6}.tui-editor-defaultUI button.te-close-button{background-color:#777}.tui-editor-defaultUI-toolbar{padding:0 25px;height:31px;background-color:#fff;border:0;overflow:hidden}.tui-toolbar-divider{float:left;display:inline-block;width:1px;height:14px;background-color:#ddd;margin:9px 6px}.tui-toolbar-button-group{height:28px;border-right:1px solid #d9d9d9;float:left}.te-toolbar-section{height:32px;box-sizing:border-box;border-bottom:1px solid #e5e5e5}.tui-editor-defaultUI-toolbar button{float:left;box-sizing:border-box;outline:0;cursor:pointer;background-color:#fff;width:22px;height:22px;padding:3px;border-radius:0;margin:5px 3px;border:1px solid #fff}.tui-editor-defaultUI-toolbar button.active,.tui-editor-defaultUI-toolbar button:active,.tui-editor-defaultUI-toolbar button:hover{border:1px solid #aaa;background-color:#fff}.tui-editor-defaultUI-toolbar button:first-child{margin-left:0}.tui-editor-defaultUI-toolbar button:last-child{margin-right:0}.tui-editor-defaultUI-toolbar button.tui-scrollsync{width:auto;color:#777;border:0}.tui-editor-defaultUI button.tui-scrollsync:after{content:"Scroll off"}.tui-editor-defaultUI button.tui-scrollsync.active{color:#125de6;font-weight:700}.tui-editor-defaultUI button.tui-scrollsync.active:after{content:"Scroll on"}.tui-editor-defaultUI .te-mode-switch-section{background-color:#f9f9f9;border-top:1px solid #e5e5e5;height:20px;font-size:12px}.tui-editor-defaultUI .te-mode-switch{float:right;height:100%}.tui-editor-defaultUI .te-switch-button{width:92px;height:inherit;background:#e5e5e5;outline:0;color:#a0aabf;cursor:pointer;border:0;border-left:1px solid #ddd;border-right:1px solid #ddd}.tui-editor-defaultUI .te-switch-button.active{background-color:#fff;color:#000}.tui-editor-defaultUI .te-markdown-tab-section{float:left;height:31px;background:#fff}.te-markdown-tab-section .te-tab{margin:0 -7px 0 24px;background:#fff}.tui-editor-defaultUI .te-tab button{box-sizing:border-box;line-height:100%;position:relative;cursor:pointer;z-index:1;font-size:13px;background-color:#f9f9f9;border:1px solid #e5e5e5;border-top:0;padding:0 9px;color:#777;border-radius:0;outline:0}.te-markdown-tab-section .te-tab button:last-child{margin-left:-1px}.te-markdown-tab-section .te-tab button.te-tab-active,.te-markdown-tab-section .te-tab button:hover.te-tab-active{background-color:#fff;color:#333;border-bottom:1px solid #fff;z-index:2}.te-markdown-tab-section .te-tab button:hover{background-color:#fff;color:#333}.tui-popup-modal-background{background-color:rgba(202,202,202,.6);position:fixed;margin:0;left:0;top:0;width:100%;height:100%;z-index:9999}.tui-popup-modal-background.fit-window .tui-popup-wrapper,.tui-popup-wrapper.fit-window{width:100%;height:100%}.tui-popup-wrapper{width:500px;margin-right:auto;border:1px solid #cacaca;background:#fff;z-index:9999}.tui-popup-modal-background .tui-popup-wrapper{position:absolute;margin:auto;top:0;right:0;bottom:0;left:0}.tui-popup-header{padding:10px;height:auto;line-height:normal;position:relative;border-bottom:1px solid #cacaca}.tui-popup-header .tui-popup-header-buttons{float:right}.tui-popup-header .tui-popup-header-buttons button{padding:0;background-color:transparent;background-size:cover;float:left}.tui-popup-header .tui-popup-close-button{margin:3px;width:13px;height:13px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMHB4IiBoZWlnaHQ9IjEwcHgiIHZpZXdCb3g9IjAgMCAxMCAxMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5GMjc2Qzc4MC0zM0JBLTQ3MTItQTM3OC04RkQwQUNDOTFDRTk8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImxuYi1mb2xkZXItZGVsIiBmaWxsLXJ1bGU9Im5vbnplcm8iIGZpbGw9IiM3Nzc3NzciPiAgICAgICAgICAgIDxwYXRoIGQ9Ik01LDMuNTg1Nzg2NDQgTDEuNzA3MTA2NzgsMC4yOTI4OTMyMTkgTDAuMjkyODkzMjE5LDEuNzA3MTA2NzggTDMuNTg1Nzg2NDQsNSBMMC4yOTI4OTMyMTksOC4yOTI4OTMyMiBMMS43MDcxMDY3OCw5LjcwNzEwNjc4IEw1LDYuNDE0MjEzNTYgTDguMjkyODkzMjIsOS43MDcxMDY3OCBMOS43MDcxMDY3OCw4LjI5Mjg5MzIyIEw2LjQxNDIxMzU2LDUgTDkuNzA3MTA2NzgsMS43MDcxMDY3OCBMOC4yOTI4OTMyMiwwLjI5Mjg5MzIxOSBMNSwzLjU4NTc4NjQ0IFoiIGlkPSJDb21iaW5lZC1TaGFwZSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+)}.tui-popup-header .tui-popup-title{font-size:13px;font-weight:700;color:#333;vertical-align:bottom}.tui-popup-body{padding:15px;font-size:12px}.tui-editor-popup{position:absolute;top:30px;left:50%;margin-left:-250px}.tui-editor-popup.tui-popup-modal-background{position:fixed;top:0;left:0;margin:0}.tui-editor-popup .tui-popup-body label{font-weight:700;color:#666;display:block;margin:10px 0 5px}.tui-editor-popup .tui-popup-body .te-button-section{margin-top:15px}.tui-editor-popup .tui-popup-body input[type=file],.tui-editor-popup .tui-popup-body input[type=text]{padding:4px 10px;border:1px solid #bfbfbf;box-sizing:border-box;width:100%}.tui-editor-popup .tui-popup-body input.wrong{border-color:red}.te-popup-add-link .tui-popup-wrapper{height:219px}.te-popup-add-image .tui-popup-wrapper{height:243px}.te-popup-add-image .te-tab{display:block;background:0 0;border-bottom:1px solid #ebebeb;margin-bottom:8px}.te-popup-add-image .te-file-type,.te-popup-add-image .te-url-type{display:none}.te-popup-add-image div.te-tab-active,.te-popup-add-image form.te-tab-active{display:block}.te-dropdown-toolbar .tui-toolbar-divider,.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-toggle-slider{display:none}.te-popup-add-image .te-tab button{border:1px solid #ccc;background:#eee;min-width:100px;margin-left:-1px;border-bottom:0;border-radius:3px 3px 0 0}.te-popup-add-image .te-tab button.te-tab-active{background:#fff}.te-popup-add-table .te-table-selection{position:relative}.te-popup-add-table .te-table-body{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAARCAYAAAAougcOAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAOklEQVQ4EWO8e/fuPwYGBkYgphlgAZmspKREMwtABjPR1HSo4aOWkBTKo8E1GlwkhQBJikdT1wgNLgAMSwQgckFvTgAAAABJRU5ErkJggg==)}.te-popup-add-table .te-table-header{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAARCAYAAAAougcOAAAC7mlDQ1BJQ0MgUHJvZmlsZQAAeAGFVM9rE0EU/jZuqdAiCFprDrJ4kCJJWatoRdQ2/RFiawzbH7ZFkGQzSdZuNuvuJrWliOTi0SreRe2hB/+AHnrwZC9KhVpFKN6rKGKhFy3xzW5MtqXqwM5+8943731vdt8ADXLSNPWABOQNx1KiEWlsfEJq/IgAjqIJQTQlVdvsTiQGQYNz+Xvn2HoPgVtWw3v7d7J3rZrStpoHhP1A4Eea2Sqw7xdxClkSAog836Epx3QI3+PY8uyPOU55eMG1Dys9xFkifEA1Lc5/TbhTzSXTQINIOJT1cVI+nNeLlNcdB2luZsbIEL1PkKa7zO6rYqGcTvYOkL2d9H5Os94+wiHCCxmtP0a4jZ71jNU/4mHhpObEhj0cGDX0+GAVtxqp+DXCFF8QTSeiVHHZLg3xmK79VvJKgnCQOMpkYYBzWkhP10xu+LqHBX0m1xOv4ndWUeF5jxNn3tTd70XaAq8wDh0MGgyaDUhQEEUEYZiwUECGPBoxNLJyPyOrBhuTezJ1JGq7dGJEsUF7Ntw9t1Gk3Tz+KCJxlEO1CJL8Qf4qr8lP5Xn5y1yw2Fb3lK2bmrry4DvF5Zm5Gh7X08jjc01efJXUdpNXR5aseXq8muwaP+xXlzHmgjWPxHOw+/EtX5XMlymMFMXjVfPqS4R1WjE3359sfzs94i7PLrXWc62JizdWm5dn/WpI++6qvJPmVflPXvXx/GfNxGPiKTEmdornIYmXxS7xkthLqwviYG3HCJ2VhinSbZH6JNVgYJq89S9dP1t4vUZ/DPVRlBnM0lSJ93/CKmQ0nbkOb/qP28f8F+T3iuefKAIvbODImbptU3HvEKFlpW5zrgIXv9F98LZua6N+OPwEWDyrFq1SNZ8gvAEcdod6HugpmNOWls05Uocsn5O66cpiUsxQ20NSUtcl12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAOklEQVQ4EWO8e/fuPwYGBkYgphlgAZksLCxMMwtABjPR1HSo4aOWkBTKo8E1GlwkhQBJikdT1wgNLgDxKwPzTeWPdAAAAABJRU5ErkJggg==)}.te-popup-add-table .te-selection-area{position:absolute;top:0;left:0;background:#80d2ff;opacity:.3;z-index:999}.te-popup-add-table .te-description{margin:10px 0 0;text-align:center}.te-popup-table-utils{width:120px}.te-popup-table-utils .tui-popup-body{padding:0}.te-popup-table-utils button{width:100%;background-color:#fff;border:none;outline:0;padding:0 10px;font-size:12px;line-height:28px;text-align:left;color:#777}.te-popup-table-utils button:hover{background-color:#f4f4f4}.te-popup-table-utils hr{background-color:#cacaca;border-style:none;height:1px}.te-heading-add{width:auto}.te-heading-add .tui-popup-body{padding:0}.te-heading-add h1,.te-heading-add h2,.te-heading-add h3,.te-heading-add h4,.te-heading-add h5,.te-heading-add h6,.te-heading-add p,.te-heading-add ul{padding:0;margin:0}.te-heading-add ul li{padding:2px 10px;cursor:pointer}.te-dropdown-toolbar .tui-popup-body,.tui-popup-color{padding:0}.te-heading-add ul li:hover{background-color:#eee}.te-heading-add h1{font-size:24px}.te-heading-add h2{font-size:22px}.te-heading-add h3{font-size:20px}.te-heading-add h4{font-size:18px}.te-heading-add h5{font-size:16px}.te-heading-add h6{font-size:14px}.te-dropdown-toolbar{position:absolute;width:auto}.tui-popup-color .tui-colorpicker-container,.tui-popup-color .tui-colorpicker-palette-container{width:144px}.tui-popup-color .tui-colorpicker-container ul{width:144px;margin-bottom:8px}.tui-popup-color .tui-colorpicker-container li{padding:0 1px 1px 0}.tui-popup-color .tui-colorpicker-container li .tui-colorpicker-palette-button{border:0;width:17px;height:17px}.tui-popup-color .tui-popup-body{padding:10px}.tui-popup-color .te-apply-button,.tui-popup-color .tui-colorpicker-palette-hex{float:right}.tui-popup-color .te-apply-button{height:21px;width:35px;background:#fff;border:1px solid #efefef;position:absolute;bottom:141px;right:10px}.tui-tooltip,.tui-tooltip .arrow{background-color:#222;position:absolute}.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-hex{border:1px solid #E1E1E1;padding:3px 14px;margin-left:-1px}.tui-popup-color .tui-colorpicker-container div.tui-colorpicker-clearfix{display:inline-block}.tui-popup-color .tui-colorpicker-container .tui-colorpicker-palette-preview{width:19px;height:19px}.tui-popup-color .tui-colorpicker-slider-container .tui-colorpicker-slider-right{width:22px}.tui-popup-color .tui-colorpicker-slider-container .tui-colorpicker-huebar-handle{display:none}.tui-tooltip{z-index:999;opacity:.8;color:#fff;padding:2px 5px;font-size:10px}.tui-tooltip .arrow{content:"";display:inline-block;width:10px;height:10px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);top:-3px;left:6px;z-index:-1}.tui-toolbar-icons{background:url(tui-editor.png);background-size:218px 188px;display:inline-block}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.tui-toolbar-icons{background:url(tui-editor-2x.png);background-size:218px 188px;display:inline-block}}.tui-toolbar-icons.tui-heading{background-position:-172px -48px}.tui-toolbar-icons.tui-heading:disabled{background-position:-193px -48px}.tui-toolbar-icons.tui-bold{background-position:-4px -4px}.tui-toolbar-icons.tui-bold:disabled{background-position:-25px -4px}.tui-toolbar-icons.tui-italic{background-position:-4px -48px}.tui-toolbar-icons.tui-italic:disabled{background-position:-25px -48px}.tui-toolbar-icons.tui-color{background-position:-172px -70px}.tui-toolbar-icons.tui-color:disabled{background-position:-193px -70px}.tui-toolbar-icons.tui-strike{background-position:-4px -26px}.tui-toolbar-icons.tui-strike:disabled{background-position:-25px -26px}.tui-toolbar-icons.tui-hrline{background-position:-46px -92px}.tui-toolbar-icons.tui-hrline:disabled{background-position:-67px -92px}.tui-toolbar-icons.tui-quote{background-position:-4px -114px}.tui-toolbar-icons.tui-quote:disabled{background-position:-25px -114px}.tui-toolbar-icons.tui-ul{background-position:-46px -4px}.tui-toolbar-icons.tui-ul:disabled{background-position:-67px -4px}.tui-toolbar-icons.tui-ol{background-position:-46px -26px}.tui-toolbar-icons.tui-ol:disabled{background-position:-67px -26px}.tui-toolbar-icons.tui-task{background-position:-130px -48px}.tui-toolbar-icons.tui-task:disabled{background-position:-151px -48px}.tui-toolbar-icons.tui-indent{background-position:-46px -48px}.tui-toolbar-icons.tui-indent:disabled{background-position:-67px -48px}.tui-toolbar-icons.tui-outdent{background-position:-46px -70px}.tui-toolbar-icons.tui-outdent:disabled{background-position:-67px -70px}.tui-toolbar-icons.tui-table{background-position:-88px -92px}.tui-toolbar-icons.tui-table:disabled{background-position:-109px -92px}.tui-toolbar-icons.tui-image{background-position:-130px -4px}.tui-toolbar-icons.tui-image:disabled{background-position:-151px -4px}.tui-toolbar-icons.tui-link{background-position:-130px -26px}.tui-toolbar-icons.tui-link:disabled{background-position:-151px -26px}.tui-toolbar-icons.tui-code{background-position:-130px -92px}.tui-toolbar-icons.tui-code:disabled{background-position:-151px -92px}.tui-toolbar-icons.tui-codeblock{background-position:-130px -70px}.tui-toolbar-icons.tui-codeblock:disabled{background-position:-151px -70px}.tui-toolbar-icons.tui-more{background-position:-172px -92px}.tui-toolbar-icons.tui-more:disabled{background-position:-193px -92px}.tui-colorpicker-svg-huebar,.tui-colorpicker-svg-slider,.tui-colorpicker-vml-slider{border:1px solid #ebebeb}.CodeMirror-sizer{margin-top:6px}.CodeMirror .cm-header{font-weight:700;color:inherit}.CodeMirror .cm-header-1{font-size:24px}.CodeMirror .cm-header-2{font-size:22px}.CodeMirror .cm-header-3{font-size:20px}.CodeMirror .cm-header-4{font-size:18px}.CodeMirror .cm-header-5{font-size:16px}.CodeMirror .cm-header-6{font-size:14px}.CodeMirror .cm-variable-2{color:inherit}.tui-editor-pseudo-clipboard{position:fixed;left:-1000px;top:-1000px;width:100px;height:100px}.te-ww-block-overlay.code-block-header{text-align:right}.te-ww-block-overlay.code-block-header span{font-size:10px;font-weight:600;padding:0 10px;color:#333;cursor:default}.te-ww-block-overlay.code-block-header button{margin:8px;font-size:10px;color:#333;background-color:#f9f9f9;border:1px solid #ddd;padding:4px;height:auto}.te-popup-code-block-languages{position:fixed;box-sizing:border-box;width:130px}.te-popup-code-block-languages .tui-popup-body{max-height:169px;overflow:auto;padding:0}.te-popup-code-block-languages button{width:100%;background-color:#fff;border:none;outline:0;padding:0 10px;font-size:12px;line-height:24px;text-align:left;color:#777}.te-popup-code-block-languages button.active{background-color:#f4f4f4}.tui-popup-code-block-editor .tui-popup-wrapper{width:70%;height:70%;margin:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.te-input-language{position:relative;margin-left:15px;cursor:pointer}.te-input-language input{font-size:10px;padding:3px 5px;border:1px solid #ddd;background-color:#f9f9f9;box-sizing:border-box;width:130px;outline:0}.te-input-language input::-ms-clear{display:none}.te-input-language::after{content:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMiAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT42Q0NBRDk2QS0yMjYxLTRFNDAtOTk1RC1DRUUyQUREQUQ3NkQ8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbS10cmFuZ2xlLWQtc2lkZSIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlJlY3RhbmdsZS03IiBwb2ludHM9IjIgNSAxMCA1IDYgMTAiPjwvcG9seWdvbj4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);position:absolute;top:1px;right:3px}.te-input-language.active::after{content:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMnB4IiBoZWlnaHQ9IjE0cHgiIHZpZXdCb3g9IjAgMCAxMiAxNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT5BNEZDRkIzMy0zNjdBLTREMjAtOEEyNC1DQ0I2ODFBMDZDODg8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbS10cmFuZ2xlLXVwLXNpZGUiIGZpbGw9IiM1NTU1NTUiPiAgICAgICAgICAgIDxwb2x5Z29uIGlkPSJSZWN0YW5nbGUtNyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNi4wMDAwMDAsIDYuNTAwMDAwKSBzY2FsZSgxLCAtMSkgdHJhbnNsYXRlKC02LjAwMDAwMCwgLTYuNTAwMDAwKSAiIHBvaW50cz0iMiA0IDEwIDQgNiA5Ij48L3BvbHlnb24+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=)}.tui-popup-code-block-editor button{margin:-1px 3px}.tui-popup-code-block-editor .tui-popup-header-buttons{height:20px}.tui-popup-code-block-editor .popup-editor-toggle-preview::after{content:'Preview off';color:#777;margin-right:22px}.tui-popup-code-block-editor .popup-editor-toggle-preview.active::after{content:'Preview on';color:#4b96e6}.tui-popup-code-block-editor .popup-editor-toggle-scroll::after{content:'Scroll off';color:#777;margin-right:16px}.tui-popup-code-block-editor .popup-editor-toggle-scroll.active::after{content:'Scroll on';color:#4b96e6}.tui-popup-code-block-editor .popup-editor-toggle-fit{width:18px;height:18px;margin-top:4px;margin-right:14px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT40OUQ4RTYyMy1GRTAyLTQ1RUUtQkQ5Ri0xMjUyQjEzRTU1MkQ8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbnRlbnRzLWV4cGFuZCIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBhdGggZD0iTTMsMyBMOSwzIEw5LDUgTDUsNSBMNSw5IEwzLDkgTDMsMyBaIE0xNSwxNSBMOSwxNSBMOSwxMyBMMTMsMTMgTDEzLDkgTDE1LDkgTDE1LDE1IFoiIGlkPSJDb21iaW5lZC1TaGFwZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOS4wMDAwMDAsIDkuMDAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC05LjAwMDAwMCwgLTkuMDAwMDAwKSAiPjwvcGF0aD4gICAgICAgICAgICA8cG9seWdvbiBpZD0iTGluZSIgZmlsbC1ydWxlPSJub256ZXJvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMS41MDAwMDAsIDYuNTAwMDAwKSBzY2FsZSgtMSwgMSkgdHJhbnNsYXRlKC0xMS41MDAwMDAsIC02LjUwMDAwMCkgIiBwb2ludHM9IjkuMDg1Nzg2NDQgNS41IDEyLjUgOC45MTQyMTM1NiAxMy45MTQyMTM2IDcuNSAxMC41IDQuMDg1Nzg2NDQiPjwvcG9seWdvbj4gICAgICAgICAgICA8cG9seWdvbiBpZD0iTGluZS1Db3B5IiBmaWxsLXJ1bGU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYuNTAwMDAwLCAxMS41MDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTYuNTAwMDAwLCAtMTEuNTAwMDAwKSAiIHBvaW50cz0iNC4wODU3ODY0NCAxMC41IDcuNSAxMy45MTQyMTM2IDguOTE0MjEzNTYgMTIuNSA1LjUgOS4wODU3ODY0NCI+PC9wb2x5Z29uPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+)}.tui-popup-code-block-editor .popup-editor-toggle-fit.active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4gICAgICAgIDx0aXRsZT4wN0Q1MjlCRi1GNTIzLTREN0EtQTlGNi05NTUzNTU5RDNEMUE8L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggc2tldGNodG9vbC48L2Rlc2M+ICAgIDxkZWZzPjwvZGVmcz4gICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImNvbnRlbnRzLXJlZHVjZSIgZmlsbD0iIzU1NTU1NSI+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgtMzIiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS41MDAwMDAsIDEyLjUwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtNS41MDAwMDAsIC0xMi41MDAwMDApICIgcG9pbnRzPSIzLjA4NTc4NjQ0IDExLjUgNi41IDE0LjkxNDIxMzYgNy45MTQyMTM1NiAxMy41IDQuNSAxMC4wODU3ODY0Ij48L3BvbHlnb24+ICAgICAgICAgICAgPHBhdGggZD0iTTksOSBMMTUsOSBMMTUsMTEgTDExLDExIEwxMSwxNSBMOSwxNSBMOSw5IFogTTksOSBMMyw5IEwzLDcgTDcsNyBMNywzIEw5LDMgTDksOSBaIiBpZD0iQ29tYmluZWQtU2hhcGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDkuMDAwMDAwLCA5LjAwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtOS4wMDAwMDAsIC05LjAwMDAwMCkgIj48L3BhdGg+ICAgICAgICAgICAgPHBvbHlnb24gaWQ9IlBhdGgtMzMiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTIuNTAwMDAwLCA1LjUwMDAwMCkgc2NhbGUoLTEsIDEpIHRyYW5zbGF0ZSgtMTIuNTAwMDAwLCAtNS41MDAwMDApICIgcG9pbnRzPSIxNC45MTQyMTM2IDYuNSAxMS41IDMuMDg1Nzg2NDQgMTAuMDg1Nzg2NCA0LjUgMTMuNSA3LjkxNDIxMzU2Ij48L3BvbHlnb24+ICAgICAgICA8L2c+ICAgIDwvZz48L3N2Zz4=)}.tui-popup-code-block-editor .tui-popup-close-button{margin-top:6px}.tui-popup-code-block-editor .tui-popup-body{z-index:-1;padding:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.tui-split-scroll.single-content .tui-split-content-right,.tui-split-scroll.single-content .tui-splitter,.tui-split-scroll.single-content button.tui-scrollsync{display:none}.tui-popup-code-block-editor .popup-editor-body{position:relative;-ms-flex:1;flex:1;border-bottom:1px solid #cacaca}.tui-popup-code-block-editor .te-button-section{padding:15px}.tui-popup-code-block-editor .te-button-section button{float:left}.tui-popup-code-block-editor .tui-editor-contents pre{margin:0;background-color:transparent}.tui-popup-code-block-editor .CodeMirror{height:auto}.tui-popup-code-block-editor .CodeMirror-line{font-family:Consolas,Courier,"Apple SD 산돌고딕 Neo",-apple-system,"Lucida Grande","Apple SD Gothic Neo","맑은 고딕","Malgun Gothic","Segoe UI","돋움",dotum,sans-serif;font-size:13px;line-height:160%;letter-spacing:-.3px}.tui-popup-code-block-editor .popup-editor-editor-wrapper{min-height:100%}.tui-split-scroll-wrapper{position:relative}.tui-split-scroll{position:absolute}.tui-split-scroll,.tui-split-scroll-wrapper{width:100%;height:100%}.tui-split-scroll .tui-split-content-left,.tui-split-scroll .tui-split-content-right{position:absolute;top:0;width:50%;box-sizing:border-box}.tui-split-scroll .tui-split-content-left{left:0}.tui-split-scroll .tui-split-content-right{left:50%}.tui-split-scroll .tui-splitter{position:absolute;left:50%;top:0;height:100%;width:1px;border-left:1px solid #cacaca}.tui-split-scroll .tui-split-scroll-content{width:100%;height:100%;overflow:hidden;position:relative}.tui-split-scroll .tui-split-content-left,.tui-split-scroll .tui-split-content-right{height:100%;overflow-x:hidden;overflow-y:auto}.tui-split-scroll button.tui-scrollsync{top:10px;opacity:.2}.tui-split-scroll button.tui-scrollsync::after{content:"scroll off"}.tui-split-scroll.scroll-sync button.tui-scrollsync{opacity:.5}.tui-split-scroll.scroll-sync .tui-split-content-left,.tui-split-scroll.scroll-sync .tui-split-content-right{height:auto;overflow:initial}.tui-split-scroll.scroll-sync button.tui-scrollsync::after{content:"scroll on"}.tui-split-scroll.scroll-sync .tui-split-scroll-content{overflow-y:auto}.tui-split-scroll.single-content .tui-split-content-left{width:100%}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.tui-split-scroll-wrapper .tui-splitter{left:calc(50% - 9px)}}@supports (-ms-accelerator:true){.tui-split-scroll-wrapper .tui-splitter{left:calc(50% - 9px)}}@media screen and (max-width:480px){.tui-popup-wrapper{max-width:300px}.tui-editor-popup{margin-left:-150px}.te-dropdown-toolbar{max-width:none}} \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/css/shared.min.css b/src/Mix.Cms.Web/wwwroot/mix-app/css/shared.min.css deleted file mode 100644 index 8e68d6cac..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/css/shared.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/* Wed Feb 24 2021 09:23:11 GMT+0700 (Indochina Time) */.flag-icon,.flag-icon-background{background-size:contain;background-position:50%;background-repeat:no-repeat}.fa,.fab,.fad,.fal,.far,.fas,.mi{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;text-rendering:auto}.fa-ul,.mi-ul{list-style-type:none}.fa-fw,.fa-li,.mi-fw,.mi-li,.mi-stack-1x,.mi-stack-2x{text-align:center}.fa-inverse,.mi-inverse{color:#fff}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon.flag-icon-squared{width:1em}.flag-icon-ad{background-image:url(../flags/4x3/ad.svg)}.flag-icon-ad.flag-icon-squared{background-image:url(../flags/1x1/ad.svg)}.flag-icon-ae{background-image:url(../flags/4x3/ae.svg)}.flag-icon-ae.flag-icon-squared{background-image:url(../flags/1x1/ae.svg)}.flag-icon-af{background-image:url(../flags/4x3/af.svg)}.flag-icon-af.flag-icon-squared{background-image:url(../flags/1x1/af.svg)}.flag-icon-ag{background-image:url(../flags/4x3/ag.svg)}.flag-icon-ag.flag-icon-squared{background-image:url(../flags/1x1/ag.svg)}.flag-icon-ai{background-image:url(../flags/4x3/ai.svg)}.flag-icon-ai.flag-icon-squared{background-image:url(../flags/1x1/ai.svg)}.flag-icon-al{background-image:url(../flags/4x3/al.svg)}.flag-icon-al.flag-icon-squared{background-image:url(../flags/1x1/al.svg)}.flag-icon-am{background-image:url(../flags/4x3/am.svg)}.flag-icon-am.flag-icon-squared{background-image:url(../flags/1x1/am.svg)}.flag-icon-ao{background-image:url(../flags/4x3/ao.svg)}.flag-icon-ao.flag-icon-squared{background-image:url(../flags/1x1/ao.svg)}.flag-icon-aq{background-image:url(../flags/4x3/aq.svg)}.flag-icon-aq.flag-icon-squared{background-image:url(../flags/1x1/aq.svg)}.flag-icon-ar{background-image:url(../flags/4x3/ar.svg)}.flag-icon-ar.flag-icon-squared{background-image:url(../flags/1x1/ar.svg)}.flag-icon-as{background-image:url(../flags/4x3/as.svg)}.flag-icon-as.flag-icon-squared{background-image:url(../flags/1x1/as.svg)}.flag-icon-at{background-image:url(../flags/4x3/at.svg)}.flag-icon-at.flag-icon-squared{background-image:url(../flags/1x1/at.svg)}.flag-icon-au{background-image:url(../flags/4x3/au.svg)}.flag-icon-au.flag-icon-squared{background-image:url(../flags/1x1/au.svg)}.flag-icon-aw{background-image:url(../flags/4x3/aw.svg)}.flag-icon-aw.flag-icon-squared{background-image:url(../flags/1x1/aw.svg)}.flag-icon-ax{background-image:url(../flags/4x3/ax.svg)}.flag-icon-ax.flag-icon-squared{background-image:url(../flags/1x1/ax.svg)}.flag-icon-az{background-image:url(../flags/4x3/az.svg)}.flag-icon-az.flag-icon-squared{background-image:url(../flags/1x1/az.svg)}.flag-icon-ba{background-image:url(../flags/4x3/ba.svg)}.flag-icon-ba.flag-icon-squared{background-image:url(../flags/1x1/ba.svg)}.flag-icon-bb{background-image:url(../flags/4x3/bb.svg)}.flag-icon-bb.flag-icon-squared{background-image:url(../flags/1x1/bb.svg)}.flag-icon-bd{background-image:url(../flags/4x3/bd.svg)}.flag-icon-bd.flag-icon-squared{background-image:url(../flags/1x1/bd.svg)}.flag-icon-be{background-image:url(../flags/4x3/be.svg)}.flag-icon-be.flag-icon-squared{background-image:url(../flags/1x1/be.svg)}.flag-icon-bf{background-image:url(../flags/4x3/bf.svg)}.flag-icon-bf.flag-icon-squared{background-image:url(../flags/1x1/bf.svg)}.flag-icon-bg{background-image:url(../flags/4x3/bg.svg)}.flag-icon-bg.flag-icon-squared{background-image:url(../flags/1x1/bg.svg)}.flag-icon-bh{background-image:url(../flags/4x3/bh.svg)}.flag-icon-bh.flag-icon-squared{background-image:url(../flags/1x1/bh.svg)}.flag-icon-bi{background-image:url(../flags/4x3/bi.svg)}.flag-icon-bi.flag-icon-squared{background-image:url(../flags/1x1/bi.svg)}.flag-icon-bj{background-image:url(../flags/4x3/bj.svg)}.flag-icon-bj.flag-icon-squared{background-image:url(../flags/1x1/bj.svg)}.flag-icon-bl{background-image:url(../flags/4x3/bl.svg)}.flag-icon-bl.flag-icon-squared{background-image:url(../flags/1x1/bl.svg)}.flag-icon-bm{background-image:url(../flags/4x3/bm.svg)}.flag-icon-bm.flag-icon-squared{background-image:url(../flags/1x1/bm.svg)}.flag-icon-bn{background-image:url(../flags/4x3/bn.svg)}.flag-icon-bn.flag-icon-squared{background-image:url(../flags/1x1/bn.svg)}.flag-icon-bo{background-image:url(../flags/4x3/bo.svg)}.flag-icon-bo.flag-icon-squared{background-image:url(../flags/1x1/bo.svg)}.flag-icon-bq{background-image:url(../flags/4x3/bq.svg)}.flag-icon-bq.flag-icon-squared{background-image:url(../flags/1x1/bq.svg)}.flag-icon-br{background-image:url(../flags/4x3/br.svg)}.flag-icon-br.flag-icon-squared{background-image:url(../flags/1x1/br.svg)}.flag-icon-bs{background-image:url(../flags/4x3/bs.svg)}.flag-icon-bs.flag-icon-squared{background-image:url(../flags/1x1/bs.svg)}.flag-icon-bt{background-image:url(../flags/4x3/bt.svg)}.flag-icon-bt.flag-icon-squared{background-image:url(../flags/1x1/bt.svg)}.flag-icon-bv{background-image:url(../flags/4x3/bv.svg)}.flag-icon-bv.flag-icon-squared{background-image:url(../flags/1x1/bv.svg)}.flag-icon-bw{background-image:url(../flags/4x3/bw.svg)}.flag-icon-bw.flag-icon-squared{background-image:url(../flags/1x1/bw.svg)}.flag-icon-by{background-image:url(../flags/4x3/by.svg)}.flag-icon-by.flag-icon-squared{background-image:url(../flags/1x1/by.svg)}.flag-icon-bz{background-image:url(../flags/4x3/bz.svg)}.flag-icon-bz.flag-icon-squared{background-image:url(../flags/1x1/bz.svg)}.flag-icon-ca{background-image:url(../flags/4x3/ca.svg)}.flag-icon-ca.flag-icon-squared{background-image:url(../flags/1x1/ca.svg)}.flag-icon-cc{background-image:url(../flags/4x3/cc.svg)}.flag-icon-cc.flag-icon-squared{background-image:url(../flags/1x1/cc.svg)}.flag-icon-cd{background-image:url(../flags/4x3/cd.svg)}.flag-icon-cd.flag-icon-squared{background-image:url(../flags/1x1/cd.svg)}.flag-icon-cf{background-image:url(../flags/4x3/cf.svg)}.flag-icon-cf.flag-icon-squared{background-image:url(../flags/1x1/cf.svg)}.flag-icon-cg{background-image:url(../flags/4x3/cg.svg)}.flag-icon-cg.flag-icon-squared{background-image:url(../flags/1x1/cg.svg)}.flag-icon-ch{background-image:url(../flags/4x3/ch.svg)}.flag-icon-ch.flag-icon-squared{background-image:url(../flags/1x1/ch.svg)}.flag-icon-ci{background-image:url(../flags/4x3/ci.svg)}.flag-icon-ci.flag-icon-squared{background-image:url(../flags/1x1/ci.svg)}.flag-icon-ck{background-image:url(../flags/4x3/ck.svg)}.flag-icon-ck.flag-icon-squared{background-image:url(../flags/1x1/ck.svg)}.flag-icon-cl{background-image:url(../flags/4x3/cl.svg)}.flag-icon-cl.flag-icon-squared{background-image:url(../flags/1x1/cl.svg)}.flag-icon-cm{background-image:url(../flags/4x3/cm.svg)}.flag-icon-cm.flag-icon-squared{background-image:url(../flags/1x1/cm.svg)}.flag-icon-cn{background-image:url(../flags/4x3/cn.svg)}.flag-icon-cn.flag-icon-squared{background-image:url(../flags/1x1/cn.svg)}.flag-icon-co{background-image:url(../flags/4x3/co.svg)}.flag-icon-co.flag-icon-squared{background-image:url(../flags/1x1/co.svg)}.flag-icon-cr{background-image:url(../flags/4x3/cr.svg)}.flag-icon-cr.flag-icon-squared{background-image:url(../flags/1x1/cr.svg)}.flag-icon-cu{background-image:url(../flags/4x3/cu.svg)}.flag-icon-cu.flag-icon-squared{background-image:url(../flags/1x1/cu.svg)}.flag-icon-cv{background-image:url(../flags/4x3/cv.svg)}.flag-icon-cv.flag-icon-squared{background-image:url(../flags/1x1/cv.svg)}.flag-icon-cw{background-image:url(../flags/4x3/cw.svg)}.flag-icon-cw.flag-icon-squared{background-image:url(../flags/1x1/cw.svg)}.flag-icon-cx{background-image:url(../flags/4x3/cx.svg)}.flag-icon-cx.flag-icon-squared{background-image:url(../flags/1x1/cx.svg)}.flag-icon-cy{background-image:url(../flags/4x3/cy.svg)}.flag-icon-cy.flag-icon-squared{background-image:url(../flags/1x1/cy.svg)}.flag-icon-cz{background-image:url(../flags/4x3/cz.svg)}.flag-icon-cz.flag-icon-squared{background-image:url(../flags/1x1/cz.svg)}.flag-icon-de{background-image:url(../flags/4x3/de.svg)}.flag-icon-de.flag-icon-squared{background-image:url(../flags/1x1/de.svg)}.flag-icon-dj{background-image:url(../flags/4x3/dj.svg)}.flag-icon-dj.flag-icon-squared{background-image:url(../flags/1x1/dj.svg)}.flag-icon-dk{background-image:url(../flags/4x3/dk.svg)}.flag-icon-dk.flag-icon-squared{background-image:url(../flags/1x1/dk.svg)}.flag-icon-dm{background-image:url(../flags/4x3/dm.svg)}.flag-icon-dm.flag-icon-squared{background-image:url(../flags/1x1/dm.svg)}.flag-icon-do{background-image:url(../flags/4x3/do.svg)}.flag-icon-do.flag-icon-squared{background-image:url(../flags/1x1/do.svg)}.flag-icon-dz{background-image:url(../flags/4x3/dz.svg)}.flag-icon-dz.flag-icon-squared{background-image:url(../flags/1x1/dz.svg)}.flag-icon-ec{background-image:url(../flags/4x3/ec.svg)}.flag-icon-ec.flag-icon-squared{background-image:url(../flags/1x1/ec.svg)}.flag-icon-ee{background-image:url(../flags/4x3/ee.svg)}.flag-icon-ee.flag-icon-squared{background-image:url(../flags/1x1/ee.svg)}.flag-icon-eg{background-image:url(../flags/4x3/eg.svg)}.flag-icon-eg.flag-icon-squared{background-image:url(../flags/1x1/eg.svg)}.flag-icon-eh{background-image:url(../flags/4x3/eh.svg)}.flag-icon-eh.flag-icon-squared{background-image:url(../flags/1x1/eh.svg)}.flag-icon-er{background-image:url(../flags/4x3/er.svg)}.flag-icon-er.flag-icon-squared{background-image:url(../flags/1x1/er.svg)}.flag-icon-es{background-image:url(../flags/4x3/es.svg)}.flag-icon-es.flag-icon-squared{background-image:url(../flags/1x1/es.svg)}.flag-icon-et{background-image:url(../flags/4x3/et.svg)}.flag-icon-et.flag-icon-squared{background-image:url(../flags/1x1/et.svg)}.flag-icon-fi{background-image:url(../flags/4x3/fi.svg)}.flag-icon-fi.flag-icon-squared{background-image:url(../flags/1x1/fi.svg)}.flag-icon-fj{background-image:url(../flags/4x3/fj.svg)}.flag-icon-fj.flag-icon-squared{background-image:url(../flags/1x1/fj.svg)}.flag-icon-fk{background-image:url(../flags/4x3/fk.svg)}.flag-icon-fk.flag-icon-squared{background-image:url(../flags/1x1/fk.svg)}.flag-icon-fm{background-image:url(../flags/4x3/fm.svg)}.flag-icon-fm.flag-icon-squared{background-image:url(../flags/1x1/fm.svg)}.flag-icon-fo{background-image:url(../flags/4x3/fo.svg)}.flag-icon-fo.flag-icon-squared{background-image:url(../flags/1x1/fo.svg)}.flag-icon-fr{background-image:url(../flags/4x3/fr.svg)}.flag-icon-fr.flag-icon-squared{background-image:url(../flags/1x1/fr.svg)}.flag-icon-ga{background-image:url(../flags/4x3/ga.svg)}.flag-icon-ga.flag-icon-squared{background-image:url(../flags/1x1/ga.svg)}.flag-icon-gb{background-image:url(../flags/4x3/gb.svg)}.flag-icon-gb.flag-icon-squared{background-image:url(../flags/1x1/gb.svg)}.flag-icon-gd{background-image:url(../flags/4x3/gd.svg)}.flag-icon-gd.flag-icon-squared{background-image:url(../flags/1x1/gd.svg)}.flag-icon-ge{background-image:url(../flags/4x3/ge.svg)}.flag-icon-ge.flag-icon-squared{background-image:url(../flags/1x1/ge.svg)}.flag-icon-gf{background-image:url(../flags/4x3/gf.svg)}.flag-icon-gf.flag-icon-squared{background-image:url(../flags/1x1/gf.svg)}.flag-icon-gg{background-image:url(../flags/4x3/gg.svg)}.flag-icon-gg.flag-icon-squared{background-image:url(../flags/1x1/gg.svg)}.flag-icon-gh{background-image:url(../flags/4x3/gh.svg)}.flag-icon-gh.flag-icon-squared{background-image:url(../flags/1x1/gh.svg)}.flag-icon-gi{background-image:url(../flags/4x3/gi.svg)}.flag-icon-gi.flag-icon-squared{background-image:url(../flags/1x1/gi.svg)}.flag-icon-gl{background-image:url(../flags/4x3/gl.svg)}.flag-icon-gl.flag-icon-squared{background-image:url(../flags/1x1/gl.svg)}.flag-icon-gm{background-image:url(../flags/4x3/gm.svg)}.flag-icon-gm.flag-icon-squared{background-image:url(../flags/1x1/gm.svg)}.flag-icon-gn{background-image:url(../flags/4x3/gn.svg)}.flag-icon-gn.flag-icon-squared{background-image:url(../flags/1x1/gn.svg)}.flag-icon-gp{background-image:url(../flags/4x3/gp.svg)}.flag-icon-gp.flag-icon-squared{background-image:url(../flags/1x1/gp.svg)}.flag-icon-gq{background-image:url(../flags/4x3/gq.svg)}.flag-icon-gq.flag-icon-squared{background-image:url(../flags/1x1/gq.svg)}.flag-icon-gr{background-image:url(../flags/4x3/gr.svg)}.flag-icon-gr.flag-icon-squared{background-image:url(../flags/1x1/gr.svg)}.flag-icon-gs{background-image:url(../flags/4x3/gs.svg)}.flag-icon-gs.flag-icon-squared{background-image:url(../flags/1x1/gs.svg)}.flag-icon-gt{background-image:url(../flags/4x3/gt.svg)}.flag-icon-gt.flag-icon-squared{background-image:url(../flags/1x1/gt.svg)}.flag-icon-gu{background-image:url(../flags/4x3/gu.svg)}.flag-icon-gu.flag-icon-squared{background-image:url(../flags/1x1/gu.svg)}.flag-icon-gw{background-image:url(../flags/4x3/gw.svg)}.flag-icon-gw.flag-icon-squared{background-image:url(../flags/1x1/gw.svg)}.flag-icon-gy{background-image:url(../flags/4x3/gy.svg)}.flag-icon-gy.flag-icon-squared{background-image:url(../flags/1x1/gy.svg)}.flag-icon-hk{background-image:url(../flags/4x3/hk.svg)}.flag-icon-hk.flag-icon-squared{background-image:url(../flags/1x1/hk.svg)}.flag-icon-hm{background-image:url(../flags/4x3/hm.svg)}.flag-icon-hm.flag-icon-squared{background-image:url(../flags/1x1/hm.svg)}.flag-icon-hn{background-image:url(../flags/4x3/hn.svg)}.flag-icon-hn.flag-icon-squared{background-image:url(../flags/1x1/hn.svg)}.flag-icon-hr{background-image:url(../flags/4x3/hr.svg)}.flag-icon-hr.flag-icon-squared{background-image:url(../flags/1x1/hr.svg)}.flag-icon-ht{background-image:url(../flags/4x3/ht.svg)}.flag-icon-ht.flag-icon-squared{background-image:url(../flags/1x1/ht.svg)}.flag-icon-hu{background-image:url(../flags/4x3/hu.svg)}.flag-icon-hu.flag-icon-squared{background-image:url(../flags/1x1/hu.svg)}.flag-icon-id{background-image:url(../flags/4x3/id.svg)}.flag-icon-id.flag-icon-squared{background-image:url(../flags/1x1/id.svg)}.flag-icon-ie{background-image:url(../flags/4x3/ie.svg)}.flag-icon-ie.flag-icon-squared{background-image:url(../flags/1x1/ie.svg)}.flag-icon-il{background-image:url(../flags/4x3/il.svg)}.flag-icon-il.flag-icon-squared{background-image:url(../flags/1x1/il.svg)}.flag-icon-im{background-image:url(../flags/4x3/im.svg)}.flag-icon-im.flag-icon-squared{background-image:url(../flags/1x1/im.svg)}.flag-icon-in{background-image:url(../flags/4x3/in.svg)}.flag-icon-in.flag-icon-squared{background-image:url(../flags/1x1/in.svg)}.flag-icon-io{background-image:url(../flags/4x3/io.svg)}.flag-icon-io.flag-icon-squared{background-image:url(../flags/1x1/io.svg)}.flag-icon-iq{background-image:url(../flags/4x3/iq.svg)}.flag-icon-iq.flag-icon-squared{background-image:url(../flags/1x1/iq.svg)}.flag-icon-ir{background-image:url(../flags/4x3/ir.svg)}.flag-icon-ir.flag-icon-squared{background-image:url(../flags/1x1/ir.svg)}.flag-icon-is{background-image:url(../flags/4x3/is.svg)}.flag-icon-is.flag-icon-squared{background-image:url(../flags/1x1/is.svg)}.flag-icon-it{background-image:url(../flags/4x3/it.svg)}.flag-icon-it.flag-icon-squared{background-image:url(../flags/1x1/it.svg)}.flag-icon-je{background-image:url(../flags/4x3/je.svg)}.flag-icon-je.flag-icon-squared{background-image:url(../flags/1x1/je.svg)}.flag-icon-jm{background-image:url(../flags/4x3/jm.svg)}.flag-icon-jm.flag-icon-squared{background-image:url(../flags/1x1/jm.svg)}.flag-icon-jo{background-image:url(../flags/4x3/jo.svg)}.flag-icon-jo.flag-icon-squared{background-image:url(../flags/1x1/jo.svg)}.flag-icon-jp{background-image:url(../flags/4x3/jp.svg)}.flag-icon-jp.flag-icon-squared{background-image:url(../flags/1x1/jp.svg)}.flag-icon-ke{background-image:url(../flags/4x3/ke.svg)}.flag-icon-ke.flag-icon-squared{background-image:url(../flags/1x1/ke.svg)}.flag-icon-kg{background-image:url(../flags/4x3/kg.svg)}.flag-icon-kg.flag-icon-squared{background-image:url(../flags/1x1/kg.svg)}.flag-icon-kh{background-image:url(../flags/4x3/kh.svg)}.flag-icon-kh.flag-icon-squared{background-image:url(../flags/1x1/kh.svg)}.flag-icon-ki{background-image:url(../flags/4x3/ki.svg)}.flag-icon-ki.flag-icon-squared{background-image:url(../flags/1x1/ki.svg)}.flag-icon-km{background-image:url(../flags/4x3/km.svg)}.flag-icon-km.flag-icon-squared{background-image:url(../flags/1x1/km.svg)}.flag-icon-kn{background-image:url(../flags/4x3/kn.svg)}.flag-icon-kn.flag-icon-squared{background-image:url(../flags/1x1/kn.svg)}.flag-icon-kp{background-image:url(../flags/4x3/kp.svg)}.flag-icon-kp.flag-icon-squared{background-image:url(../flags/1x1/kp.svg)}.flag-icon-kr{background-image:url(../flags/4x3/kr.svg)}.flag-icon-kr.flag-icon-squared{background-image:url(../flags/1x1/kr.svg)}.flag-icon-kw{background-image:url(../flags/4x3/kw.svg)}.flag-icon-kw.flag-icon-squared{background-image:url(../flags/1x1/kw.svg)}.flag-icon-ky{background-image:url(../flags/4x3/ky.svg)}.flag-icon-ky.flag-icon-squared{background-image:url(../flags/1x1/ky.svg)}.flag-icon-kz{background-image:url(../flags/4x3/kz.svg)}.flag-icon-kz.flag-icon-squared{background-image:url(../flags/1x1/kz.svg)}.flag-icon-la{background-image:url(../flags/4x3/la.svg)}.flag-icon-la.flag-icon-squared{background-image:url(../flags/1x1/la.svg)}.flag-icon-lb{background-image:url(../flags/4x3/lb.svg)}.flag-icon-lb.flag-icon-squared{background-image:url(../flags/1x1/lb.svg)}.flag-icon-lc{background-image:url(../flags/4x3/lc.svg)}.flag-icon-lc.flag-icon-squared{background-image:url(../flags/1x1/lc.svg)}.flag-icon-li{background-image:url(../flags/4x3/li.svg)}.flag-icon-li.flag-icon-squared{background-image:url(../flags/1x1/li.svg)}.flag-icon-lk{background-image:url(../flags/4x3/lk.svg)}.flag-icon-lk.flag-icon-squared{background-image:url(../flags/1x1/lk.svg)}.flag-icon-lr{background-image:url(../flags/4x3/lr.svg)}.flag-icon-lr.flag-icon-squared{background-image:url(../flags/1x1/lr.svg)}.flag-icon-ls{background-image:url(../flags/4x3/ls.svg)}.flag-icon-ls.flag-icon-squared{background-image:url(../flags/1x1/ls.svg)}.flag-icon-lt{background-image:url(../flags/4x3/lt.svg)}.flag-icon-lt.flag-icon-squared{background-image:url(../flags/1x1/lt.svg)}.flag-icon-lu{background-image:url(../flags/4x3/lu.svg)}.flag-icon-lu.flag-icon-squared{background-image:url(../flags/1x1/lu.svg)}.flag-icon-lv{background-image:url(../flags/4x3/lv.svg)}.flag-icon-lv.flag-icon-squared{background-image:url(../flags/1x1/lv.svg)}.flag-icon-ly{background-image:url(../flags/4x3/ly.svg)}.flag-icon-ly.flag-icon-squared{background-image:url(../flags/1x1/ly.svg)}.flag-icon-ma{background-image:url(../flags/4x3/ma.svg)}.flag-icon-ma.flag-icon-squared{background-image:url(../flags/1x1/ma.svg)}.flag-icon-mc{background-image:url(../flags/4x3/mc.svg)}.flag-icon-mc.flag-icon-squared{background-image:url(../flags/1x1/mc.svg)}.flag-icon-md{background-image:url(../flags/4x3/md.svg)}.flag-icon-md.flag-icon-squared{background-image:url(../flags/1x1/md.svg)}.flag-icon-me{background-image:url(../flags/4x3/me.svg)}.flag-icon-me.flag-icon-squared{background-image:url(../flags/1x1/me.svg)}.flag-icon-mf{background-image:url(../flags/4x3/mf.svg)}.flag-icon-mf.flag-icon-squared{background-image:url(../flags/1x1/mf.svg)}.flag-icon-mg{background-image:url(../flags/4x3/mg.svg)}.flag-icon-mg.flag-icon-squared{background-image:url(../flags/1x1/mg.svg)}.flag-icon-mh{background-image:url(../flags/4x3/mh.svg)}.flag-icon-mh.flag-icon-squared{background-image:url(../flags/1x1/mh.svg)}.flag-icon-mk{background-image:url(../flags/4x3/mk.svg)}.flag-icon-mk.flag-icon-squared{background-image:url(../flags/1x1/mk.svg)}.flag-icon-ml{background-image:url(../flags/4x3/ml.svg)}.flag-icon-ml.flag-icon-squared{background-image:url(../flags/1x1/ml.svg)}.flag-icon-mm{background-image:url(../flags/4x3/mm.svg)}.flag-icon-mm.flag-icon-squared{background-image:url(../flags/1x1/mm.svg)}.flag-icon-mn{background-image:url(../flags/4x3/mn.svg)}.flag-icon-mn.flag-icon-squared{background-image:url(../flags/1x1/mn.svg)}.flag-icon-mo{background-image:url(../flags/4x3/mo.svg)}.flag-icon-mo.flag-icon-squared{background-image:url(../flags/1x1/mo.svg)}.flag-icon-mp{background-image:url(../flags/4x3/mp.svg)}.flag-icon-mp.flag-icon-squared{background-image:url(../flags/1x1/mp.svg)}.flag-icon-mq{background-image:url(../flags/4x3/mq.svg)}.flag-icon-mq.flag-icon-squared{background-image:url(../flags/1x1/mq.svg)}.flag-icon-mr{background-image:url(../flags/4x3/mr.svg)}.flag-icon-mr.flag-icon-squared{background-image:url(../flags/1x1/mr.svg)}.flag-icon-ms{background-image:url(../flags/4x3/ms.svg)}.flag-icon-ms.flag-icon-squared{background-image:url(../flags/1x1/ms.svg)}.flag-icon-mt{background-image:url(../flags/4x3/mt.svg)}.flag-icon-mt.flag-icon-squared{background-image:url(../flags/1x1/mt.svg)}.flag-icon-mu{background-image:url(../flags/4x3/mu.svg)}.flag-icon-mu.flag-icon-squared{background-image:url(../flags/1x1/mu.svg)}.flag-icon-mv{background-image:url(../flags/4x3/mv.svg)}.flag-icon-mv.flag-icon-squared{background-image:url(../flags/1x1/mv.svg)}.flag-icon-mw{background-image:url(../flags/4x3/mw.svg)}.flag-icon-mw.flag-icon-squared{background-image:url(../flags/1x1/mw.svg)}.flag-icon-mx{background-image:url(../flags/4x3/mx.svg)}.flag-icon-mx.flag-icon-squared{background-image:url(../flags/1x1/mx.svg)}.flag-icon-my{background-image:url(../flags/4x3/my.svg)}.flag-icon-my.flag-icon-squared{background-image:url(../flags/1x1/my.svg)}.flag-icon-mz{background-image:url(../flags/4x3/mz.svg)}.flag-icon-mz.flag-icon-squared{background-image:url(../flags/1x1/mz.svg)}.flag-icon-na{background-image:url(../flags/4x3/na.svg)}.flag-icon-na.flag-icon-squared{background-image:url(../flags/1x1/na.svg)}.flag-icon-nc{background-image:url(../flags/4x3/nc.svg)}.flag-icon-nc.flag-icon-squared{background-image:url(../flags/1x1/nc.svg)}.flag-icon-ne{background-image:url(../flags/4x3/ne.svg)}.flag-icon-ne.flag-icon-squared{background-image:url(../flags/1x1/ne.svg)}.flag-icon-nf{background-image:url(../flags/4x3/nf.svg)}.flag-icon-nf.flag-icon-squared{background-image:url(../flags/1x1/nf.svg)}.flag-icon-ng{background-image:url(../flags/4x3/ng.svg)}.flag-icon-ng.flag-icon-squared{background-image:url(../flags/1x1/ng.svg)}.flag-icon-ni{background-image:url(../flags/4x3/ni.svg)}.flag-icon-ni.flag-icon-squared{background-image:url(../flags/1x1/ni.svg)}.flag-icon-nl{background-image:url(../flags/4x3/nl.svg)}.flag-icon-nl.flag-icon-squared{background-image:url(../flags/1x1/nl.svg)}.flag-icon-no{background-image:url(../flags/4x3/no.svg)}.flag-icon-no.flag-icon-squared{background-image:url(../flags/1x1/no.svg)}.flag-icon-np{background-image:url(../flags/4x3/np.svg)}.flag-icon-np.flag-icon-squared{background-image:url(../flags/1x1/np.svg)}.flag-icon-nr{background-image:url(../flags/4x3/nr.svg)}.flag-icon-nr.flag-icon-squared{background-image:url(../flags/1x1/nr.svg)}.flag-icon-nu{background-image:url(../flags/4x3/nu.svg)}.flag-icon-nu.flag-icon-squared{background-image:url(../flags/1x1/nu.svg)}.flag-icon-nz{background-image:url(../flags/4x3/nz.svg)}.flag-icon-nz.flag-icon-squared{background-image:url(../flags/1x1/nz.svg)}.flag-icon-om{background-image:url(../flags/4x3/om.svg)}.flag-icon-om.flag-icon-squared{background-image:url(../flags/1x1/om.svg)}.flag-icon-pa{background-image:url(../flags/4x3/pa.svg)}.flag-icon-pa.flag-icon-squared{background-image:url(../flags/1x1/pa.svg)}.flag-icon-pe{background-image:url(../flags/4x3/pe.svg)}.flag-icon-pe.flag-icon-squared{background-image:url(../flags/1x1/pe.svg)}.flag-icon-pf{background-image:url(../flags/4x3/pf.svg)}.flag-icon-pf.flag-icon-squared{background-image:url(../flags/1x1/pf.svg)}.flag-icon-pg{background-image:url(../flags/4x3/pg.svg)}.flag-icon-pg.flag-icon-squared{background-image:url(../flags/1x1/pg.svg)}.flag-icon-ph{background-image:url(../flags/4x3/ph.svg)}.flag-icon-ph.flag-icon-squared{background-image:url(../flags/1x1/ph.svg)}.flag-icon-pk{background-image:url(../flags/4x3/pk.svg)}.flag-icon-pk.flag-icon-squared{background-image:url(../flags/1x1/pk.svg)}.flag-icon-pl{background-image:url(../flags/4x3/pl.svg)}.flag-icon-pl.flag-icon-squared{background-image:url(../flags/1x1/pl.svg)}.flag-icon-pm{background-image:url(../flags/4x3/pm.svg)}.flag-icon-pm.flag-icon-squared{background-image:url(../flags/1x1/pm.svg)}.flag-icon-pn{background-image:url(../flags/4x3/pn.svg)}.flag-icon-pn.flag-icon-squared{background-image:url(../flags/1x1/pn.svg)}.flag-icon-pr{background-image:url(../flags/4x3/pr.svg)}.flag-icon-pr.flag-icon-squared{background-image:url(../flags/1x1/pr.svg)}.flag-icon-ps{background-image:url(../flags/4x3/ps.svg)}.flag-icon-ps.flag-icon-squared{background-image:url(../flags/1x1/ps.svg)}.flag-icon-pt{background-image:url(../flags/4x3/pt.svg)}.flag-icon-pt.flag-icon-squared{background-image:url(../flags/1x1/pt.svg)}.flag-icon-pw{background-image:url(../flags/4x3/pw.svg)}.flag-icon-pw.flag-icon-squared{background-image:url(../flags/1x1/pw.svg)}.flag-icon-py{background-image:url(../flags/4x3/py.svg)}.flag-icon-py.flag-icon-squared{background-image:url(../flags/1x1/py.svg)}.flag-icon-qa{background-image:url(../flags/4x3/qa.svg)}.flag-icon-qa.flag-icon-squared{background-image:url(../flags/1x1/qa.svg)}.flag-icon-re{background-image:url(../flags/4x3/re.svg)}.flag-icon-re.flag-icon-squared{background-image:url(../flags/1x1/re.svg)}.flag-icon-ro{background-image:url(../flags/4x3/ro.svg)}.flag-icon-ro.flag-icon-squared{background-image:url(../flags/1x1/ro.svg)}.flag-icon-rs{background-image:url(../flags/4x3/rs.svg)}.flag-icon-rs.flag-icon-squared{background-image:url(../flags/1x1/rs.svg)}.flag-icon-ru{background-image:url(../flags/4x3/ru.svg)}.flag-icon-ru.flag-icon-squared{background-image:url(../flags/1x1/ru.svg)}.flag-icon-rw{background-image:url(../flags/4x3/rw.svg)}.flag-icon-rw.flag-icon-squared{background-image:url(../flags/1x1/rw.svg)}.flag-icon-sa{background-image:url(../flags/4x3/sa.svg)}.flag-icon-sa.flag-icon-squared{background-image:url(../flags/1x1/sa.svg)}.flag-icon-sb{background-image:url(../flags/4x3/sb.svg)}.flag-icon-sb.flag-icon-squared{background-image:url(../flags/1x1/sb.svg)}.flag-icon-sc{background-image:url(../flags/4x3/sc.svg)}.flag-icon-sc.flag-icon-squared{background-image:url(../flags/1x1/sc.svg)}.flag-icon-sd{background-image:url(../flags/4x3/sd.svg)}.flag-icon-sd.flag-icon-squared{background-image:url(../flags/1x1/sd.svg)}.flag-icon-se{background-image:url(../flags/4x3/se.svg)}.flag-icon-se.flag-icon-squared{background-image:url(../flags/1x1/se.svg)}.flag-icon-sg{background-image:url(../flags/4x3/sg.svg)}.flag-icon-sg.flag-icon-squared{background-image:url(../flags/1x1/sg.svg)}.flag-icon-sh{background-image:url(../flags/4x3/sh.svg)}.flag-icon-sh.flag-icon-squared{background-image:url(../flags/1x1/sh.svg)}.flag-icon-si{background-image:url(../flags/4x3/si.svg)}.flag-icon-si.flag-icon-squared{background-image:url(../flags/1x1/si.svg)}.flag-icon-sj{background-image:url(../flags/4x3/sj.svg)}.flag-icon-sj.flag-icon-squared{background-image:url(../flags/1x1/sj.svg)}.flag-icon-sk{background-image:url(../flags/4x3/sk.svg)}.flag-icon-sk.flag-icon-squared{background-image:url(../flags/1x1/sk.svg)}.flag-icon-sl{background-image:url(../flags/4x3/sl.svg)}.flag-icon-sl.flag-icon-squared{background-image:url(../flags/1x1/sl.svg)}.flag-icon-sm{background-image:url(../flags/4x3/sm.svg)}.flag-icon-sm.flag-icon-squared{background-image:url(../flags/1x1/sm.svg)}.flag-icon-sn{background-image:url(../flags/4x3/sn.svg)}.flag-icon-sn.flag-icon-squared{background-image:url(../flags/1x1/sn.svg)}.flag-icon-so{background-image:url(../flags/4x3/so.svg)}.flag-icon-so.flag-icon-squared{background-image:url(../flags/1x1/so.svg)}.flag-icon-sr{background-image:url(../flags/4x3/sr.svg)}.flag-icon-sr.flag-icon-squared{background-image:url(../flags/1x1/sr.svg)}.flag-icon-ss{background-image:url(../flags/4x3/ss.svg)}.flag-icon-ss.flag-icon-squared{background-image:url(../flags/1x1/ss.svg)}.flag-icon-st{background-image:url(../flags/4x3/st.svg)}.flag-icon-st.flag-icon-squared{background-image:url(../flags/1x1/st.svg)}.flag-icon-sv{background-image:url(../flags/4x3/sv.svg)}.flag-icon-sv.flag-icon-squared{background-image:url(../flags/1x1/sv.svg)}.flag-icon-sx{background-image:url(../flags/4x3/sx.svg)}.flag-icon-sx.flag-icon-squared{background-image:url(../flags/1x1/sx.svg)}.flag-icon-sy{background-image:url(../flags/4x3/sy.svg)}.flag-icon-sy.flag-icon-squared{background-image:url(../flags/1x1/sy.svg)}.flag-icon-sz{background-image:url(../flags/4x3/sz.svg)}.flag-icon-sz.flag-icon-squared{background-image:url(../flags/1x1/sz.svg)}.flag-icon-tc{background-image:url(../flags/4x3/tc.svg)}.flag-icon-tc.flag-icon-squared{background-image:url(../flags/1x1/tc.svg)}.flag-icon-td{background-image:url(../flags/4x3/td.svg)}.flag-icon-td.flag-icon-squared{background-image:url(../flags/1x1/td.svg)}.flag-icon-tf{background-image:url(../flags/4x3/tf.svg)}.flag-icon-tf.flag-icon-squared{background-image:url(../flags/1x1/tf.svg)}.flag-icon-tg{background-image:url(../flags/4x3/tg.svg)}.flag-icon-tg.flag-icon-squared{background-image:url(../flags/1x1/tg.svg)}.flag-icon-th{background-image:url(../flags/4x3/th.svg)}.flag-icon-th.flag-icon-squared{background-image:url(../flags/1x1/th.svg)}.flag-icon-tj{background-image:url(../flags/4x3/tj.svg)}.flag-icon-tj.flag-icon-squared{background-image:url(../flags/1x1/tj.svg)}.flag-icon-tk{background-image:url(../flags/4x3/tk.svg)}.flag-icon-tk.flag-icon-squared{background-image:url(../flags/1x1/tk.svg)}.flag-icon-tl{background-image:url(../flags/4x3/tl.svg)}.flag-icon-tl.flag-icon-squared{background-image:url(../flags/1x1/tl.svg)}.flag-icon-tm{background-image:url(../flags/4x3/tm.svg)}.flag-icon-tm.flag-icon-squared{background-image:url(../flags/1x1/tm.svg)}.flag-icon-tn{background-image:url(../flags/4x3/tn.svg)}.flag-icon-tn.flag-icon-squared{background-image:url(../flags/1x1/tn.svg)}.flag-icon-to{background-image:url(../flags/4x3/to.svg)}.flag-icon-to.flag-icon-squared{background-image:url(../flags/1x1/to.svg)}.flag-icon-tr{background-image:url(../flags/4x3/tr.svg)}.flag-icon-tr.flag-icon-squared{background-image:url(../flags/1x1/tr.svg)}.flag-icon-tt{background-image:url(../flags/4x3/tt.svg)}.flag-icon-tt.flag-icon-squared{background-image:url(../flags/1x1/tt.svg)}.flag-icon-tv{background-image:url(../flags/4x3/tv.svg)}.flag-icon-tv.flag-icon-squared{background-image:url(../flags/1x1/tv.svg)}.flag-icon-tw{background-image:url(../flags/4x3/tw.svg)}.flag-icon-tw.flag-icon-squared{background-image:url(../flags/1x1/tw.svg)}.flag-icon-tz{background-image:url(../flags/4x3/tz.svg)}.flag-icon-tz.flag-icon-squared{background-image:url(../flags/1x1/tz.svg)}.flag-icon-ua{background-image:url(../flags/4x3/ua.svg)}.flag-icon-ua.flag-icon-squared{background-image:url(../flags/1x1/ua.svg)}.flag-icon-ug{background-image:url(../flags/4x3/ug.svg)}.flag-icon-ug.flag-icon-squared{background-image:url(../flags/1x1/ug.svg)}.flag-icon-um{background-image:url(../flags/4x3/um.svg)}.flag-icon-um.flag-icon-squared{background-image:url(../flags/1x1/um.svg)}.flag-icon-us{background-image:url(../flags/4x3/us.svg)}.flag-icon-us.flag-icon-squared{background-image:url(../flags/1x1/us.svg)}.flag-icon-uy{background-image:url(../flags/4x3/uy.svg)}.flag-icon-uy.flag-icon-squared{background-image:url(../flags/1x1/uy.svg)}.flag-icon-uz{background-image:url(../flags/4x3/uz.svg)}.flag-icon-uz.flag-icon-squared{background-image:url(../flags/1x1/uz.svg)}.flag-icon-va{background-image:url(../flags/4x3/va.svg)}.flag-icon-va.flag-icon-squared{background-image:url(../flags/1x1/va.svg)}.flag-icon-vc{background-image:url(../flags/4x3/vc.svg)}.flag-icon-vc.flag-icon-squared{background-image:url(../flags/1x1/vc.svg)}.flag-icon-ve{background-image:url(../flags/4x3/ve.svg)}.flag-icon-ve.flag-icon-squared{background-image:url(../flags/1x1/ve.svg)}.flag-icon-vg{background-image:url(../flags/4x3/vg.svg)}.flag-icon-vg.flag-icon-squared{background-image:url(../flags/1x1/vg.svg)}.flag-icon-vi{background-image:url(../flags/4x3/vi.svg)}.flag-icon-vi.flag-icon-squared{background-image:url(../flags/1x1/vi.svg)}.flag-icon-vn{background-image:url(../flags/4x3/vn.svg)}.flag-icon-vn.flag-icon-squared{background-image:url(../flags/1x1/vn.svg)}.flag-icon-vu{background-image:url(../flags/4x3/vu.svg)}.flag-icon-vu.flag-icon-squared{background-image:url(../flags/1x1/vu.svg)}.flag-icon-wf{background-image:url(../flags/4x3/wf.svg)}.flag-icon-wf.flag-icon-squared{background-image:url(../flags/1x1/wf.svg)}.flag-icon-ws{background-image:url(../flags/4x3/ws.svg)}.flag-icon-ws.flag-icon-squared{background-image:url(../flags/1x1/ws.svg)}.flag-icon-ye{background-image:url(../flags/4x3/ye.svg)}.flag-icon-ye.flag-icon-squared{background-image:url(../flags/1x1/ye.svg)}.flag-icon-yt{background-image:url(../flags/4x3/yt.svg)}.flag-icon-yt.flag-icon-squared{background-image:url(../flags/1x1/yt.svg)}.flag-icon-za{background-image:url(../flags/4x3/za.svg)}.flag-icon-za.flag-icon-squared{background-image:url(../flags/1x1/za.svg)}.flag-icon-zm{background-image:url(../flags/4x3/zm.svg)}.flag-icon-zm.flag-icon-squared{background-image:url(../flags/1x1/zm.svg)}.flag-icon-zw{background-image:url(../flags/4x3/zw.svg)}.flag-icon-zw.flag-icon-squared{background-image:url(../flags/1x1/zw.svg)}.flag-icon-es-ct{background-image:url(../flags/4x3/es-ct.svg)}.flag-icon-es-ct.flag-icon-squared{background-image:url(../flags/1x1/es-ct.svg)}.flag-icon-eu{background-image:url(../flags/4x3/eu.svg)}.flag-icon-eu.flag-icon-squared{background-image:url(../flags/1x1/eu.svg)}.flag-icon-gb-eng{background-image:url(../flags/4x3/gb-eng.svg)}.flag-icon-gb-eng.flag-icon-squared{background-image:url(../flags/1x1/gb-eng.svg)}.flag-icon-gb-nir{background-image:url(../flags/4x3/gb-nir.svg)}.flag-icon-gb-nir.flag-icon-squared{background-image:url(../flags/1x1/gb-nir.svg)}.flag-icon-gb-sct{background-image:url(../flags/4x3/gb-sct.svg)}.flag-icon-gb-sct.flag-icon-squared{background-image:url(../flags/1x1/gb-sct.svg)}.flag-icon-gb-wls{background-image:url(../flags/4x3/gb-wls.svg)}.flag-icon-gb-wls.flag-icon-squared{background-image:url(../flags/1x1/gb-wls.svg)}.flag-icon-un{background-image:url(../flags/4x3/un.svg)}.flag-icon-un.flag-icon-squared{background-image:url(../flags/1x1/un.svg)}.flag-icon-xk{background-image:url(../flags/4x3/xk.svg)}.flag-icon-xk.flag-icon-squared{background-image:url(../flags/1x1/xk.svg)}.loader-container{top:0;left:0;width:100%;height:100%;position:fixed;background-color:#000;opacity:.2;z-index:9999}#loader{position:absolute;left:50%;top:50%;z-index:1;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #3498db;width:120px;height:120px;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left,.mi.mi-pull-left{margin-right:.3em}.fa-stack,.mi-stack{display:inline-block;height:2em}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.modal-open{overflow:hidden;padding-right:0!important}/*! - * Font Awesome Free 5.12.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */.fa,.fab,.fad,.fal,.far,.fas{display:inline-block;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{width:1.25em}.fa-ul{margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-bahai:before{content:"\f666"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-alt:before{content:"\f422"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\f952"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-alt:before{content:"\f424"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\f907"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-ideal:before{content:"\f913"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-instagram-square:before{content:"\f955"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microblog:before{content:"\f91a"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\f956"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-square:before{content:"\f91e"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopify:before{content:"\f957"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\f941"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\f949"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(../fonts/fa-brands-400.eot);src:url(../fonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-brands-400.woff2) format("woff2"),url(../fonts/fa-brands-400.woff) format("woff"),url(../fonts/fa-brands-400.ttf) format("truetype"),url(../fonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(../fonts/fa-regular-400.eot);src:url(../fonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-regular-400.woff2) format("woff2"),url(../fonts/fa-regular-400.woff) format("woff"),url(../fonts/fa-regular-400.ttf) format("truetype"),url(../fonts/fa-regular-400.svg#fontawesome) format("svg")}.fab,.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../fonts/fa-solid-900.eot);src:url(../fonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-solid-900.woff2) format("woff2"),url(../fonts/fa-solid-900.woff) format("woff"),url(../fonts/fa-solid-900.ttf) format("truetype"),url(../fonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}/*! - * License - Micon v3.0.168 http://xtoolkit.github.io/Micon/ (MIT License) - * License - template: https://fontawesome.com/license/free (Code: MIT License) - */@font-face{font-family:micon;font-style:normal;font-weight:400;src:url(../fonts/micon.eot);src:url(../fonts/micon.eot?#iefix) format("embedded-opentype"),url(../fonts/micon.woff2) format("woff2"),url(../fonts/micon.woff) format("woff"),url(../fonts/micon.ttf) format("truetype"),url(../fonts/micon.svg#micon) format("svg")}.mi{font-family:micon;font-weight:400;display:inline-block;line-height:1}.mi-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.mi-xs{font-size:.75em}.mi-sm{font-size:.875em}.mi-1x{font-size:1em}.mi-2x{font-size:2em}.mi-3x{font-size:3em}.mi-4x{font-size:4em}.mi-5x{font-size:5em}.mi-6x{font-size:6em}.mi-7x{font-size:7em}.mi-8x{font-size:8em}.mi-9x{font-size:9em}.mi-10x{font-size:10em}.mi-fw{width:1.25em}.mi-ul{margin-left:2.5em;padding-left:0}.mi-ul>li{position:relative}.mi-li{left:-2em;position:absolute;width:2em;line-height:inherit}.mi-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.mi-pull-left{float:left}.mi-pull-right{float:right}.mi.mi-pull-right{margin-left:.3em}.mi-spin{animation:mi-spin 2s infinite linear}.mi-pulse{animation:mi-spin 1s infinite steps(8)}@keyframes mi-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.mi-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.mi-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.mi-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.mi-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scale(-1,1)}.mi-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(1,-1)}.mi-flip-horizontal.mi-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(-1,-1)}:root .mi-flip-horizontal,:root .mi-flip-vertical,:root .mi-rotate-180,:root .mi-rotate-270,:root .mi-rotate-90{filter:none}.mi-stack{line-height:2em;position:relative;vertical-align:middle;width:2.5em}.mi-stack-1x,.mi-stack-2x{left:0;position:absolute;width:100%}.mi-stack-1x{line-height:inherit}.mi-stack-2x{font-size:2em}.mi-Accept:before,.mi-AcceptLegacy:before,.mi-CheckmarkListviewLegacy:before,.mi-CheckmarkMenuLegacy:before{content:"\EA01"}.mi-Accident:before{content:"\EA02"}.mi-AccidentSolid:before{content:"\EA03"}.mi-Accounts:before,.mi-AccountsLegacy:before{content:"\EA04"}.mi-ActionCenter:before{content:"\EA05"}.mi-ActionCenterAsterisk:before{content:"\EA06"}.mi-ActionCenterMirrored:before{content:"\EA07"}.mi-ActionCenterNotification:before{content:"\EA08"}.mi-ActionCenterNotificationMirrored:before{content:"\EA09"}.mi-ActionCenterQuiet:before{content:"\EA0A"}.mi-ActionCenterQuietNotification:before{content:"\EA0B"}.mi-Add:before,.mi-AddLegacy:before{content:"\EA0C"}.mi-AddFriend:before,.mi-AddFriendLegacy:before{content:"\EA0D"}.mi-AddRemoteDevice:before{content:"\EA0E"}.mi-AddSurfaceHub:before{content:"\EA0F"}.mi-AddTo:before{content:"\EA10"}.mi-AdjustHologram:before{content:"\EA11"}.mi-Admin:before,.mi-AdminLegacy:before{content:"\EA12"}.mi-Airplane:before{content:"\EA13"}.mi-AirplaneSolid:before{content:"\EA14"}.mi-AlignCenter:before,.mi-AlignCenterLegacy:before{content:"\EA15"}.mi-AlignLeft:before,.mi-AlignLeftLegacy:before{content:"\EA16"}.mi-AlignRight:before,.mi-AlignRightLegacy:before{content:"\EA17"}.mi-AllApps:before,.mi-AllAppsLegacy:before{content:"\EA18"}.mi-AllAppsLegacyMirrored:before,.mi-AllAppsMirrored:before{content:"\EA19"}.mi-Annotation:before{content:"\EA1A"}.mi-AppIconDefault:before{content:"\EA1B"}.mi-Apps:before{content:"\EA1C"}.mi-AreaChart:before{content:"\EA1D"}.mi-ArrowDown8:before{content:"\EA1E"}.mi-ArrowLeft8:before{content:"\EA1F"}.mi-ArrowRight8:before{content:"\EA20"}.mi-ArrowUp8:before{content:"\EA21"}.mi-AspectRatio:before{content:"\EA22"}.mi-Asterisk:before{content:"\EA23"}.mi-AsteriskBadge12:before{content:"\EA24"}.mi-Attach:before,.mi-AttachLegacy:before{content:"\EA25"}.mi-AttachCamera:before,.mi-AttachCameraLegacy:before{content:"\EA26"}.mi-Audio:before,.mi-AudioLegacy:before{content:"\EA27"}.mi-ArrowHTMLLegacy:before,.mi-Back:before,.mi-BackBttnArrow20Legacy:before,.mi-BackBttnArrow42Legacy:before,.mi-BackLegacy:before{content:"\EA28"}.mi-BackMirrored:before{content:"\EA29"}.mi-BackSpaceQWERTYLg:before{content:"\EA2B"}.mi-BackSpaceQWERTYMd:before{content:"\EA2C"}.mi-BackSpaceQWERTYSm:before{content:"\EA2D"}.mi-BackToWindow:before,.mi-BackToWindowLegacy:before{content:"\EA2E"}.mi-BackgroundToggle:before{content:"\EA2F"}.mi-Badge:before{content:"\EA30"}.mi-BandBattery0:before{content:"\EA31"}.mi-BandBattery1:before{content:"\EA32"}.mi-BandBattery2:before{content:"\EA33"}.mi-BandBattery3:before{content:"\EA34"}.mi-BandBattery4:before{content:"\EA35"}.mi-BandBattery5:before{content:"\EA36"}.mi-BandBattery6:before{content:"\EA37"}.mi-Bank:before{content:"\EA38"}.mi-BarcodeScanner:before{content:"\EA39"}.mi-Battery0:before{content:"\EA3A"}.mi-Battery1:before{content:"\EA3B"}.mi-Battery10:before{content:"\EA3C"}.mi-Battery2:before{content:"\EA3D"}.mi-Battery3:before{content:"\EA3E"}.mi-Battery4:before{content:"\EA3F"}.mi-Battery5:before{content:"\EA40"}.mi-Battery6:before{content:"\EA41"}.mi-Battery7:before{content:"\EA42"}.mi-Battery8:before{content:"\EA43"}.mi-Battery9:before{content:"\EA44"}.mi-BatteryCharging0:before{content:"\EA45"}.mi-BatteryCharging1:before{content:"\EA46"}.mi-BatteryCharging10:before{content:"\EA47"}.mi-BatteryCharging2:before{content:"\EA48"}.mi-BatteryCharging3:before{content:"\EA49"}.mi-BatteryCharging4:before{content:"\EA4A"}.mi-BatteryCharging5:before{content:"\EA4B"}.mi-BatteryCharging6:before{content:"\EA4C"}.mi-BatteryCharging7:before{content:"\EA4D"}.mi-BatteryCharging8:before{content:"\EA4E"}.mi-BatteryCharging9:before{content:"\EA4F"}.mi-BatterySaver0:before{content:"\EA50"}.mi-BatterySaver1:before{content:"\EA51"}.mi-BatterySaver10:before{content:"\EA52"}.mi-BatterySaver2:before{content:"\EA53"}.mi-BatterySaver3:before{content:"\EA54"}.mi-BatterySaver4:before{content:"\EA55"}.mi-BatterySaver5:before{content:"\EA56"}.mi-BatterySaver6:before{content:"\EA57"}.mi-BatterySaver7:before{content:"\EA58"}.mi-BatterySaver8:before{content:"\EA59"}.mi-BatterySaver9:before{content:"\EA5A"}.mi-BatteryUnknown:before{content:"\EA5B"}.mi-Beta:before{content:"\EA5C"}.mi-BidiLtr:before{content:"\EA5D"}.mi-BidiRtl:before{content:"\EA5E"}.mi-BlockContact:before,.mi-BlockContactLegacy:before{content:"\EA5F"}.mi-Blocked:before,.mi-BlockedLegacy:before{content:"\EA61"}.mi-BlueLight:before{content:"\EA62"}.mi-Bluetooth:before{content:"\EA63"}.mi-BodyCam:before{content:"\EA64"}.mi-Bold:before,.mi-BoldLegacy:before{content:"\EA65"}.mi-BoldF:before,.mi-BoldFLegacy:before{content:"\EA67"}.mi-BoldG:before,.mi-BoldGLegacy:before{content:"\EA69"}.mi-BoldKorean:before,.mi-BoldKoreanLegacy:before{content:"\EA6B"}.mi-BoldN:before,.mi-BoldNLegacy:before{content:"\EA6D"}.mi-BoldRussion:before,.mi-BoldRussionLegacy:before{content:"\EA6F"}.mi-Bookmarks:before,.mi-BookmarksLegacy:before{content:"\EA70"}.mi-BookmarksLegacyMirrored:before,.mi-BookmarksMirrored:before{content:"\EA71"}.mi-Brightness:before{content:"\EA72"}.mi-Broom:before{content:"\EA73"}.mi-BrowsePhotos:before,.mi-BrowsePhotosLegacy:before{content:"\EA74"}.mi-BrushSize:before{content:"\EA75"}.mi-Bug:before{content:"\EA76"}.mi-BuildingEnergy:before{content:"\EA77"}.mi-BulletedList:before,.mi-BulletedListLegacy:before,.mi-ListLegacy:before{content:"\EA78"}.mi-BulletedListLegacyMirrored:before,.mi-BulletedListMirrored:before,.mi-ListLegacyMirrored:before{content:"\EA79"}.mi-Bullseye:before{content:"\EA7A"}.mi-BumperLeft:before{content:"\EA7B"}.mi-BumperRight:before{content:"\EA7C"}.mi-Bus:before{content:"\EA7D"}.mi-BusSolid:before{content:"\EA7E"}.mi-ButtonA:before{content:"\EA7F"}.mi-ButtonB:before{content:"\EA80"}.mi-ButtonMenu:before{content:"\EA81"}.mi-ButtonView2:before{content:"\EA82"}.mi-ButtonX:before{content:"\EA83"}.mi-ButtonY:before{content:"\EA84"}.mi-CC:before,.mi-CCLegacy:before{content:"\EA85"}.mi-CCEuro:before,.mi-CCEuroLegacy:before{content:"\EA87"}.mi-CCJapan:before,.mi-CCJapanLegacy:before{content:"\EA89"}.mi-Cafe:before{content:"\EA8A"}.mi-Calculator:before,.mi-CalculatorLegacy:before{content:"\EA8B"}.mi-CalculatorAddition:before{content:"\EA8C"}.mi-BackSpaceQWERTY:before,.mi-CalculatorBackspace:before{content:"\EA8D"}.mi-CalculatorDivide:before{content:"\EA8E"}.mi-CalculatorEqualTo:before{content:"\EA8F"}.mi-CalculatorMultiply:before{content:"\EA90"}.mi-CalculatorNegate:before{content:"\EA91"}.mi-CalculatorPercentage:before{content:"\EA92"}.mi-CalculatorSquareroot:before{content:"\EA93"}.mi-CalculatorSubtract:before{content:"\EA94"}.mi-Calendar:before,.mi-CalendarLegacy:before{content:"\EA95"}.mi-CalendarDay:before,.mi-CalendarDayLegacy:before{content:"\EA96"}.mi-CalendarLegacyMirrored:before,.mi-CalendarMirrored:before{content:"\EA97"}.mi-CalendarReply:before,.mi-CalendarReplyLegacy:before{content:"\EA98"}.mi-CalendarSolid:before{content:"\EA99"}.mi-CalendarWeek:before,.mi-CalendarWeekLegacy:before{content:"\EA9A"}.mi-CallForwardInternational:before{content:"\EA9B"}.mi-CallForwardInternationalMirrored:before{content:"\EA9C"}.mi-CallForwardRoaming:before{content:"\EA9D"}.mi-CallForwardRoamingMirrored:before{content:"\EA9E"}.mi-CallForwarding:before{content:"\EA9F"}.mi-CallForwardingMirrored:before{content:"\EAA0"}.mi-CalligraphyFill:before{content:"\EAA1"}.mi-CalligraphyPen:before{content:"\EAA2"}.mi-Calories:before{content:"\EAA3"}.mi-Camera:before,.mi-CameraLegacy:before{content:"\EAA4"}.mi-Cancel:before,.mi-CancelLegacy:before{content:"\EAA5"}.mi-Caption:before,.mi-CaptionLegacy:before{content:"\EAA6"}.mi-Car:before,.mi-DrivingMode:before{content:"\EAA7"}.mi-CaretBottomRightSolidCenter8:before{content:"\EAA8"}.mi-CaretDownSolid8:before{content:"\EAA9"}.mi-CaretLeftSolid8:before{content:"\EAAA"}.mi-CaretRight8:before{content:"\EAAB"}.mi-CaretRightSolid8:before{content:"\EAAC"}.mi-CaretUpSolid8:before{content:"\EAAD"}.mi-CashDrawer:before{content:"\EAAE"}.mi-CellPhone:before,.mi-CellPhoneLegacy:before,.mi-MobileContactLegacy:before{content:"\EAAF"}.mi-Certificate:before{content:"\EAB0"}.mi-CharacterAppearance:before{content:"\EAB1"}.mi-Characters:before,.mi-CharactersLegacy:before{content:"\EAB2"}.mi-ChatBubbles:before{content:"\EAB3"}.mi-CheckList:before{content:"\EAB4"}.mi-CheckMark:before,.mi-CheckMarkLegacy:before,.mi-CheckMarkZeroWidthLegacy:before{content:"\EAB5"}.mi-Checkbox:before,.mi-CheckboxLegacy:before{content:"\EAB6"}.mi-Checkbox14:before{content:"\EAB7"}.mi-CheckboxComposite:before,.mi-CheckboxCompositeLegacy:before{content:"\EAB8"}.mi-CheckboxComposite14:before{content:"\EAB9"}.mi-CheckboxCompositeReversed:before,.mi-CheckboxCompositeReversedLegacy:before{content:"\EABA"}.mi-CheckboxIndeterminate:before,.mi-CheckboxIndeterminateLegacy:before{content:"\EABC"}.mi-CheckboxIndeterminateCombo:before{content:"\EABD"}.mi-CheckboxIndeterminateCombo14:before{content:"\EABE"}.mi-ChecklistMirrored:before{content:"\EABF"}.mi-ChevronDown1Legacy:before,.mi-ChevronDown2Legacy:before,.mi-ChevronDown3Legacy:before,.mi-ChevronDown4Legacy:before,.mi-ChevronDown:before,.mi-ChevronFlipDownLegacy:before,.mi-ScrollChevronDownBoldLegacy:before,.mi-ScrollChevronDownLegacy:before{content:"\EAC0"}.mi-ChevronDownMed:before{content:"\EAC1"}.mi-ChevronDownSmLegacy:before,.mi-ChevronDownSmall:before{content:"\EAC2"}.mi-ChevronFlipLeftLegacy:before,.mi-ChevronLeft1Legacy:before,.mi-ChevronLeft2Legacy:before,.mi-ChevronLeft3Legacy:before,.mi-ChevronLeft4Legacy:before,.mi-ChevronLeft:before,.mi-ScrollChevronLeftBoldLegacy:before,.mi-ScrollChevronLeftLegacy:before{content:"\EAC3"}.mi-ChevronLeftMed:before{content:"\EAC4"}.mi-ChevronLeftSmLegacy:before,.mi-ChevronLeftSmall:before{content:"\EAC5"}.mi-ChevronFlipRightLegacy:before,.mi-ChevronRight1Legacy:before,.mi-ChevronRight2Legacy:before,.mi-ChevronRight3Legacy:before,.mi-ChevronRight4Legacy:before,.mi-ChevronRight:before,.mi-ScrollChevronRightBoldLegacy:before,.mi-ScrollChevronRightLegacy:before{content:"\EAC6"}.mi-ChevronRightMed:before{content:"\EAC7"}.mi-ChevronRightSmLegacy:before,.mi-ChevronRightSmall:before{content:"\EAC8"}.mi-ChevronFlipUpLegacy:before,.mi-ChevronUp1Legacy:before,.mi-ChevronUp2Legacy:before,.mi-ChevronUp3Legacy:before,.mi-ChevronUp4Legacy:before,.mi-ChevronUp:before,.mi-ScrollChevronUpBoldLegacy:before,.mi-ScrollChevronUpLegacy:before{content:"\EAC9"}.mi-ChevronUpMed:before{content:"\EACA"}.mi-ChevronUpSmall:before{content:"\EACB"}.mi-ChineseBoPoMoFo:before{content:"\EACC"}.mi-ChineseChangjie:before{content:"\EACD"}.mi-ChinesePinyin:before{content:"\EACE"}.mi-ChinesePunctuation:before{content:"\EACF"}.mi-ChineseQuick:before{content:"\EAD0"}.mi-ChipCardCreditCardReader:before{content:"\EAD1"}.mi-ChromeAnnotate:before{content:"\EAD2"}.mi-ChromeAnnotateContrast:before{content:"\EAD3"}.mi-ChromeBack:before{content:"\EAD4"}.mi-ChromeBackContrast:before{content:"\EAD5"}.mi-ChromeBackContrastMirrored:before{content:"\EAD6"}.mi-ChromeBackMirrored:before{content:"\EAD7"}.mi-ChromeBackToWindow:before{content:"\EAD8"}.mi-ChromeBackToWindowContrast:before{content:"\EAD9"}.mi-ChromeClose:before{content:"\EADA"}.mi-ChromeCloseContrast:before{content:"\EADB"}.mi-ChromeFullScreen:before{content:"\EADC"}.mi-ChromeFullScreenContrast:before{content:"\EADD"}.mi-ChromeMaximize:before{content:"\EADE"}.mi-ChromeMaximizeContrast:before{content:"\EADF"}.mi-ChromeMinimize:before{content:"\EAE0"}.mi-ChromeMinimizeContrast:before{content:"\EAE1"}.mi-ChromeRestore:before{content:"\EAE2"}.mi-ChromeRestoreContrast:before{content:"\EAE3"}.mi-ChromeSwitch:before{content:"\EAE4"}.mi-ChromeSwitchContast:before{content:"\EAE5"}.mi-CircleFill:before{content:"\EAE6"}.mi-CircleFillBadge12:before{content:"\EAE7"}.mi-CircleRing:before{content:"\EAE8"}.mi-CircleRingBadge12:before{content:"\EAE9"}.mi-CityNext:before{content:"\EAEA"}.mi-CityNext2:before{content:"\EAEB"}.mi-Clear:before,.mi-ClearLegacy:before{content:"\EAEC"}.mi-ClearAllInk:before{content:"\EAED"}.mi-ClearAllInkMirrored:before{content:"\EAEE"}.mi-ClearSelection:before,.mi-ClearSelectionLegacy:before{content:"\EAEF"}.mi-ClearSelectionLegacyMirrored:before,.mi-ClearSelectionMirrored:before{content:"\EAF0"}.mi-Click:before{content:"\EAF1"}.mi-ClipboardList:before{content:"\EAF2"}.mi-ClipboardListMirrored:before{content:"\EAF3"}.mi-ClippingTool:before{content:"\EAF4"}.mi-Clock:before,.mi-ClockLegacy:before{content:"\EAF6"}.mi-ClosePane:before,.mi-ClosePaneLegacy:before{content:"\EAF7"}.mi-ClosePaneLegacyMirrored:before,.mi-ClosePaneMirrored:before{content:"\EAF8"}.mi-Cloud:before{content:"\EAF9"}.mi-CloudPrinter:before{content:"\EAFA"}.mi-CloudSeach:before{content:"\EAFB"}.mi-Code:before{content:"\EAFC"}.mi-CollapseContent:before{content:"\EAFD"}.mi-CollapseContentSingle:before{content:"\EAFE"}.mi-CollateLandscape:before{content:"\EAFF"}.mi-CollateLandscapeSeparated:before{content:"\EB00"}.mi-CollatePortrait:before{content:"\EB01"}.mi-CollatePortraitSeparated:before{content:"\EB02"}.mi-Color:before,.mi-ColorLegacy:before{content:"\EB03"}.mi-ColorOff:before{content:"\EB04"}.mi-CommaKey:before{content:"\EB05"}.mi-CommandPrompt:before{content:"\EB06"}.mi-Comment:before,.mi-CommentLegacy:before{content:"\EB07"}.mi-Communications:before{content:"\EB08"}.mi-CompanionApp:before{content:"\EB09"}.mi-CompanionDeviceFramework:before{content:"\EB0A"}.mi-Completed:before{content:"\EB0B"}.mi-CompletedSolid:before{content:"\EB0C"}.mi-Component:before{content:"\EB0D"}.mi-Connect:before{content:"\EB0E"}.mi-ConnectApp:before,.mi-MiracastLogoLarge:before{content:"\EB0F"}.mi-Connected:before{content:"\EB10"}.mi-Construction:before{content:"\EB11"}.mi-ConstructionCone:before{content:"\EB12"}.mi-ConstructionSolid:before{content:"\EB13"}.mi-Contact3Legacy:before,.mi-Contact:before,.mi-ContactLegacy:before{content:"\EB14"}.mi-Contact2:before,.mi-Contact2Legacy:before{content:"\EB15"}.mi-ContactInfo:before,.mi-ContactInfoLegacy:before{content:"\EB16"}.mi-ContactInfoMirrored:before{content:"\EB17"}.mi-ContactPresence:before,.mi-ContactPresenceLegacy:before{content:"\EB18"}.mi-ContactSolid:before{content:"\EB19"}.mi-Copy:before,.mi-CopyLegacy:before{content:"\EB1A"}.mi-CopyTo:before{content:"\EB1B"}.mi-Courthouse:before{content:"\EB1C"}.mi-Crop:before,.mi-CropLegacy:before{content:"\EB1D"}.mi-CtrlSpatialLeft:before{content:"\EB1E"}.mi-CtrlSpatialRight:before{content:"\EB1F"}.mi-Cut:before,.mi-CutLegacy:before{content:"\EB20"}.mi-DMC:before{content:"\EB21"}.mi-DashKey:before{content:"\EB22"}.mi-DataSense:before{content:"\EB23"}.mi-DataSenseBar:before{content:"\EB24"}.mi-DateTime:before{content:"\EB25"}.mi-DateTimeMirrored:before{content:"\EB26"}.mi-DecreaseIndent:before,.mi-DecreaseIndentLegacy:before{content:"\EB28"}.mi-DecreaseIndentLegacyMirrored:before,.mi-DecreaseIndentMirrored:before{content:"\EB2A"}.mi-DefaultAPN:before{content:"\EB2B"}.mi-DefenderApp:before{content:"\EB2C"}.mi-DefenderBadge12:before{content:"\EB2D"}.mi-Delete:before,.mi-DeleteLegacy:before{content:"\EB2E"}.mi-Design:before{content:"\EB2F"}.mi-DetachablePC:before{content:"\EB30"}.mi-DevUpdate:before{content:"\EB31"}.mi-DeveloperTools:before{content:"\EB32"}.mi-DeviceDiscovery:before{content:"\EB33"}.mi-DeviceLaptopNoPic:before{content:"\EB34"}.mi-DeviceLaptopPic:before{content:"\EB35"}.mi-DeviceMonitorLeftPic:before{content:"\EB36"}.mi-DeviceMonitorNoPic:before{content:"\EB37"}.mi-DeviceMonitorRightPic:before{content:"\EB38"}.mi-Devices:before{content:"\EB39"}.mi-Devices3:before{content:"\EB3B"}.mi-Devices4:before{content:"\EB3C"}.mi-Devices2:before,.mi-DevicesLegacy:before{content:"\EB3D"}.mi-Diagnostic:before{content:"\EB3E"}.mi-Dial1:before{content:"\EB3F"}.mi-Dial10:before{content:"\EB40"}.mi-Dial11:before{content:"\EB41"}.mi-Dial12:before{content:"\EB42"}.mi-Dial13:before{content:"\EB43"}.mi-Dial14:before{content:"\EB44"}.mi-Dial15:before{content:"\EB45"}.mi-Dial16:before{content:"\EB46"}.mi-Dial2:before{content:"\EB47"}.mi-Dial3:before{content:"\EB48"}.mi-Dial4:before{content:"\EB49"}.mi-Dial5:before{content:"\EB4A"}.mi-Dial6:before{content:"\EB4B"}.mi-Dial7:before{content:"\EB4C"}.mi-Dial8:before{content:"\EB4D"}.mi-Dial9:before{content:"\EB4E"}.mi-DialShape1:before{content:"\EB4F"}.mi-DialShape2:before{content:"\EB50"}.mi-DialShape3:before{content:"\EB51"}.mi-DialShape4:before{content:"\EB52"}.mi-DialUp:before{content:"\EB53"}.mi-Dialpad:before{content:"\EB54"}.mi-Dictionary:before{content:"\EB55"}.mi-DictionaryAdd:before{content:"\EB56"}.mi-DictionaryCloud:before{content:"\EB57"}.mi-DirectAccess:before{content:"\EB58"}.mi-Directions:before,.mi-DirectionsLegacy:before{content:"\EB59"}.mi-DisableUpdates:before,.mi-DisableUpdatesLegacy:before{content:"\EB5A"}.mi-DisconnectDisplay:before{content:"\EB5B"}.mi-DisconnectDrive:before,.mi-DisconnectDriveLegacy:before{content:"\EB5C"}.mi-Dislike:before,.mi-DislikeLegacy:before{content:"\EB5D"}.mi-Dock:before{content:"\EB5E"}.mi-DockBottom:before,.mi-DockBottomLegacy:before{content:"\EB5F"}.mi-DockLeft:before,.mi-DockLeftLegacy:before{content:"\EB60"}.mi-DockLeftLegacyMirrored:before,.mi-DockLeftMirrored:before{content:"\EB61"}.mi-DockRight:before,.mi-DockRightLegacy:before{content:"\EB62"}.mi-DockRightLegacyMirrored:before,.mi-DockRightMirrored:before{content:"\EB63"}.mi-Document:before,.mi-DocumentLegacy:before{content:"\EB64"}.mi-DoublePinyin:before{content:"\EB65"}.mi-Down:before,.mi-DownLegacy:before{content:"\EB66"}.mi-DownShiftKey:before{content:"\EB67"}.mi-Download:before,.mi-DownloadLegacy:before{content:"\EB68"}.mi-DownloadMap:before{content:"\EB69"}.mi-Dpad:before{content:"\EB6A"}.mi-Draw:before{content:"\EB6B"}.mi-DrawSolid:before{content:"\EB6C"}.mi-Drop:before{content:"\EB6D"}.mi-DullSound:before{content:"\EB6E"}.mi-DullSoundKey:before{content:"\EB6F"}.mi-DuplexLandscapeOneSided:before{content:"\EB70"}.mi-DuplexLandscapeOneSidedMirrored:before{content:"\EB71"}.mi-DuplexLandscapeTwoSidedLongEdge:before{content:"\EB72"}.mi-DuplexLandscapeTwoSidedLongEdgeMirrored:before{content:"\EB73"}.mi-DuplexLandscapeTwoSidedShortEdge:before{content:"\EB74"}.mi-DuplexLandscapeTwoSidedShortEdgeMirrored:before{content:"\EB75"}.mi-DuplexPortraitOneSided:before{content:"\EB76"}.mi-DuplexPortraitOneSidedMirrored:before{content:"\EB77"}.mi-DuplexPortraitTwoSidedLongEdge:before{content:"\EB78"}.mi-DuplexPortraitTwoSidedLongEdgeMirrored:before{content:"\EB79"}.mi-DuplexPortraitTwoSidedShortEdge:before{content:"\EB7A"}.mi-DuplexPortraitTwoSidedShortEdgeMirrored:before{content:"\EB7B"}.mi-DynamicLock:before{content:"\EB7C"}.mi-EMI:before{content:"\EB7D"}.mi-Ear:before{content:"\EB7E"}.mi-Earbud:before{content:"\EB7F"}.mi-EaseOfAccess:before,.mi-EaseOfAccessLegacy:before{content:"\EB80"}.mi-Edit:before,.mi-EditLegacy:before{content:"\EB81"}.mi-EditLegacyMirrored:before,.mi-EditMirrored:before{content:"\EB82"}.mi-Education:before{content:"\EB83"}.mi-Emoji:before,.mi-EmojiLegacy:before{content:"\EB84"}.mi-Emoji2:before,.mi-Emoji2Legacy:before{content:"\EB85"}.mi-EmojiSwatch:before{content:"\EB86"}.mi-EmojiTabCelebrationObjects:before{content:"\EB87"}.mi-EmojiTabFavorites:before{content:"\EB88"}.mi-EmojiTabFoodPlants:before{content:"\EB89"}.mi-EmojiTabPeople:before{content:"\EB8A"}.mi-EmojiTabSmilesAnimals:before{content:"\EB8B"}.mi-EmojiTabSymbols:before{content:"\EB8C"}.mi-EmojiTabTextSmiles:before{content:"\EB8D"}.mi-EmojiTabTransitPlaces:before{content:"\EB8E"}.mi-EndPointSolid:before{content:"\EB90"}.mi-EnglishPunctuation:before{content:"\EB91"}.mi-Equalizer:before{content:"\EB92"}.mi-EraseTool:before{content:"\EB93"}.mi-EraseToolFill:before{content:"\EB94"}.mi-EraseToolFill2:before{content:"\EB95"}.mi-Error:before{content:"\EB96"}.mi-ErrorBadge:before{content:"\EB97"}.mi-ErrorBadge12:before{content:"\EB98"}.mi-Ethernet:before{content:"\EB99"}.mi-EthernetError:before{content:"\EB9A"}.mi-EthernetWarning:before{content:"\EB9B"}.mi-ExpandTile:before,.mi-ExpandTileLegacy:before{content:"\EB9C"}.mi-ExpandTileLegacyMirrored:before,.mi-ExpandTileMirrored:before{content:"\EB9D"}.mi-ExploitProtectionSettings:before{content:"\EB9E"}.mi-ExploreContent:before{content:"\EB9F"}.mi-ExploreContentSingle:before{content:"\EBA0"}.mi-Export:before,.mi-ImportLegacyMirrored:before,.mi-ImportMirrored:before{content:"\EBA1"}.mi-EyeGaze:before{content:"\EBA2"}.mi-Eyedropper:before{content:"\EBA3"}.mi-Family:before{content:"\EBA4"}.mi-FastForward:before{content:"\EBA5"}.mi-Favicon:before{content:"\EBA6"}.mi-FavoriteList:before{content:"\EBA8"}.mi-FavoriteInlineLegacy:before,.mi-FavoriteStar:before,.mi-OutlineStarLegacy:before,.mi-RatingStarLegacy:before,.mi-Unfavorite2Legacy:before{content:"\EBA9"}.mi-Favorite2Legacy:before,.mi-FavoriteLegacy:before,.mi-FavoriteStarFill:before,.mi-RatingStarFillLegacy:before,.mi-RatingStarFillReducedPaddingHTMLLegacy:before,.mi-RatingStarFillSmallLegacy:before,.mi-RatingStarFillZeroWidthLegacy:before,.mi-SolidStarLegacy:before{content:"\EBAA"}.mi-Feedback:before{content:"\EBAB"}.mi-FeedbackApp:before{content:"\EBAC"}.mi-Ferry:before{content:"\EBAD"}.mi-FerrySolid:before{content:"\EBAE"}.mi-FileExplorer:before{content:"\EBAF"}.mi-FileExplorerApp:before{content:"\EBB0"}.mi-Filter:before,.mi-FilterLegacy:before{content:"\EBB1"}.mi-FingerInking:before{content:"\EBB2"}.mi-Fingerprint:before{content:"\EBB3"}.mi-FitPage:before{content:"\EBB4"}.mi-EndPoint:before,.mi-Flag:before,.mi-FlagLegacy:before{content:"\EBB5"}.mi-Flashlight:before{content:"\EBB6"}.mi-FlickDown:before{content:"\EBB7"}.mi-FlickLeft:before{content:"\EBB8"}.mi-FlickRight:before{content:"\EBB9"}.mi-FlickUp:before{content:"\EBBA"}.mi-Folder:before{content:"\EBBB"}.mi-FolderFill:before,.mi-FolderLegacy:before{content:"\EBBC"}.mi-FolderHorizontal:before{content:"\EBBD"}.mi-FolderOpen:before{content:"\EBBE"}.mi-Font:before,.mi-FontLegacy:before{content:"\EBBF"}.mi-FontColor:before,.mi-FontColorLegacy:before{content:"\EBC0"}.mi-FontColorKorean:before,.mi-FontColorKoreanLegacy:before{content:"\EBC2"}.mi-FontDecrease:before,.mi-FontDecreaseLegacy:before{content:"\EBC3"}.mi-FontIncrease:before,.mi-FontIncreaseLegacy:before{content:"\EBC4"}.mi-FontSize:before,.mi-FontSizeLegacy:before{content:"\EBC5"}.mi-FontStyleKorean:before,.mi-FontStyleKoreanLegacy:before{content:"\EBC7"}.mi-ArrowHTMLLegacyMirrored:before,.mi-BackBttnMirroredArrow20Legacy:before,.mi-BackBttnMirroredArrow42Legacy:before,.mi-Forward:before,.mi-ForwardLegacy:before{content:"\EBC8"}.mi-ForwardMirrored:before{content:"\EBC9"}.mi-ForwardSm:before{content:"\EBCA"}.mi-FourBars:before,.mi-FourBarsLegacy:before{content:"\EBCB"}.mi-FreeFormClipping:before{content:"\EBCC"}.mi-Frigid:before{content:"\EBCD"}.mi-FullAlpha:before{content:"\EBCE"}.mi-FullCircleMask:before{content:"\EBCF"}.mi-FullHiragana:before{content:"\EBD0"}.mi-FullKatakana:before{content:"\EBD1"}.mi-FullScreen:before,.mi-FullScreenLegacy:before{content:"\EBD2"}.mi-FuzzyReading:before{content:"\EBD3"}.mi-GIF:before{content:"\EBD4"}.mi-Game:before{content:"\EBD5"}.mi-GameConsole:before{content:"\EBD6"}.mi-GiftboxOpen:before{content:"\EBD7"}.mi-GlobalNavigationButton:before{content:"\EBD8"}.mi-Globe:before,.mi-GlobeLegacy:before{content:"\EBD9"}.mi-Go:before,.mi-GoLegacy:before{content:"\EBDA"}.mi-GoLegacyMirrored:before,.mi-GoMirrored:before{content:"\EBDB"}.mi-GoToStart:before,.mi-GoToStartLegacy:before{content:"\EBDC"}.mi-GotoToday:before,.mi-GotoTodayLegacy:before{content:"\EBDD"}.mi-GridView:before{content:"\EBDE"}.mi-GripperBarHorizontal:before{content:"\EBDF"}.mi-GripperBarVertical:before{content:"\EBE0"}.mi-GripperResize:before{content:"\EBE1"}.mi-GripperResizeMirrored:before{content:"\EBE2"}.mi-GripperTool:before{content:"\EBE3"}.mi-Groceries:before{content:"\EBE4"}.mi-Group:before{content:"\EBE5"}.mi-GroupList:before{content:"\EBE6"}.mi-GuestUser:before{content:"\EBE7"}.mi-HMD:before{content:"\EBE8"}.mi-HWPInsert:before{content:"\EBE9"}.mi-HWPJoin:before{content:"\EBEA"}.mi-HWPNewLine:before{content:"\EBEB"}.mi-HWPOverwrite:before{content:"\EBEC"}.mi-HWPScratchOut:before{content:"\EBED"}.mi-HWPSplit:before{content:"\EBEE"}.mi-HWPStrikeThrough:before{content:"\EBEF"}.mi-HalfAlpha:before{content:"\EBF0"}.mi-HalfDullSound:before{content:"\EBF1"}.mi-HalfKatakana:before{content:"\EBF2"}.mi-HalfStarLeft:before{content:"\EBF3"}.mi-HalfStarRight:before{content:"\EBF4"}.mi-Handwriting:before{content:"\EBF5"}.mi-HangUp:before,.mi-HangUpLegacy:before{content:"\EBF6"}.mi-HardDrive:before{content:"\EBF7"}.mi-HeadlessDevice:before{content:"\EBF8"}.mi-Headphone:before{content:"\EBF9"}.mi-Headphone0:before{content:"\EBFA"}.mi-Headphone1:before{content:"\EBFB"}.mi-Headphone2:before{content:"\EBFC"}.mi-Headphone3:before{content:"\EBFD"}.mi-Headset:before{content:"\EBFE"}.mi-Health:before{content:"\EBFF"}.mi-Heart:before,.mi-HeartLegacy:before{content:"\EC00"}.mi-HeartBroken:before{content:"\EC01"}.mi-HeartBrokenLegacy:before,.mi-HeartBrokenZeroWidthLegacy:before{content:"\EC02"}.mi-HeartFill:before,.mi-HeartFillLegacy:before,.mi-HeartFillZeroWidthLegacy:before{content:"\EC03"}.mi-Help:before,.mi-HelpLegacy:before{content:"\EC04"}.mi-HelpLegacyMirrored:before,.mi-HelpMirrored:before{content:"\EC05"}.mi-HideBcc:before,.mi-HideBccLegacy:before{content:"\EC06"}.mi-Highlight:before,.mi-HighlightLegacy:before{content:"\EC07"}.mi-HighlightFill:before{content:"\EC08"}.mi-HighlightFill2:before{content:"\EC09"}.mi-History:before{content:"\EC0A"}.mi-HolePunchLandscapeBottom:before{content:"\EC0B"}.mi-HolePunchLandscapeLeft:before{content:"\EC0C"}.mi-HolePunchLandscapeRight:before{content:"\EC0D"}.mi-HolePunchLandscapeTop:before{content:"\EC0E"}.mi-HolePunchOff:before{content:"\EC0F"}.mi-HolePunchPortraitBottom:before{content:"\EC10"}.mi-HolePunchPortraitLeft:before{content:"\EC11"}.mi-HolePunchPortraitRight:before{content:"\EC12"}.mi-HolePunchPortraitTop:before{content:"\EC13"}.mi-HoloLensSelected:before{content:"\EC14"}.mi-Home:before,.mi-HomeLegacy:before{content:"\EC15"}.mi-HomeGroup:before{content:"\EC16"}.mi-HomeSolid:before{content:"\EC17"}.mi-HorizontalTabKey:before{content:"\EC18"}.mi-IBeam:before{content:"\EC19"}.mi-IBeamOutline:before{content:"\EC1A"}.mi-IOT:before{content:"\EC1B"}.mi-ImageExport:before{content:"\EC1C"}.mi-ExportMirrored:before,.mi-Import:before,.mi-ImportLegacy:before{content:"\EC1D"}.mi-ImportAll:before,.mi-ImportAllLegacy:before{content:"\EC1E"}.mi-ImportAllLegacyMirrored:before,.mi-ImportAllMirrored:before{content:"\EC1F"}.mi-Important:before,.mi-ImportantLegacy:before{content:"\EC20"}.mi-ImportantBadge12:before{content:"\EC21"}.mi-InPrivate:before{content:"\EC22"}.mi-IncidentTriangle:before{content:"\EC23"}.mi-IncreaseIndent:before,.mi-IncreaseIndentLegacy:before{content:"\EC25"}.mi-IncreaseIndentLegacyMirrored:before,.mi-IncreaseIndentMirrored:before{content:"\EC27"}.mi-Info:before{content:"\EC28"}.mi-Info2:before{content:"\EC29"}.mi-InfoSolid:before{content:"\EC2A"}.mi-InkingCaret:before{content:"\EC2B"}.mi-InkingColorFill:before{content:"\EC2C"}.mi-InkingColorOutline:before{content:"\EC2D"}.mi-InkingTool:before{content:"\EC2E"}.mi-InkingToolFill:before{content:"\EC2F"}.mi-InkingToolFill2:before{content:"\EC30"}.mi-Input:before{content:"\EC31"}.mi-InsiderHubApp:before{content:"\EC32"}.mi-InteractiveDashboard:before{content:"\EC33"}.mi-Italic:before,.mi-ItalicLegacy:before{content:"\EC34"}.mi-ItalicC:before,.mi-ItalicCLegacy:before{content:"\EC36"}.mi-ItalicI:before,.mi-ItalicILegacy:before{content:"\EC38"}.mi-ItalicK:before,.mi-ItalicKLegacy:before{content:"\EC3A"}.mi-ItalicKorean:before,.mi-ItalicKoreanLegacy:before{content:"\EC3C"}.mi-ItalicRussian:before,.mi-ItalicRussianLegacy:before{content:"\EC3E"}.mi-Japanese:before{content:"\EC3F"}.mi-JpnRomanji:before{content:"\EC40"}.mi-JpnRomanjiLock:before{content:"\EC41"}.mi-JpnRomanjiShift:before{content:"\EC42"}.mi-JpnRomanjiShiftLock:before{content:"\EC43"}.mi-Key12On:before{content:"\EC44"}.mi-Keyboard12Key:before{content:"\EC46"}.mi-KeyboardBrightness:before{content:"\EC47"}.mi-KeyBoardLegacy:before,.mi-KeyboardClassic:before{content:"\EC48"}.mi-KeyboardDismiss:before{content:"\EC49"}.mi-KeyboardDock:before{content:"\EC4A"}.mi-KeyboardFull:before{content:"\EC4B"}.mi-KeyboardLeftAligned:before{content:"\EC4C"}.mi-KeyboardLeftDock:before{content:"\EC4D"}.mi-KeyboardLeftHanded:before{content:"\EC4E"}.mi-KeyboardLowerBrightness:before{content:"\EC4F"}.mi-KeyboardNarrow:before{content:"\EC50"}.mi-KeyboardOneHanded:before{content:"\EC51"}.mi-KeyboardRightAligned:before{content:"\EC52"}.mi-KeyboardRightDock:before{content:"\EC53"}.mi-KeyboardRightHanded:before{content:"\EC54"}.mi-KeyboardSettings:before{content:"\EC55"}.mi-KeyboardShortcut:before{content:"\EC56"}.mi-KeyboardSplit:before,.mi-KeyboardSplitLegacy:before{content:"\EC57"}.mi-KeyboardStandard:before,.mi-KeyboardStandardLegacy:before{content:"\EC58"}.mi-KeyboardUndock:before{content:"\EC59"}.mi-KnowledgeArticle:before{content:"\EC5A"}.mi-Korean:before{content:"\EC5B"}.mi-LEDLight:before{content:"\EC5C"}.mi-Label:before{content:"\EC5D"}.mi-LandscapeOrientation:before{content:"\EC5E"}.mi-LandscapeOrientationMirrored:before{content:"\EC5F"}.mi-LangJPN:before{content:"\EC60"}.mi-LanguageChs:before{content:"\EC61"}.mi-LanguageCht:before{content:"\EC62"}.mi-LanguageJpn:before{content:"\EC63"}.mi-LanguageKor:before{content:"\EC64"}.mi-LaptopSecure:before{content:"\EC65"}.mi-LaptopSelected:before{content:"\EC66"}.mi-LargeErase:before{content:"\EC67"}.mi-Layout:before,.mi-LayoutLegacy:before{content:"\EC69"}.mi-Leaf:before{content:"\EC6A"}.mi-LeaveChat:before,.mi-LeaveChatLegacy:before{content:"\EC6B"}.mi-LeaveChatMirrored:before{content:"\EC6C"}.mi-LeftArrowKeyTime0:before{content:"\EC6D"}.mi-LeftDoubleQuote:before{content:"\EC6E"}.mi-LeftQuote:before{content:"\EC6F"}.mi-LeftStick:before{content:"\EC70"}.mi-Lexicon:before{content:"\EC71"}.mi-Library:before,.mi-LibraryLegacy:before{content:"\EC72"}.mi-Light:before{content:"\EC73"}.mi-LightningBolt:before{content:"\EC75"}.mi-Like:before,.mi-LikeInlineLegacy:before,.mi-LikeLegacy:before{content:"\EC76"}.mi-LikeDislike:before,.mi-LikeDislikeLegacy:before{content:"\EC77"}.mi-LineDisplay:before{content:"\EC78"}.mi-Link:before,.mi-LinkLegacy:before{content:"\EC79"}.mi-List:before{content:"\EC7A"}.mi-ListMirrored:before{content:"\EC7B"}.mi-Location:before,.mi-LocationLegacy:before{content:"\EC7C"}.mi-Lock:before,.mi-LockLegacy:before{content:"\EC7D"}.mi-LockFeedback:before{content:"\EC7E"}.mi-LockScreenGlance:before{content:"\EC7F"}.mi-LockscreenDesktop:before{content:"\EC80"}.mi-LowerBrightness:before{content:"\EC81"}.mi-MagStripeReader:before{content:"\EC82"}.mi-Mail:before,.mi-MailLegacy:before{content:"\EC83"}.mi-MailBadge12:before{content:"\EC84"}.mi-MailFill:before,.mi-MailFillLegacy:before,.mi-MailMessageLegacy:before{content:"\EC85"}.mi-MailForward:before,.mi-MailForwardLegacy:before{content:"\EC86"}.mi-MailForwardLegacyMirrored:before,.mi-MailForwardMirrored:before{content:"\EC87"}.mi-MailReply:before,.mi-MailReplyLegacy:before{content:"\EC88"}.mi-MailReplyAll:before,.mi-MailReplyAllLegacy:before{content:"\EC89"}.mi-MailReplyAllLegacyMirrored:before,.mi-MailReplyAllMirrored:before{content:"\EC8A"}.mi-MailReplyLegacyMirrored:before,.mi-MailReplyMirrored:before{content:"\EC8B"}.mi-Manage:before,.mi-ManageLegacy:before{content:"\EC8C"}.mi-MapCompassBottom:before{content:"\EC8D"}.mi-MapCompassTop:before{content:"\EC8E"}.mi-MapDirections:before{content:"\EC8F"}.mi-MapDrive:before,.mi-MapDriveLegacy:before{content:"\EC90"}.mi-MapLayers:before{content:"\EC91"}.mi-MapLegacy:before,.mi-MapPin:before{content:"\EC92"}.mi-MapPin2:before,.mi-MapPinLegacy:before{content:"\EC94"}.mi-Marker:before{content:"\EC95"}.mi-Marquee:before{content:"\EC96"}.mi-Media:before{content:"\EC97"}.mi-MediaStorageTower:before{content:"\EC98"}.mi-Megaphone:before{content:"\EC99"}.mi-Memo:before,.mi-MemoLegacy:before{content:"\EC9A"}.mi-CommentInlineLegacy:before,.mi-Message:before,.mi-MessageLegacy:before{content:"\EC9B"}.mi-MicClipping:before{content:"\EC9C"}.mi-MicError:before{content:"\EC9D"}.mi-MicOff:before{content:"\EC9E"}.mi-MicOn:before{content:"\EC9F"}.mi-MicSleep:before{content:"\ECA0"}.mi-Microphone:before,.mi-MicrophoneLegacy:before{content:"\ECA1"}.mi-MicrophoneListening:before{content:"\ECA2"}.mi-MiracastLogoSmall:before{content:"\ECA3"}.mi-MixVolumes:before{content:"\ECA4"}.mi-MobActionCenter:before{content:"\ECA5"}.mi-MobAirplane:before{content:"\ECA6"}.mi-MobBattery0:before{content:"\ECA7"}.mi-MobBattery1:before{content:"\ECA8"}.mi-MobBattery10:before{content:"\ECA9"}.mi-MobBattery2:before{content:"\ECAA"}.mi-MobBattery3:before{content:"\ECAB"}.mi-MobBattery4:before{content:"\ECAC"}.mi-MobBattery5:before{content:"\ECAD"}.mi-MobBattery6:before{content:"\ECAE"}.mi-MobBattery7:before{content:"\ECAF"}.mi-MobBattery8:before{content:"\ECB0"}.mi-MobBattery9:before{content:"\ECB1"}.mi-MobBatteryCharging0:before{content:"\ECB2"}.mi-MobBatteryCharging1:before{content:"\ECB3"}.mi-MobBatteryCharging10:before{content:"\ECB4"}.mi-MobBatteryCharging2:before{content:"\ECB5"}.mi-MobBatteryCharging3:before{content:"\ECB6"}.mi-MobBatteryCharging4:before{content:"\ECB7"}.mi-MobBatteryCharging5:before{content:"\ECB8"}.mi-MobBatteryCharging6:before{content:"\ECB9"}.mi-MobBatteryCharging7:before{content:"\ECBA"}.mi-MobBatteryCharging8:before{content:"\ECBB"}.mi-MobBatteryCharging9:before{content:"\ECBC"}.mi-MobBatterySaver0:before{content:"\ECBD"}.mi-MobBatterySaver1:before{content:"\ECBE"}.mi-MobBatterySaver10:before{content:"\ECBF"}.mi-MobBatterySaver2:before{content:"\ECC0"}.mi-MobBatterySaver3:before{content:"\ECC1"}.mi-MobBatterySaver4:before{content:"\ECC2"}.mi-MobBatterySaver5:before{content:"\ECC3"}.mi-MobBatterySaver6:before{content:"\ECC4"}.mi-MobBatterySaver7:before{content:"\ECC5"}.mi-MobBatterySaver8:before{content:"\ECC6"}.mi-MobBatterySaver9:before{content:"\ECC7"}.mi-MobBatteryUnknown:before{content:"\ECC8"}.mi-MobBluetooth:before{content:"\ECC9"}.mi-MobCallForwarding:before{content:"\ECCA"}.mi-MobCallForwardingMirrored:before{content:"\ECCB"}.mi-MobDrivingMode:before{content:"\ECCC"}.mi-MobLocation:before{content:"\ECCD"}.mi-MobQuietHours:before{content:"\ECCE"}.mi-MobSIMError:before{content:"\ECCF"}.mi-MobSIMLock:before{content:"\ECD0"}.mi-MobSIMMissing:before{content:"\ECD1"}.mi-MobSignal1:before{content:"\ECD2"}.mi-MobSignal2:before{content:"\ECD3"}.mi-MobSignal3:before{content:"\ECD4"}.mi-MobSignal4:before{content:"\ECD5"}.mi-MobSignal5:before{content:"\ECD6"}.mi-MobWifi1:before{content:"\ECD7"}.mi-MobWifi2:before{content:"\ECD8"}.mi-MobWifi3:before{content:"\ECD9"}.mi-MobWifi4:before{content:"\ECDA"}.mi-MobWifiHotspot:before{content:"\ECDB"}.mi-MobWifiWarning1:before{content:"\ECDC"}.mi-MobWifiWarning2:before{content:"\ECDD"}.mi-MobWifiWarning3:before{content:"\ECDE"}.mi-MobWifiWarning4:before{content:"\ECDF"}.mi-MobeSIM:before{content:"\ECE0"}.mi-MobeSIMBusy:before{content:"\ECE1"}.mi-MobeSIMLocked:before{content:"\ECE2"}.mi-MobeSIMNoProfile:before{content:"\ECE3"}.mi-MobileLocked:before{content:"\ECE4"}.mi-MobileSelected:before{content:"\ECE5"}.mi-MobileTablet:before{content:"\ECE6"}.mi-More:before,.mi-MoreLegacy:before{content:"\ECE7"}.mi-Mouse:before{content:"\ECE8"}.mi-MoveToFolder:before,.mi-MoveToFolderLegacy:before{content:"\ECE9"}.mi-Movies:before{content:"\ECEA"}.mi-MultiSelect:before,.mi-MultiSelectLegacy:before{content:"\ECEB"}.mi-MultiSelectLegacyMirrored:before,.mi-MultiSelectMirrored:before{content:"\ECEC"}.mi-MultimediaDMP:before{content:"\ECED"}.mi-MultimediaDMS:before{content:"\ECEE"}.mi-MultimediaDVR:before{content:"\ECEF"}.mi-MultimediaPMP:before{content:"\ECF0"}.mi-Multitask:before{content:"\ECF1"}.mi-Multitask16:before{content:"\ECF2"}.mi-MultitaskExpanded:before{content:"\ECF3"}.mi-MusicAlbum:before{content:"\ECF4"}.mi-MusicInfo:before,.mi-MusicInfoLegacy:before{content:"\ECF5"}.mi-MusicNote:before{content:"\ECF6"}.mi-MusicSharing:before{content:"\ECF7"}.mi-MusicSharingOff:before{content:"\ECF8"}.mi-Mute:before,.mi-MuteLegacy:before{content:"\ECF9"}.mi-MyNetwork:before{content:"\ECFA"}.mi-NUIFPContinueSlideAction:before{content:"\ECFB"}.mi-NUIFPContinueSlideHand:before{content:"\ECFC"}.mi-NUIFPPressAction:before{content:"\ECFD"}.mi-NUIFPPressHand:before{content:"\ECFE"}.mi-NUIFPPressRepeatAction:before{content:"\ECFF"}.mi-NUIFPRollLeftAction:before{content:"\ED00"}.mi-NUIFPRollLeftHand:before{content:"\ED01"}.mi-NUIFPRollRightHand:before{content:"\ED02"}.mi-NUIFPRollRightHandAction:before{content:"\ED03"}.mi-NUIFPStartSlideAction:before{content:"\ED04"}.mi-NUIFPPressRepeatHand:before,.mi-NUIFPStartSlideHand:before{content:"\ED05"}.mi-NUIFace:before{content:"\ED06"}.mi-NUIIris:before{content:"\ED07"}.mi-Narrator:before{content:"\ED08"}.mi-NarratorForward:before{content:"\ED09"}.mi-NarratorForwardMirrored:before{content:"\ED0A"}.mi-NearbySharing:before{content:"\ED0B"}.mi-Network:before{content:"\ED0C"}.mi-NetworkAdapter:before{content:"\ED0D"}.mi-NetworkConnected:before{content:"\ED0E"}.mi-NetworkConnectedCheckmark:before{content:"\ED0F"}.mi-NetworkOffline:before{content:"\ED10"}.mi-NetworkPrinter:before{content:"\ED11"}.mi-NetworkSharing:before{content:"\ED12"}.mi-NetworkTower:before{content:"\ED13"}.mi-NewFolder:before,.mi-NewFolderLegacy:before{content:"\ED14"}.mi-NewWindow:before,.mi-NewWindowLegacy:before{content:"\ED15"}.mi-Next:before,.mi-NextLegacy:before{content:"\ED16"}.mi-NoiseCancelation:before{content:"\ED17"}.mi-NoiseCancelationOff:before{content:"\ED18"}.mi-OEM:before{content:"\ED19"}.mi-OneBar:before,.mi-OneBarLegacy:before{content:"\ED1A"}.mi-OpenFile:before,.mi-OpenFileLegacy:before{content:"\ED1B"}.mi-OpenFolderHorizontal:before{content:"\ED1C"}.mi-OpenInNewWindow:before,.mi-OpenInNewWindowLegacy:before{content:"\ED1D"}.mi-OpenLocal:before,.mi-OpenLocalLegacy:before{content:"\ED1E"}.mi-OpenPane:before,.mi-OpenPaneLegacy:before{content:"\ED1F"}.mi-OpenPaneLegacyMirrored:before,.mi-OpenPaneMirrored:before{content:"\ED20"}.mi-OpenWith:before,.mi-OpenWithLegacy:before{content:"\ED21"}.mi-OpenWithLegacyMirrored:before,.mi-OpenWithMirrored:before{content:"\ED22"}.mi-Orientation:before,.mi-OrientationLegacy:before{content:"\ED23"}.mi-OtherUser:before,.mi-OtherUserLegacy:before{content:"\ED24"}.mi-OutlineHalfStarLeft:before{content:"\ED25"}.mi-OutlineHalfStarRight:before{content:"\ED26"}.mi-OutlineQuarterStarLeft:before{content:"\ED27"}.mi-OutlineQuarterStarRight:before{content:"\ED28"}.mi-OutlineStarLeftHalf:before{content:"\ED29"}.mi-OutlineStarRightHalf:before{content:"\ED2A"}.mi-OutlineThreeQuarterStarLeft:before{content:"\ED2B"}.mi-OutlineThreeQuarterStarRight:before{content:"\ED2C"}.mi-PC1:before,.mi-PC1Legacy:before{content:"\ED2D"}.mi-PINPad:before{content:"\ED2E"}.mi-PLAP:before{content:"\ED2F"}.mi-PPSFourLandscape:before{content:"\ED30"}.mi-PPSFourPortrait:before{content:"\ED31"}.mi-PPSOneLandscape:before{content:"\ED32"}.mi-PPSOnePortrait:before{content:"\ED33"}.mi-PPSTwoLandscape:before{content:"\ED34"}.mi-PPSTwoPortrait:before{content:"\ED35"}.mi-Package:before{content:"\ED36"}.mi-Page:before,.mi-PageLegacy:before{content:"\ED37"}.mi-PageLeft:before{content:"\ED38"}.mi-PageMarginLandscapeModerate:before{content:"\ED39"}.mi-PageMarginLandscapeNarrow:before{content:"\ED3A"}.mi-PageMarginLandscapeNormal:before{content:"\ED3B"}.mi-PageMarginLandscapeWide:before{content:"\ED3C"}.mi-PageMarginPortraitModerate:before{content:"\ED3D"}.mi-PageMarginPortraitNarrow:before{content:"\ED3E"}.mi-PageMarginPortraitNormal:before{content:"\ED3F"}.mi-PageMarginPortraitWide:before{content:"\ED40"}.mi-PageMirrored:before{content:"\ED41"}.mi-PageRight:before{content:"\ED42"}.mi-PageFillLegacy:before,.mi-PageSolid:before{content:"\ED43"}.mi-PaginationDotOutline10:before{content:"\ED44"}.mi-PaginationDotSolid10:before{content:"\ED45"}.mi-PanMode:before{content:"\ED46"}.mi-ParkingLocation:before{content:"\ED47"}.mi-ParkingLocationMirrored:before{content:"\ED48"}.mi-ParkingLocationSolid:before{content:"\ED49"}.mi-PartyLeader:before{content:"\ED4A"}.mi-PassiveAuthentication:before{content:"\ED4B"}.mi-PasswordKeyHide:before{content:"\ED4C"}.mi-PasswordKeyShow:before{content:"\ED4D"}.mi-Paste:before,.mi-PasteLegacy:before{content:"\ED4E"}.mi-Pause:before,.mi-PauseLegacy:before{content:"\ED4F"}.mi-PauseBadge12:before{content:"\ED50"}.mi-PaymentCard:before{content:"\ED51"}.mi-PenPalette:before{content:"\ED52"}.mi-PenPaletteMirrored:before{content:"\ED53"}.mi-PenTips:before{content:"\ED54"}.mi-PenTipsMirrored:before{content:"\ED55"}.mi-PenWorkspace:before{content:"\ED56"}.mi-PenWorkspaceMirrored:before{content:"\ED57"}.mi-Pencil:before{content:"\ED58"}.mi-PencilFill:before{content:"\ED59"}.mi-People:before,.mi-PeopleLegacy:before{content:"\ED5A"}.mi-PeriodKey:before{content:"\ED5B"}.mi-Permissions:before,.mi-PermissionsLegacy:before{content:"\ED5C"}.mi-PersonalFolder:before{content:"\ED5D"}.mi-Personalize:before{content:"\ED5E"}.mi-Phone:before,.mi-PhoneLegacy:before{content:"\ED5F"}.mi-PhoneBook:before,.mi-PhoneBookLegacy:before{content:"\ED60"}.mi-Photo:before{content:"\ED61"}.mi-Photo2:before{content:"\ED62"}.mi-Picture:before,.mi-PictureLegacy:before{content:"\ED63"}.mi-PieSingle:before{content:"\ED64"}.mi-Pin:before,.mi-PinLegacy:before{content:"\ED65"}.mi-PinFill:before{content:"\ED66"}.mi-Pinned:before{content:"\ED67"}.mi-PinnedFill:before{content:"\ED68"}.mi-PinyinIMELogo:before{content:"\ED69"}.mi-PlaceFolder:before,.mi-PlaceFolderLegacy:before{content:"\ED6B"}.mi-Play:before,.mi-PlayLegacy:before{content:"\ED6C"}.mi-Play36:before{content:"\ED6D"}.mi-PlayBadge12:before{content:"\ED6E"}.mi-PlayOn:before,.mi-PlayOnLegacy:before{content:"\ED70"}.mi-PlaySolid:before{content:"\ED71"}.mi-PlaybackRate1x:before{content:"\ED72"}.mi-PlaybackRateOther:before{content:"\ED73"}.mi-PlayerSettings:before{content:"\ED74"}.mi-PointErase:before{content:"\ED75"}.mi-PointEraseMirrored:before{content:"\ED76"}.mi-PointerHand:before{content:"\ED77"}.mi-PoliceCar:before{content:"\ED78"}.mi-PostUpdate:before,.mi-PostUpdateLegacy:before{content:"\ED79"}.mi-PowerButton:before{content:"\ED7A"}.mi-CheckboxFill:before,.mi-CheckboxFillLegacy:before,.mi-CheckboxFillZeroWidthLegacy:before,.mi-PresenceChicklet:before,.mi-PresenceChickletLegacy:before,.mi-ResizeMouseLarge:before{content:"\ED7B"}.mi-PresenceChickletVideo:before,.mi-PresenceChickletVideoLegacy:before{content:"\ED7C"}.mi-Preview:before,.mi-PreviewLegacy:before{content:"\ED7D"}.mi-PreviewLink:before,.mi-PreviewLinkLegacy:before{content:"\ED7E"}.mi-Previous:before,.mi-PreviousLegacy:before{content:"\ED7F"}.mi-Print:before,.mi-PrintLegacy:before{content:"\ED80"}.mi-PrintAllPages:before{content:"\ED81"}.mi-PrintCustomRange:before{content:"\ED82"}.mi-PrintDefault:before{content:"\ED83"}.mi-Printer3D:before{content:"\ED84"}.mi-Printer3DLegacy:before{content:"\ED85"}.mi-PrintfaxPrinterFile:before{content:"\ED86"}.mi-Priority:before,.mi-PriorityLegacy:before{content:"\ED87"}.mi-Process:before{content:"\ED88"}.mi-Processing:before{content:"\ED89"}.mi-ProgressRingDots:before{content:"\ED8A"}.mi-Project:before{content:"\ED8B"}.mi-Projector:before{content:"\ED8C"}.mi-ProtectedDocument:before,.mi-ProtectedDocumentLegacy:before{content:"\ED8D"}.mi-Protractor:before{content:"\ED8E"}.mi-ProvisioningPackage:before{content:"\ED8F"}.mi-PuncKey:before{content:"\ED90"}.mi-PuncKey0:before{content:"\ED91"}.mi-PuncKey1:before{content:"\ED92"}.mi-PuncKey2:before{content:"\ED93"}.mi-PuncKey3:before{content:"\ED94"}.mi-PuncKey4:before{content:"\ED95"}.mi-PuncKey5:before{content:"\ED96"}.mi-PuncKey6:before{content:"\ED97"}.mi-PuncKey7:before{content:"\ED98"}.mi-PuncKey8:before{content:"\ED99"}.mi-PuncKey9:before{content:"\ED9A"}.mi-PuncKeyLeftBottom:before{content:"\ED9B"}.mi-PuncKeyRightBottom:before{content:"\ED9C"}.mi-Puzzle:before{content:"\ED9D"}.mi-QWERTYOff:before{content:"\ED9E"}.mi-QWERTYOn:before{content:"\ED9F"}.mi-QuarentinedItems:before{content:"\EDA0"}.mi-QuarentinedItemsMirrored:before{content:"\EDA1"}.mi-QuarterStarLeft:before{content:"\EDA2"}.mi-QuarterStarRight:before{content:"\EDA3"}.mi-QuickNote:before{content:"\EDA4"}.mi-QuietHours:before{content:"\EDA5"}.mi-QuietHoursBadge12:before{content:"\EDA6"}.mi-Radar:before{content:"\EDA7"}.mi-RadioBtnOff:before{content:"\EDA8"}.mi-RadioBtnOn:before{content:"\EDA9"}.mi-RadioBullet:before{content:"\EDAA"}.mi-RadioBullet2:before{content:"\EDAB"}.mi-Read:before,.mi-ReadLegacy:before{content:"\EDAC"}.mi-ReadingList:before{content:"\EDAD"}.mi-ReceiptPrinter:before{content:"\EDAE"}.mi-LengthLegacy:before,.mi-Recent:before{content:"\EDAF"}.mi-Record:before,.mi-RecordLegacy:before{content:"\EDB0"}.mi-RectangularClipping:before{content:"\EDB1"}.mi-RedEye:before{content:"\EDB2"}.mi-Redo:before,.mi-RedoLegacy:before{content:"\EDB3"}.mi-ReduceTile:before,.mi-ReduceTileLegacy:before{content:"\EDB5"}.mi-ReduceTileLegacyMirrored:before,.mi-ReduceTileMirrored:before{content:"\EDB7"}.mi-Refresh:before,.mi-RefreshLegacy:before,.mi-RepeatAll:before,.mi-RepeatAllLegacy:before{content:"\EDB8"}.mi-Relationship:before{content:"\EDB9"}.mi-RememberedDevice:before{content:"\EDBA"}.mi-Reminder:before{content:"\EDBB"}.mi-ReminderFill:before{content:"\EDBC"}.mi-Remote:before,.mi-RemoteLegacy:before{content:"\EDBD"}.mi-Remove:before,.mi-RemoveLegacy:before{content:"\EDBE"}.mi-RemoveFrom:before{content:"\EDBF"}.mi-Rename:before,.mi-RenameLegacy:before{content:"\EDC0"}.mi-Repair:before,.mi-RepairLegacy:before{content:"\EDC1"}.mi-RepeatOne:before,.mi-RepeatOneLegacy:before{content:"\EDC2"}.mi-Replay:before{content:"\EDC3"}.mi-Reply:before,.mi-ReplyLegacy:before{content:"\EDC4"}.mi-ReplyMirrored:before{content:"\EDC5"}.mi-ReportDocument:before{content:"\EDC6"}.mi-ReportHacked:before,.mi-ReportHackedLegacy:before{content:"\EDC7"}.mi-ResetDevice:before{content:"\EDC8"}.mi-ResetDrive:before{content:"\EDC9"}.mi-Reshare:before,.mi-ReshareLegacy:before{content:"\EDCA"}.mi-ResizeMouseMedium:before{content:"\EDCB"}.mi-ResizeMouseMediumMirrored:before{content:"\EDCC"}.mi-ResizeMouseSmall:before{content:"\EDCD"}.mi-ResizeMouseSmallMirrored:before{content:"\EDCE"}.mi-ResizeMouseTall:before{content:"\EDCF"}.mi-ResizeMouseTallMirrored:before{content:"\EDD0"}.mi-ResizeMouseWide:before{content:"\EDD1"}.mi-ResizeTouchLarger:before{content:"\EDD2"}.mi-ResizeTouchNarrower:before{content:"\EDD3"}.mi-ResizeTouchNarrowerMirrored:before{content:"\EDD4"}.mi-ResizeTouchShorter:before{content:"\EDD5"}.mi-ResizeTouchSmaller:before{content:"\EDD6"}.mi-Resolution:before,.mi-ResolutionLegacy:before{content:"\EDD8"}.mi-ReturnKey:before{content:"\EDD9"}.mi-ReturnKeyLg:before{content:"\EDDA"}.mi-ReturnKeySm:before{content:"\EDDB"}.mi-ReturnToWindow:before,.mi-ReturnToWindowLegacy:before{content:"\EDDC"}.mi-RevToggleKey:before{content:"\EDDD"}.mi-Rewind:before{content:"\EDDE"}.mi-RightArrowKeyTime0:before{content:"\EDDF"}.mi-RightArrowKeyTime1:before{content:"\EDE0"}.mi-RightArrowKeyTime2:before{content:"\EDE1"}.mi-RightArrowKeyTime3:before{content:"\EDE2"}.mi-RightArrowKeyTime4:before{content:"\EDE3"}.mi-RightDoubleQuote:before{content:"\EDE4"}.mi-RightQuote:before{content:"\EDE5"}.mi-RightStick:before{content:"\EDE6"}.mi-Ringer:before{content:"\EDE7"}.mi-RingerBadge12:before{content:"\EDE8"}.mi-RingerSilent:before{content:"\EDE9"}.mi-RoamingDomestic:before{content:"\EDEA"}.mi-RoamingInternational:before{content:"\EDEB"}.mi-Robot:before{content:"\EDEC"}.mi-Rotate:before{content:"\EDED"}.mi-RotateCamera:before,.mi-RotateCameraLegacy:before{content:"\EDEE"}.mi-RotateLegacy:before{content:"\EDEF"}.mi-RotateMapLeft:before{content:"\EDF0"}.mi-RotateMapRight:before{content:"\EDF1"}.mi-RotationLock:before{content:"\EDF2"}.mi-Ruler:before{content:"\EDF3"}.mi-SDCard:before{content:"\EDF4"}.mi-SIMError:before{content:"\EDF5"}.mi-SIMLock:before{content:"\EDF6"}.mi-SIMMissing:before{content:"\EDF7"}.mi-SIPMove:before{content:"\EDF8"}.mi-SIPRedock:before{content:"\EDF9"}.mi-SIPUndock:before{content:"\EDFA"}.mi-Safe:before{content:"\EDFB"}.mi-Save:before,.mi-SaveLegacy:before{content:"\EDFC"}.mi-SaveAs:before,.mi-SaveAsLegacy:before{content:"\EDFD"}.mi-SaveCopy:before{content:"\EDFE"}.mi-SaveLocal:before,.mi-SaveLocalLegacy:before{content:"\EDFF"}.mi-Scan:before,.mi-ScanLegacy:before{content:"\EE00"}.mi-ScreenTime:before{content:"\EE01"}.mi-ScrollMode:before{content:"\EE02"}.mi-ScrollUpDown:before{content:"\EE03"}.mi-FindLegacy:before,.mi-Search:before,.mi-SearchboxLegacy:before{content:"\EE04"}.mi-SearchAndApps:before{content:"\EE05"}.mi-SelectAll:before,.mi-SelectAllLegacy:before{content:"\EE06"}.mi-SemanticZoom:before,.mi-SemanticZoomLegacy:before{content:"\EE08"}.mi-Send:before,.mi-SendLegacy:before{content:"\EE09"}.mi-SendFill:before{content:"\EE0A"}.mi-SendFillMirrored:before{content:"\EE0B"}.mi-SendMirrored:before{content:"\EE0C"}.mi-Sensor:before{content:"\EE0D"}.mi-Set:before{content:"\EE0E"}.mi-SetSolid:before{content:"\EE0F"}.mi-SetTile:before,.mi-SetTileLegacy:before{content:"\EE10"}.mi-SetlockScreen:before,.mi-SetlockScreenLegacy:before{content:"\EE11"}.mi-Settings:before,.mi-SettingsLegacy:before{content:"\EE12"}.mi-SettingsBattery:before{content:"\EE13"}.mi-SettingsDisplaySound:before{content:"\EE14"}.mi-Share:before{content:"\EE15"}.mi-ShareBroadband:before{content:"\EE16"}.mi-Shield:before{content:"\EE17"}.mi-Shop:before,.mi-ShopLegacy:before{content:"\EE18"}.mi-ShoppingCart:before{content:"\EE19"}.mi-ShowAllFiles1:before,.mi-ShowAllFiles1Legacy:before{content:"\EE1B"}.mi-ShowAllFiles3:before,.mi-ShowAllFiles3Legacy:before{content:"\EE1D"}.mi-ShowBcc:before,.mi-ShowBccLegacy:before{content:"\EE1E"}.mi-ShowResults:before,.mi-ShowResultsLegacy:before{content:"\EE1F"}.mi-ShowResultsLegacyMirrored:before,.mi-ShowResultsMirrored:before{content:"\EE20"}.mi-Shuffle:before,.mi-ShuffleLegacy:before{content:"\EE21"}.mi-SignalBars1:before{content:"\EE22"}.mi-SignalBars2:before{content:"\EE23"}.mi-SignalBars3:before{content:"\EE24"}.mi-SignalBars4:before{content:"\EE25"}.mi-SignalBars5:before{content:"\EE26"}.mi-SignalError:before{content:"\EE27"}.mi-SignalNotConnected:before{content:"\EE28"}.mi-SignalRoaming:before{content:"\EE29"}.mi-SignatureCapture:before{content:"\EE2A"}.mi-Size:before{content:"\EE2B"}.mi-SkipBack10:before{content:"\EE2C"}.mi-SkipForward30:before{content:"\EE2D"}.mi-SliderThumb:before{content:"\EE2E"}.mi-Slideshow:before,.mi-SlideshowLegacy:before{content:"\EE2F"}.mi-SlowMotionOn:before{content:"\EE30"}.mi-SmallErase:before{content:"\EE31"}.mi-Smartcard:before{content:"\EE32"}.mi-SmartcardVirtual:before{content:"\EE33"}.mi-Sort:before,.mi-SortLegacy:before{content:"\EE34"}.mi-SpatialVolume0:before{content:"\EE35"}.mi-SpatialVolume1:before{content:"\EE36"}.mi-SpatialVolume2:before{content:"\EE37"}.mi-SpatialVolume3:before{content:"\EE38"}.mi-Speakers:before{content:"\EE39"}.mi-Speech:before{content:"\EE3A"}.mi-SpeedHigh:before{content:"\EE3B"}.mi-SpeedMedium:before{content:"\EE3C"}.mi-SpeedOff:before{content:"\EE3D"}.mi-StaplingLandscapeBookBinding:before{content:"\EE3E"}.mi-StaplingLandscapeBottomLeft:before{content:"\EE3F"}.mi-StaplingLandscapeBottomRight:before{content:"\EE40"}.mi-StaplingLandscapeTopLeft:before{content:"\EE41"}.mi-StaplingLandscapeTopRight:before{content:"\EE42"}.mi-StaplingLandscapeTwoBottom:before{content:"\EE43"}.mi-StaplingLandscapeTwoLeft:before{content:"\EE44"}.mi-StaplingLandscapeTwoRight:before{content:"\EE45"}.mi-StaplingLandscapeTwoTop:before{content:"\EE46"}.mi-StaplingOff:before{content:"\EE47"}.mi-StaplingPortraitBookBinding:before{content:"\EE48"}.mi-StaplingPortraitBottomLeft:before{content:"\EE49"}.mi-StaplingPortraitBottomRight:before{content:"\EE4A"}.mi-StaplingPortraitTopLeft:before{content:"\EE4B"}.mi-StaplingPortraitTopRight:before{content:"\EE4C"}.mi-StaplingPortraitTwoBottom:before{content:"\EE4D"}.mi-StaplingPortraitTwoLeft:before{content:"\EE4E"}.mi-StaplingPortraitTwoRight:before{content:"\EE4F"}.mi-StaplingPortraitTwoTop:before{content:"\EE50"}.mi-StartPoint:before{content:"\EE51"}.mi-StartPointSolid:before{content:"\EE52"}.mi-StatusCheckmark:before{content:"\EE53"}.mi-StatusCheckmark7:before{content:"\EE54"}.mi-StatusCheckmarkLeft:before{content:"\EE55"}.mi-StatusCircle:before{content:"\EE56"}.mi-StatusCircle7:before{content:"\EE57"}.mi-StatusCircleBlock:before{content:"\EE58"}.mi-StatusCircleBlock2:before{content:"\EE59"}.mi-StatusCircleCheckmark:before{content:"\EE5A"}.mi-StatusCircleErrorX:before{content:"\EE5B"}.mi-StatusCircleExclamation:before{content:"\EE5C"}.mi-StatusCircleInfo:before{content:"\EE5D"}.mi-StatusCircleInner:before{content:"\EE5E"}.mi-StatusCircleLeft:before{content:"\EE5F"}.mi-StatusCircleOuter:before{content:"\EE60"}.mi-StatusCircleQuestionMark:before{content:"\EE61"}.mi-StatusCircleRing:before{content:"\EE62"}.mi-StatusCircleSync:before{content:"\EE63"}.mi-StatusConnecting1:before{content:"\EE64"}.mi-StatusConnecting2:before{content:"\EE65"}.mi-StatusDataTransfer:before{content:"\EE66"}.mi-StatusDataTransferVPN:before{content:"\EE67"}.mi-StatusDualSIM1:before{content:"\EE68"}.mi-StatusDualSIM1VPN:before{content:"\EE69"}.mi-StatusDualSIM2:before{content:"\EE6A"}.mi-StatusDualSIM2VPN:before{content:"\EE6B"}.mi-StatusError:before{content:"\EE6C"}.mi-StatusErrorCircle7:before{content:"\EE6D"}.mi-StatusErrorFull:before{content:"\EE6E"}.mi-StatusErrorLeft:before{content:"\EE6F"}.mi-StatusExclamationCircle7:before{content:"\EE70"}.mi-StatusInfo:before{content:"\EE71"}.mi-StatusInfoLeft:before{content:"\EE72"}.mi-StatusPause7:before{content:"\EE73"}.mi-StatusSGLTE:before{content:"\EE74"}.mi-StatusSGLTECell:before{content:"\EE75"}.mi-StatusSGLTEDataVPN:before{content:"\EE76"}.mi-StatusTriangle:before{content:"\EE77"}.mi-StatusTriangleExclamation:before{content:"\EE78"}.mi-StatusTriangleInner:before{content:"\EE79"}.mi-StatusTriangleLeft:before{content:"\EE7A"}.mi-StatusTriangleOuter:before{content:"\EE7B"}.mi-StatusUnsecure:before{content:"\EE7C"}.mi-StatusVPN:before{content:"\EE7D"}.mi-StatusWarning:before{content:"\EE7E"}.mi-StatusWarningLeft:before{content:"\EE7F"}.mi-Sticker2:before{content:"\EE80"}.mi-StockDown:before{content:"\EE81"}.mi-StockUp:before{content:"\EE82"}.mi-Stop:before,.mi-StopLegacy:before{content:"\EE83"}.mi-StopPoint:before{content:"\EE84"}.mi-StopPointSolid:before{content:"\EE85"}.mi-StopSlideshow:before,.mi-StopSlideshowLegacy:before{content:"\EE87"}.mi-Stopwatch:before{content:"\EE88"}.mi-StorageNetworkWireless:before{content:"\EE89"}.mi-StorageOptical:before{content:"\EE8A"}.mi-StorageTape:before{content:"\EE8B"}.mi-Streaming:before{content:"\EE8C"}.mi-StreamingEnterprise:before{content:"\EE8D"}.mi-Street:before,.mi-StreetLegacy:before{content:"\EE8E"}.mi-StreetsideSplitExpand:before{content:"\EE8F"}.mi-StreetsideSplitMinimize:before{content:"\EE90"}.mi-StrokeErase:before{content:"\EE91"}.mi-StrokeErase2:before{content:"\EE92"}.mi-StrokeEraseMirrored:before{content:"\EE93"}.mi-Subtitles:before{content:"\EE94"}.mi-SubtitlesAudio:before{content:"\EE95"}.mi-SurfaceHub:before{content:"\EE96"}.mi-SurfaceHubSelected:before{content:"\EE97"}.mi-Sustainable:before{content:"\EE98"}.mi-Swipe:before{content:"\EE99"}.mi-SwipeRevealArt:before{content:"\EE9A"}.mi-Switch:before,.mi-SwitchLegacy:before{content:"\EE9B"}.mi-SwitchApps:before,.mi-SwitchAppsLegacy:before{content:"\EE9C"}.mi-SwitchUser:before{content:"\EE9D"}.mi-Sync:before,.mi-SyncLegacy:before{content:"\EE9E"}.mi-SyncBadge12:before{content:"\EE9F"}.mi-SyncError:before{content:"\EEA0"}.mi-SyncFolder:before,.mi-SyncFolderLegacy:before{content:"\EEA1"}.mi-System:before{content:"\EEA2"}.mi-TVMonitor:before{content:"\EEA3"}.mi-TVMonitorSelected:before{content:"\EEA4"}.mi-Tablet:before{content:"\EEA5"}.mi-TabletMode:before{content:"\EEA6"}.mi-TabletSelected:before{content:"\EEA7"}.mi-Tag:before,.mi-TagLegacy:before{content:"\EEA8"}.mi-TapAndSend:before{content:"\EEA9"}.mi-TaskView:before{content:"\EEAA"}.mi-TaskViewExpanded:before{content:"\EEAB"}.mi-TaskViewSettings:before{content:"\EEAC"}.mi-TaskbarPhone:before{content:"\EEAD"}.mi-ThisPC:before{content:"\EEAE"}.mi-ThoughtBubble:before{content:"\EEAF"}.mi-ThreeBars:before,.mi-ThreeBarsLegacy:before{content:"\EEB0"}.mi-ThreeQuarterStarLeft:before{content:"\EEB1"}.mi-ThreeQuarterStarRight:before{content:"\EEB2"}.mi-Tiles:before{content:"\EEB3"}.mi-TiltDown:before{content:"\EEB4"}.mi-TiltUp:before{content:"\EEB5"}.mi-TimeLanguage:before{content:"\EEB6"}.mi-ToggleBorder:before{content:"\EEB7"}.mi-ToggleFilled:before{content:"\EEB8"}.mi-ToggleThumb:before{content:"\EEB9"}.mi-TollSolid:before{content:"\EEBA"}.mi-Lightbulb:before,.mi-ToolTip:before{content:"\EEBB"}.mi-Touch:before{content:"\EEBC"}.mi-TouchPointer:before,.mi-TouchPointerLegacy:before{content:"\EEBD"}.mi-Touchpad:before{content:"\EEBE"}.mi-Touchscreen:before{content:"\EEBF"}.mi-Trackers:before{content:"\EEC0"}.mi-TrackersMirrored:before{content:"\EEC1"}.mi-TrafficCongestionSolid:before{content:"\EEC2"}.mi-TrafficLight:before{content:"\EEC3"}.mi-Train:before{content:"\EEC4"}.mi-TrainSolid:before{content:"\EEC5"}.mi-TreeFolderFolder:before{content:"\EEC6"}.mi-TreeFolderFolderFill:before{content:"\EEC7"}.mi-TreeFolderFolderOpen:before{content:"\EEC8"}.mi-TreeFolderFolderOpenFill:before{content:"\EEC9"}.mi-TriggerLeft:before{content:"\EECA"}.mi-TriggerRight:before{content:"\EECB"}.mi-Trim:before,.mi-TrimLegacy:before{content:"\EECC"}.mi-TwoBars:before,.mi-TwoBarsLegacy:before{content:"\EECD"}.mi-TwoPage:before,.mi-TwoPageLegacy:before{content:"\EECE"}.mi-Type:before,.mi-TypeLegacy:before{content:"\EECF"}.mi-TypingIndicatorLegacy:before{content:"\EED0"}.mi-USB:before{content:"\EED1"}.mi-USBSafeConnect:before{content:"\EED2"}.mi-Underline:before,.mi-UnderlineLegacy:before{content:"\EED3"}.mi-UnderlineLKorean:before,.mi-UnderlineLKoreanLegacy:before{content:"\EED5"}.mi-UnderlineRussian:before,.mi-UnderlineRussianLegacy:before{content:"\EED7"}.mi-UnderlineS:before,.mi-UnderlineSLegacy:before{content:"\EED9"}.mi-UnderlineU:before,.mi-UnderlineULegacy:before{content:"\EEDB"}.mi-UnderscoreSpace:before{content:"\EEDC"}.mi-Undo:before,.mi-UndoLegacy:before{content:"\EEDD"}.mi-Unfavorite:before,.mi-UnfavoriteLegacy:before{content:"\EEDE"}.mi-Unit:before{content:"\EEDF"}.mi-Unknown:before{content:"\EEE0"}.mi-UnknownMirrored:before{content:"\EEE1"}.mi-Unlock:before,.mi-UnlockLegacy:before{content:"\EEE2"}.mi-Unpin:before,.mi-UnpinLegacy:before{content:"\EEE3"}.mi-UnsyncFolder:before,.mi-UnsyncFolderLegacy:before{content:"\EEE4"}.mi-Up:before,.mi-UpLegacy:before{content:"\EEE5"}.mi-UpArrowShiftKey:before{content:"\EEE6"}.mi-UpShiftKey:before{content:"\EEE7"}.mi-UpdateRestore:before{content:"\EEE8"}.mi-Upload:before,.mi-UploadLegacy:before,.mi-UploadSkyDriveLegacy:before{content:"\EEE9"}.mi-UserAPN:before{content:"\EEEA"}.mi-VPN:before{content:"\EEEB"}.mi-VerticalBattery0:before{content:"\EEEC"}.mi-VerticalBattery1:before{content:"\EEED"}.mi-VerticalBattery10:before{content:"\EEEE"}.mi-VerticalBattery2:before{content:"\EEEF"}.mi-VerticalBattery3:before{content:"\EEF0"}.mi-VerticalBattery4:before{content:"\EEF1"}.mi-VerticalBattery5:before{content:"\EEF2"}.mi-VerticalBattery6:before{content:"\EEF3"}.mi-VerticalBattery7:before{content:"\EEF4"}.mi-VerticalBattery8:before{content:"\EEF5"}.mi-VerticalBattery9:before{content:"\EEF6"}.mi-VerticalBatteryCharging0:before{content:"\EEF7"}.mi-VerticalBatteryCharging1:before{content:"\EEF8"}.mi-VerticalBatteryCharging10:before{content:"\EEF9"}.mi-VerticalBatteryCharging2:before{content:"\EEFA"}.mi-VerticalBatteryCharging3:before{content:"\EEFB"}.mi-VerticalBatteryCharging4:before{content:"\EEFC"}.mi-VerticalBatteryCharging5:before{content:"\EEFD"}.mi-VerticalBatteryCharging6:before{content:"\EEFE"}.mi-VerticalBatteryCharging7:before{content:"\EEFF"}.mi-VerticalBatteryCharging8:before{content:"\EF00"}.mi-VerticalBatteryCharging9:before{content:"\EF01"}.mi-VerticalBatteryUnknown:before{content:"\EF02"}.mi-Vibrate:before{content:"\EF03"}.mi-Video:before,.mi-VideoInlineLegacy:before,.mi-VideoLegacy:before{content:"\EF04"}.mi-Video360:before{content:"\EF05"}.mi-VideoChat:before,.mi-VideoChatLegacy:before{content:"\EF06"}.mi-VideoSolid:before{content:"\EF07"}.mi-RevealPasswordLegacy:before,.mi-View:before,.mi-ViewLegacy:before{content:"\EF08"}.mi-ShowAllFilesLegacy:before,.mi-ViewAll:before,.mi-ViewAllLegacy:before{content:"\EF09"}.mi-ViewDashboard:before{content:"\EF0A"}.mi-Volume:before,.mi-VolumeLegacy:before{content:"\EF0B"}.mi-Volume0:before{content:"\EF0C"}.mi-Volume1:before{content:"\EF0D"}.mi-Volume2:before{content:"\EF0E"}.mi-Volume3:before{content:"\EF0F"}.mi-VolumeBars:before{content:"\EF10"}.mi-Walk:before{content:"\EF11"}.mi-WalkSolid:before{content:"\EF12"}.mi-Warning:before{content:"\EF13"}.mi-Webcam:before,.mi-WebcamLegacy:before{content:"\EF14"}.mi-Webcam2:before{content:"\EF15"}.mi-Website:before{content:"\EF16"}.mi-Wheel:before{content:"\EF17"}.mi-Wifi:before{content:"\EF18"}.mi-Wifi1:before{content:"\EF19"}.mi-Wifi2:before{content:"\EF1A"}.mi-Wifi3:before{content:"\EF1B"}.mi-WifiAttentionOverlay:before{content:"\EF1C"}.mi-WifiCall0:before{content:"\EF1D"}.mi-WifiCall1:before{content:"\EF1E"}.mi-WifiCall2:before{content:"\EF1F"}.mi-WifiCall3:before{content:"\EF20"}.mi-WifiCall4:before{content:"\EF21"}.mi-WifiCallBars:before{content:"\EF22"}.mi-WifiError0:before{content:"\EF23"}.mi-WifiError1:before{content:"\EF24"}.mi-WifiError2:before{content:"\EF25"}.mi-WifiError3:before{content:"\EF26"}.mi-WifiError4:before{content:"\EF27"}.mi-WifiEthernet:before{content:"\EF28"}.mi-InternetSharing:before,.mi-WifiHotspot:before{content:"\EF29"}.mi-WifiWarning0:before{content:"\EF2A"}.mi-WifiWarning1:before{content:"\EF2B"}.mi-WifiWarning2:before{content:"\EF2C"}.mi-WifiWarning3:before{content:"\EF2D"}.mi-WifiWarning4:before{content:"\EF2E"}.mi-WindDirection:before{content:"\EF2F"}.mi-WindowsInsider:before{content:"\EF30"}.mi-WiredUSB:before{content:"\EF31"}.mi-WirelessUSB:before{content:"\EF32"}.mi-Work:before{content:"\EF33"}.mi-WorkSolid:before{content:"\EF34"}.mi-World:before,.mi-WorldLegacy:before{content:"\EF35"}.mi-XboxOneConsole:before{content:"\EF36"}.mi-ZeroBars:before,.mi-ZeroBarsLegacy:before{content:"\EF37"}.mi-Zoom:before,.mi-ZoomLegacy:before{content:"\EF38"}.mi-ZoomIn:before,.mi-ZoomInLegacy:before{content:"\EF39"}.mi-ZoomMode:before{content:"\EF3A"}.mi-ZoomOut:before,.mi-ZoomOutLegacy:before{content:"\EF3B"}.mi-eSIM:before{content:"\EF3C"}.mi-eSIMBusy:before{content:"\EF3D"}.mi-eSIMLocked:before{content:"\EF3E"}.mi-eSIMNoProfile:before{content:"\EF3F"}.mi-E80B:before,.mi-uniE80B:before{content:"\EF40"}.mi-EA0D:before,.mi-uniEA0D:before{content:"\EF41"}.mi-EA3F:before,.mi-uniEA3F:before{content:"\EF42"}.mi-EA90:before,.mi-uniEA90:before{content:"\EF43"}.mi-EAC2:before,.mi-uniEAC2:before{content:"\EF44"}.mi-EC6C:before,.mi-uniEC6C:before{content:"\EF45"}.mi-EEA3:before,.mi-uniEEA3:before{content:"\EF46"}.mi-F2B7:before,.mi-uniF2B7:before{content:"\EF47"}.mi-F5AA:before,.mi-uniF5AA:before{content:"\EF48"}.mi-F614:before,.mi-uniF614:before{content:"\EF49"}.mi-F615:before,.mi-uniF615:before{content:"\EF4A"}.mi-F616:before,.mi-uniF616:before{content:"\EF4B"}.mi-F617:before,.mi-uniF617:before{content:"\EF4C"}.mi-F657:before,.mi-uniF657:before{content:"\EF4D"}.mi-F658:before,.mi-uniF658:before{content:"\EF4E"}.mi-F659:before,.mi-uniF659:before{content:"\EF4F"}.mi-F65A:before,.mi-uniF65A:before{content:"\EF50"}.mi-F65B:before,.mi-uniF65B:before{content:"\EF51"}.mi-F65C:before,.mi-uniF65C:before{content:"\EF52"}.mi-F69E:before,.mi-uniF69E:before{content:"\EF53"}.mi-F6FA:before,.mi-uniF6FA:before{content:"\EF54"}.mi-F712:before,.mi-uniF712:before{content:"\EF55"}.mi-F71C:before,.mi-uniF71C:before{content:"\EF56"}.mi-F71D:before,.mi-uniF71D:before{content:"\EF57"}.mi-F71E:before,.mi-uniF71E:before{content:"\EF58"}.mi-F738:before,.mi-uniF738:before{content:"\EF59"}.mi-F739:before,.mi-uniF739:before{content:"\EF5A"}.mi-F73D:before,.mi-uniF73D:before{content:"\EF5B"}.mi-F73E:before,.mi-uniF73E:before{content:"\EF5C"}.mi-F73F:before,.mi-uniF73F:before{content:"\EF5D"}.mi-F740:before,.mi-uniF740:before{content:"\EF5E"}.mi-F741:before,.mi-uniF741:before{content:"\EF5F"}.mi-F742:before,.mi-uniF742:before{content:"\EF60"}.mi-F743:before,.mi-uniF743:before{content:"\EF61"}.mi-F744:before,.mi-uniF744:before{content:"\EF62"}.mi-F745:before,.mi-uniF745:before{content:"\EF63"}.mi-F746:before,.mi-uniF746:before{content:"\EF64"}.mi-F785:before,.mi-uniF785:before{content:"\EF65"}.mi-500px:before{content:"\EF66"}.mi-accessible-icon:before{content:"\EF67"}.mi-accusoft:before{content:"\EF68"}.mi-acquisitions-incorporated:before{content:"\EF69"}.mi-adn:before{content:"\EF6A"}.mi-adobe:before{content:"\EF6B"}.mi-adversal:before{content:"\EF6C"}.mi-affiliatetheme:before{content:"\EF6D"}.mi-algolia:before{content:"\EF6E"}.mi-alipay:before{content:"\EF6F"}.mi-amazon-pay:before{content:"\EF70"}.mi-amazon:before{content:"\EF71"}.mi-amilia:before{content:"\EF72"}.mi-android:before{content:"\EF73"}.mi-angellist:before{content:"\EF74"}.mi-angrycreative:before{content:"\EF75"}.mi-angular:before{content:"\EF76"}.mi-app-store-ios:before{content:"\EF77"}.mi-app-store:before{content:"\EF78"}.mi-apper:before{content:"\EF79"}.mi-apple-pay:before{content:"\EF7A"}.mi-apple:before{content:"\EF7B"}.mi-artstation:before{content:"\EF7C"}.mi-asymmetrik:before{content:"\EF7D"}.mi-atlassian:before{content:"\EF7E"}.mi-audible:before{content:"\EF7F"}.mi-autoprefixer:before{content:"\EF80"}.mi-avianex:before{content:"\EF81"}.mi-aviato:before{content:"\EF82"}.mi-aws:before{content:"\EF83"}.mi-bandcamp:before{content:"\EF84"}.mi-behance-square:before{content:"\EF85"}.mi-behance:before{content:"\EF86"}.mi-bimobject:before{content:"\EF87"}.mi-bitbucket:before{content:"\EF88"}.mi-bitcoin:before{content:"\EF89"}.mi-bity:before{content:"\EF8A"}.mi-black-tie:before{content:"\EF8B"}.mi-blackberry:before{content:"\EF8C"}.mi-blogger-b:before{content:"\EF8D"}.mi-blogger:before{content:"\EF8E"}.mi-bluetooth-b:before{content:"\EF8F"}.mi-bluetooth:before{content:"\EF90"}.mi-btc:before{content:"\EF91"}.mi-buromobelexperte:before{content:"\EF92"}.mi-buysellads:before{content:"\EF93"}.mi-canadian-maple-leaf:before{content:"\EF94"}.mi-cc-amazon-pay:before{content:"\EF95"}.mi-cc-amex:before{content:"\EF96"}.mi-cc-apple-pay:before{content:"\EF97"}.mi-cc-diners-club:before{content:"\EF98"}.mi-cc-discover:before{content:"\EF99"}.mi-cc-jcb:before{content:"\EF9A"}.mi-cc-mastercard:before{content:"\EF9B"}.mi-cc-paypal:before{content:"\EF9C"}.mi-cc-stripe:before{content:"\EF9D"}.mi-cc-visa:before{content:"\EF9E"}.mi-centercode:before{content:"\EF9F"}.mi-centos:before{content:"\EFA0"}.mi-chrome:before{content:"\EFA1"}.mi-cloudscale:before{content:"\EFA2"}.mi-cloudsmith:before{content:"\EFA3"}.mi-cloudversify:before{content:"\EFA4"}.mi-codepen:before{content:"\EFA5"}.mi-codiepie:before{content:"\EFA6"}.mi-confluence:before{content:"\EFA7"}.mi-connectdevelop:before{content:"\EFA8"}.mi-contao:before{content:"\EFA9"}.mi-cpanel:before{content:"\EFAA"}.mi-creative-commons-by:before{content:"\EFAB"}.mi-creative-commons-nc-eu:before{content:"\EFAC"}.mi-creative-commons-nc-jp:before{content:"\EFAD"}.mi-creative-commons-nc:before{content:"\EFAE"}.mi-creative-commons-nd:before{content:"\EFAF"}.mi-creative-commons-pd-alt:before{content:"\EFB0"}.mi-creative-commons-pd:before{content:"\EFB1"}.mi-creative-commons-remix:before{content:"\EFB2"}.mi-creative-commons-sa:before{content:"\EFB3"}.mi-creative-commons-sampling-plus:before{content:"\EFB4"}.mi-creative-commons-sampling:before{content:"\EFB5"}.mi-creative-commons-share:before{content:"\EFB6"}.mi-creative-commons-zero:before{content:"\EFB7"}.mi-creative-commons:before{content:"\EFB8"}.mi-critical-role:before{content:"\EFB9"}.mi-css3-alt:before{content:"\EFBA"}.mi-css3:before{content:"\EFBB"}.mi-cuttlefish:before{content:"\EFBC"}.mi-d-and-d-beyond:before{content:"\EFBD"}.mi-d-and-d:before{content:"\EFBE"}.mi-dashcube:before{content:"\EFBF"}.mi-delicious:before{content:"\EFC0"}.mi-deploydog:before{content:"\EFC1"}.mi-deskpro:before{content:"\EFC2"}.mi-dev:before{content:"\EFC3"}.mi-deviantart:before{content:"\EFC4"}.mi-dhl:before{content:"\EFC5"}.mi-diaspora:before{content:"\EFC6"}.mi-digg:before{content:"\EFC7"}.mi-digital-ocean:before{content:"\EFC8"}.mi-discord:before{content:"\EFC9"}.mi-discourse:before{content:"\EFCA"}.mi-dochub:before{content:"\EFCB"}.mi-docker:before{content:"\EFCC"}.mi-draft2digital:before{content:"\EFCD"}.mi-dribbble-square:before{content:"\EFCE"}.mi-dribbble:before{content:"\EFCF"}.mi-dropbox:before{content:"\EFD0"}.mi-drupal:before{content:"\EFD1"}.mi-dyalog:before{content:"\EFD2"}.mi-earlybirds:before{content:"\EFD3"}.mi-ebay:before{content:"\EFD4"}.mi-edge:before{content:"\EFD5"}.mi-elementor:before{content:"\EFD6"}.mi-ello:before{content:"\EFD7"}.mi-ember:before{content:"\EFD8"}.mi-empire:before{content:"\EFD9"}.mi-envira:before{content:"\EFDA"}.mi-erlang:before{content:"\EFDB"}.mi-ethereum:before{content:"\EFDC"}.mi-etsy:before{content:"\EFDD"}.mi-expeditedssl:before{content:"\EFDE"}.mi-facebook-f:before{content:"\EFDF"}.mi-facebook-messenger:before{content:"\EFE0"}.mi-facebook-square:before{content:"\EFE1"}.mi-facebook:before{content:"\EFE2"}.mi-fedex:before{content:"\EFE3"}.mi-fedora:before{content:"\EFE4"}.mi-figma:before{content:"\EFE5"}.mi-firefox:before{content:"\EFE6"}.mi-first-order-alt:before{content:"\EFE7"}.mi-first-order:before{content:"\EFE8"}.mi-firstdraft:before{content:"\EFE9"}.mi-flickr:before{content:"\EFEA"}.mi-flipboard:before{content:"\EFEB"}.mi-fly:before{content:"\EFEC"}.mi-font-awesome-alt:before{content:"\EFED"}.mi-font-awesome-flag:before{content:"\EFEE"}.mi-font-awesome:before{content:"\EFEF"}.mi-fonticons-fi:before{content:"\EFF0"}.mi-fonticons:before{content:"\EFF1"}.mi-fort-awesome-alt:before{content:"\EFF2"}.mi-fort-awesome:before{content:"\EFF3"}.mi-forumbee:before{content:"\EFF4"}.mi-foursquare:before{content:"\EFF5"}.mi-free-code-camp:before{content:"\EFF6"}.mi-freebsd:before{content:"\EFF7"}.mi-fulcrum:before{content:"\EFF8"}.mi-galactic-republic:before{content:"\EFF9"}.mi-galactic-senate:before{content:"\EFFA"}.mi-get-pocket:before{content:"\EFFB"}.mi-gg-circle:before{content:"\EFFC"}.mi-gg:before{content:"\EFFD"}.mi-git-square:before{content:"\EFFE"}.mi-github-alt:before{content:"\EFFF"}.mi-github-square:before{content:"\F000"}.mi-github:before{content:"\F001"}.mi-gitkraken:before{content:"\F002"}.mi-gitlab:before{content:"\F003"}.mi-gitter:before{content:"\F004"}.mi-glide-g:before{content:"\F005"}.mi-glide:before{content:"\F006"}.mi-gofore:before{content:"\F007"}.mi-goodreads-g:before{content:"\F008"}.mi-goodreads:before{content:"\F009"}.mi-google-drive:before{content:"\F00A"}.mi-google-play:before{content:"\F00B"}.mi-google-plus-g:before{content:"\F00C"}.mi-google-plus-square:before{content:"\F00D"}.mi-google-plus:before{content:"\F00E"}.mi-google-wallet:before{content:"\F00F"}.mi-google:before{content:"\F010"}.mi-gratipay:before{content:"\F011"}.mi-grav:before{content:"\F012"}.mi-gripfire:before{content:"\F013"}.mi-grunt:before{content:"\F014"}.mi-gulp:before{content:"\F015"}.mi-hacker-news-square:before{content:"\F016"}.mi-hacker-news:before{content:"\F017"}.mi-hackerrank:before{content:"\F018"}.mi-hire-a-helper:before{content:"\F019"}.mi-hooli:before{content:"\F01A"}.mi-hornbill:before{content:"\F01B"}.mi-hotjar:before{content:"\F01C"}.mi-houzz:before{content:"\F01D"}.mi-html5:before{content:"\F01E"}.mi-hubspot:before{content:"\F01F"}.mi-imdb:before{content:"\F020"}.mi-instagram:before{content:"\F021"}.mi-intercom:before{content:"\F022"}.mi-internet-explorer:before{content:"\F023"}.mi-invision:before{content:"\F024"}.mi-ioxhost:before{content:"\F025"}.mi-itunes-note:before{content:"\F026"}.mi-itunes:before{content:"\F027"}.mi-java:before{content:"\F028"}.mi-jedi-order:before{content:"\F029"}.mi-jenkins:before{content:"\F02A"}.mi-jira:before{content:"\F02B"}.mi-joget:before{content:"\F02C"}.mi-joomla:before{content:"\F02D"}.mi-js-square:before{content:"\F02E"}.mi-js:before{content:"\F02F"}.mi-jsfiddle:before{content:"\F030"}.mi-kaggle:before{content:"\F031"}.mi-keybase:before{content:"\F032"}.mi-keycdn:before{content:"\F033"}.mi-kickstarter-k:before{content:"\F034"}.mi-kickstarter:before{content:"\F035"}.mi-korvue:before{content:"\F036"}.mi-laravel:before{content:"\F037"}.mi-lastfm-square:before{content:"\F038"}.mi-lastfm:before{content:"\F039"}.mi-leanpub:before{content:"\F03A"}.mi-less:before{content:"\F03B"}.mi-line:before{content:"\F03C"}.mi-linkedin-in:before{content:"\F03D"}.mi-linkedin:before{content:"\F03E"}.mi-linode:before{content:"\F03F"}.mi-linux:before{content:"\F040"}.mi-lyft:before{content:"\F041"}.mi-magento:before{content:"\F042"}.mi-mailchimp:before{content:"\F043"}.mi-mandalorian:before{content:"\F044"}.mi-markdown:before{content:"\F045"}.mi-mastodon:before{content:"\F046"}.mi-maxcdn:before{content:"\F047"}.mi-medapps:before{content:"\F048"}.mi-medium-m:before{content:"\F049"}.mi-medium:before{content:"\F04A"}.mi-medrt:before{content:"\F04B"}.mi-meetup:before{content:"\F04C"}.mi-megaport:before{content:"\F04D"}.mi-mendeley:before{content:"\F04E"}.mi-microsoft:before{content:"\F04F"}.mi-mix:before{content:"\F050"}.mi-mixcloud:before{content:"\F051"}.mi-mizuni:before{content:"\F052"}.mi-modx:before{content:"\F053"}.mi-monero:before{content:"\F054"}.mi-napster:before{content:"\F055"}.mi-neos:before{content:"\F056"}.mi-nimblr:before{content:"\F057"}.mi-nintendo-switch:before{content:"\F058"}.mi-node-js:before{content:"\F059"}.mi-node:before{content:"\F05A"}.mi-npm:before{content:"\F05B"}.mi-ns8:before{content:"\F05C"}.mi-nutritionix:before{content:"\F05D"}.mi-odnoklassniki-square:before{content:"\F05E"}.mi-odnoklassniki:before{content:"\F05F"}.mi-old-republic:before{content:"\F060"}.mi-opencart:before{content:"\F061"}.mi-openid:before{content:"\F062"}.mi-opera:before{content:"\F063"}.mi-optin-monster:before{content:"\F064"}.mi-osi:before{content:"\F065"}.mi-page4:before{content:"\F066"}.mi-pagelines:before{content:"\F067"}.mi-palfed:before{content:"\F068"}.mi-patreon:before{content:"\F069"}.mi-paypal:before{content:"\F06A"}.mi-penny-arcade:before{content:"\F06B"}.mi-periscope:before{content:"\F06C"}.mi-phabricator:before{content:"\F06D"}.mi-phoenix-framework:before{content:"\F06E"}.mi-phoenix-squadron:before{content:"\F06F"}.mi-php:before{content:"\F070"}.mi-pied-piper-alt:before{content:"\F071"}.mi-pied-piper-hat:before{content:"\F072"}.mi-pied-piper-pp:before{content:"\F073"}.mi-pied-piper:before{content:"\F074"}.mi-pinterest-p:before{content:"\F075"}.mi-pinterest-square:before{content:"\F076"}.mi-pinterest:before{content:"\F077"}.mi-playstation:before{content:"\F078"}.mi-product-hunt:before{content:"\F079"}.mi-pushed:before{content:"\F07A"}.mi-python:before{content:"\F07B"}.mi-qq:before{content:"\F07C"}.mi-quinscape:before{content:"\F07D"}.mi-quora:before{content:"\F07E"}.mi-r-project:before{content:"\F07F"}.mi-raspberry-pi:before{content:"\F080"}.mi-ravelry:before{content:"\F081"}.mi-react:before{content:"\F082"}.mi-reacteurope:before{content:"\F083"}.mi-readme:before{content:"\F084"}.mi-rebel:before{content:"\F085"}.mi-red-river:before{content:"\F086"}.mi-reddit-alien:before{content:"\F087"}.mi-reddit-square:before{content:"\F088"}.mi-reddit:before{content:"\F089"}.mi-redhat:before{content:"\F08A"}.mi-renren:before{content:"\F08B"}.mi-replyd:before{content:"\F08C"}.mi-researchgate:before{content:"\F08D"}.mi-resolving:before{content:"\F08E"}.mi-rev:before{content:"\F08F"}.mi-rocketchat:before{content:"\F090"}.mi-rockrms:before{content:"\F091"}.mi-safari:before{content:"\F092"}.mi-sass:before{content:"\F093"}.mi-schlix:before{content:"\F094"}.mi-scribd:before{content:"\F095"}.mi-searchengin:before{content:"\F096"}.mi-sellcast:before{content:"\F097"}.mi-sellsy:before{content:"\F098"}.mi-servicestack:before{content:"\F099"}.mi-shirtsinbulk:before{content:"\F09A"}.mi-shopware:before{content:"\F09B"}.mi-simplybuilt:before{content:"\F09C"}.mi-sistrix:before{content:"\F09D"}.mi-sith:before{content:"\F09E"}.mi-sketch:before{content:"\F09F"}.mi-skyatlas:before{content:"\F0A0"}.mi-skype:before{content:"\F0A1"}.mi-slack-hash:before{content:"\F0A2"}.mi-slack:before{content:"\F0A3"}.mi-slideshare:before{content:"\F0A4"}.mi-snapchat-ghost:before{content:"\F0A5"}.mi-snapchat-square:before{content:"\F0A6"}.mi-snapchat:before{content:"\F0A7"}.mi-soundcloud:before{content:"\F0A8"}.mi-sourcetree:before{content:"\F0A9"}.mi-speakap:before{content:"\F0AA"}.mi-spotify:before{content:"\F0AB"}.mi-squarespace:before{content:"\F0AC"}.mi-stack-exchange:before{content:"\F0AD"}.mi-stack-overflow:before{content:"\F0AE"}.mi-staylinked:before{content:"\F0AF"}.mi-steam-square:before{content:"\F0B0"}.mi-steam:before{content:"\F0B1"}.mi-sticker-mule:before{content:"\F0B2"}.mi-strava:before{content:"\F0B3"}.mi-stripe-s:before{content:"\F0B4"}.mi-stripe:before{content:"\F0B5"}.mi-studiovinari:before{content:"\F0B6"}.mi-stumbleupon-circle:before{content:"\F0B7"}.mi-stumbleupon:before{content:"\F0B8"}.mi-superpowers:before{content:"\F0B9"}.mi-supple:before{content:"\F0BA"}.mi-suse:before{content:"\F0BB"}.mi-teamspeak:before{content:"\F0BC"}.mi-telegram-plane:before{content:"\F0BD"}.mi-telegram:before{content:"\F0BE"}.mi-tencent-weibo:before{content:"\F0BF"}.mi-the-red-yeti:before{content:"\F0C0"}.mi-themeco:before{content:"\F0C1"}.mi-themeisle:before{content:"\F0C2"}.mi-think-peaks:before{content:"\F0C3"}.mi-trade-federation:before{content:"\F0C4"}.mi-trello:before{content:"\F0C5"}.mi-tripadvisor:before{content:"\F0C6"}.mi-tumblr-square:before{content:"\F0C7"}.mi-tumblr:before{content:"\F0C8"}.mi-twitch:before{content:"\F0C9"}.mi-twitter-square:before{content:"\F0CA"}.mi-typo3:before{content:"\F0CB"}.mi-ubuntu:before{content:"\F0CC"}.mi-uikit:before{content:"\F0CD"}.mi-uniregistry:before{content:"\F0CE"}.mi-untappd:before{content:"\F0CF"}.mi-ups:before{content:"\F0D0"}.mi-usb:before{content:"\F0D1"}.mi-usps:before{content:"\F0D2"}.mi-ussunnah:before{content:"\F0D3"}.mi-vaadin:before{content:"\F0D4"}.mi-viacoin:before{content:"\F0D5"}.mi-viadeo-square:before{content:"\F0D6"}.mi-viadeo:before{content:"\F0D7"}.mi-viber:before{content:"\F0D8"}.mi-vimeo-square:before{content:"\F0D9"}.mi-vimeo-v:before{content:"\F0DA"}.mi-vimeo:before{content:"\F0DB"}.mi-vine:before{content:"\F0DC"}.mi-vk:before{content:"\F0DD"}.mi-vnv:before{content:"\F0DE"}.mi-vuejs:before{content:"\F0DF"}.mi-weebly:before{content:"\F0E0"}.mi-weibo:before{content:"\F0E1"}.mi-weixin:before{content:"\F0E2"}.mi-whatsapp-square:before{content:"\F0E3"}.mi-whatsapp:before{content:"\F0E4"}.mi-whmcs:before{content:"\F0E5"}.mi-wikipedia-w:before{content:"\F0E6"}.mi-windows:before{content:"\F0E7"}.mi-wix:before{content:"\F0E8"}.mi-wizards-of-the-coast:before{content:"\F0E9"}.mi-wolf-pack-battalion:before{content:"\F0EA"}.mi-wordpress-simple:before{content:"\F0EB"}.mi-wordpress:before{content:"\F0EC"}.mi-wpbeginner:before{content:"\F0ED"}.mi-wpexplorer:before{content:"\F0EE"}.mi-wpforms:before{content:"\F0EF"}.mi-wpressr:before{content:"\F0F0"}.mi-xbox:before{content:"\F0F1"}.mi-xing-square:before{content:"\F0F2"}.mi-xing:before{content:"\F0F3"}.mi-y-combinator:before{content:"\F0F4"}.mi-yahoo:before{content:"\F0F5"}.mi-yandex-international:before{content:"\F0F6"}.mi-yandex:before{content:"\F0F7"}.mi-yarn:before{content:"\F0F8"}.mi-yelp:before{content:"\F0F9"}.mi-yoast:before{content:"\F0FA"}.mi-youtube-square:before{content:"\F0FB"}.mi-youtube:before{content:"\F0FC"}.mi-zhihu:before{content:"\F0FD"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto} \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-client.min.js b/src/Mix.Cms.Web/wwwroot/mix-app/js/app-client.min.js deleted file mode 100644 index c386df743..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-client.min.js +++ /dev/null @@ -1,2224 +0,0 @@ -"use strict"; - -var app = angular.module("MixClient", [ - "ngRoute", - "LocalStorageModule", - "components", - "ngFileUpload", - "angularCroppie", - "ui.bootstrap", - "cart", - "ngSanitize", -]); - -var serviceBase = ""; -var modules = angular.module("components", []); -var cart = angular.module("cart", []); - -// This is the "Offline page" service worker -// Add this below content to your HTML page, or add the js file to your page at the very top to register service worker -// Check compatibility for the browser we're running this in -// if ("serviceWorker" in navigator) { -// if (navigator.serviceWorker.controller) { -// console.log("[PWA Builder] active service worker found, no need to register"); -// } else { -// // Register the service worker -// navigator.serviceWorker -// .register("service-worker.js", { -// scope: "./" -// }) -// .then(function (reg) { -// console.log("[PWA Builder] Service worker has been registered for scope: " + reg.scope); -// }); -// } -// } - -(function (angular) { - "use strict"; - app.controller("AppClientController", [ - "$rootScope", - "$scope", - "GlobalSettingsService", - "CommonService", - "AuthService", - "localStorageService", - "TranslatorService", - "SharedModuleDataService", - "RestMixDatabaseDataClientService", - function ( - $rootScope, - $scope, - globalSettingsService, - commonService, - authService, - localStorageService, - translatorService, - moduleDataService, - attrDataService - ) { - $scope.lang = ""; - $scope.isInit = false; - $scope.isLoaded = false; - $rootScope.user = null; - $scope.mediaFile = { - file: null, - fullPath: "", - folder: "module-data", - title: "", - description: "", - }; - $scope.cartData = { - items: [], - totalItems: 0, - total: 0, - }; - $rootScope.globalSettingsService = globalSettingsService; - $scope.changeLang = $rootScope.changeLang; - $scope.init = function (lang) { - attrDataService.init(attrDataService.modelName, false, lang); - if (!$rootScope.isBusy) { - $rootScope.isBusy = true; - // globalSettingsService.fillGlobalSettings().then(function (response) { - $scope.cartData = localStorageService.get("shoppingCart"); - if (!$scope.cartData) { - $scope.cartData = { - items: [], - totalItems: 0, - total: 0, - }; - } - commonService.fillAllSettings(lang).then(function (response) { - if ($rootScope.globalSettings) { - authService.fillAuthData().then(function (response) { - $rootScope.authentication = authService.authentication; - $scope.isInit = true; - $rootScope.isInit = true; - $rootScope.isBusy = false; - $scope.$apply(); - }); - - // }); - } else { - $scope.isInit = true; - $rootScope.isInit = true; - $rootScope.isBusy = false; - } - }); - - // }); - } - - // $(document).on('click', 'a', function(e){ - // var href = $(this).attr('href'); - // var target = $(this).attr('target'); - // if(!$(this).hasClass('each-portfolio') && href && href.indexOf('#') !== 0 && target!='_blank'){ - // e.preventDefault(); - // $scope.$apply($scope.isBusy = true); - // setTimeout(() => { - // // window.location.href = href; - // window.open(href, target || '_top'); - // }, (200)); - // } - // }); - }; - - $scope.translate = $rootScope.translate; - $scope.previewData = function (moduleId, id) { - var obj = { - moduleId: moduleId, - id: id, - }; - $rootScope.preview("module-data", obj, null, "modal-lg"); - }; - - $scope.initModuleForm = async function ( - name, - successCallback, - failCallback - ) { - var resp = null; - $scope.successCallback = successCallback; - $scope.failCallback = failCallback; - setTimeout(async () => { - $scope.name = name; - if ($scope.id) { - resp = await moduleDataService.getModuleData( - $scope.id, - $scope.dataId, - "portal" - ); - } else { - resp = await moduleDataService.initModuleForm($scope.name); - } - - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - if ($scope.errorCallback) { - $rootScope.executeFunctionByName( - $scope.errorCallback, - [resp], - window - ); - } else { - $rootScope.showErrors(resp.errors); - } - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }, 500); - }; - - $scope.initMixDatabaseForm = async function (formName) { - return await attrDataService.initData(formName).data; - }; - - $scope.saveModuleData = async function () { - var resp = await moduleDataService.saveModuleData( - $scope.activedModuleData - ); - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - if ($scope.successCallback) { - $rootScope.executeFunctionByName( - $scope.successCallback, - [resp], - window - ); - } else { - var msg = - $rootScope.settings.data["employee_success_msg"] || - "Thank you for submitting! Your lovely photo is well received 😊"; - $rootScope.showConfirm($scope, "", [], null, "", msg); - } - - $rootScope.isBusy = false; - $scope.initModuleForm($scope.name); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - if ($scope.failCallback) { - $rootScope.executeFunctionByName( - $scope.failCallback, - [resp], - window - ); - } else { - $rootScope.showErrors(resp.errors); - } - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.shareFB = function (url) { - FB.ui( - { - method: "share", - href: url, - }, - function (response) {} - ); - }; - $scope.shareTwitter = function (url, content) { - var text = encodeURIComponent(content); - var shareUrl = - "https://twitter.com/intent/tweet?url=" + url + "&text=" + text; - var win = window.open(shareUrl, "ShareOnTwitter", getWindowOptions()); - win.opener = null; // 2 - }; - $scope.saveShoppingCart = function () { - localStorageService.set("shoppingCart", $scope.cartData); - }; - - var getWindowOptions = function () { - var width = 500; - var height = 350; - var left = window.innerWidth / 2 - width / 2; - var top = window.innerHeight / 2 - height / 2; - - return [ - "resizable,scrollbars,status", - "height=" + height, - "width=" + width, - "left=" + left, - "top=" + top, - ].join(); - }; - window.load = function () { - $scope.$apply(($scope.isLoaded = true)); - }; - }, - ]); -})(window.angular); - -modules.component('addToCartButton', { - templateUrl: '/mix-app/views/app-client/components/add-to-cart-button/view.html', - controller: ['$rootScope', 'localStorageService', - function ($rootScope, localStorageService) { - var ctrl = this; - ctrl.addToCart = function () { - var current = $rootScope.findObjectByKey(ctrl.cartData.items, 'propertyId', ctrl.propertyId); - if (current) { - current.quantity += parseInt(ctrl.quantity); - } - else { - var item = { - propertyId: ctrl.propertyId, - title: ctrl.title, - imageUrl: ctrl.imageUrl, - price: ctrl.price, - quantity: parseInt(ctrl.quantity) || 1 - }; - ctrl.cartData.items.push(item); - ctrl.cartData.totalItems += 1; - } - ctrl.cartData.total += parseInt(ctrl.price); - localStorageService.set('shoppingCart', ctrl.cartData); - } - } - ], - bindings: { - cartData: '=', - propertyId: '=', - title: '=', - imageUrl: '=', - price: '=', - quantity: '=', - } -}); -modules.component('booking', { - templateUrl: '/mix-app/views/app-client/components/booking/index.html', - controller: [ - '$rootScope', 'CommonService', - function ($rootScope, commonService) { - var ctrl = this; - ctrl.submitted = false; - ctrl.isShow = false; - ctrl.order = { - name: '', - propertyId: '', - price: '', - quantity: 1 - }; - ctrl.edm = 'Url: View Tour
Name: [name]
' - + 'Phone: [phone]
' - + 'Email: [email]
' - + 'Quantity: [quantity]
' - + 'Message: [message]
' - + 'property: [property]
Price: [price]
'; - ctrl.init = function () { - if (!$rootScope.isInit) { - setTimeout(function () { ctrl.init(); }, 500); - } else { - ctrl.order.propertyId = ctrl.propertyId; - ctrl.order.price = ctrl.price; - ctrl.order.quantity = ctrl.quantity; - } - } - ctrl.book = function () { - ctrl.edm = ctrl.edm.replace(/\[url\]/g, window.top.location.href); - ctrl.edm = ctrl.edm.replace(/\[name\]/g, ctrl.order.name); - ctrl.edm = ctrl.edm.replace(/\[phone\]/g, ctrl.order.phone); - ctrl.edm = ctrl.edm.replace(/\[email\]/g, ctrl.order.email); - ctrl.edm = ctrl.edm.replace(/\[message\]/g, ctrl.order.message); - ctrl.edm = ctrl.edm.replace(/\[property\]/g, ctrl.order.propertyId); - ctrl.edm = ctrl.edm.replace(/\[price\]/g, ctrl.order.price); - ctrl.edm = ctrl.edm.replace(/\[quantity\]/g, ctrl.order.quantity); - - commonService.sendMail('Booking - ' + ctrl.propertyName, ctrl.edm); - ctrl.submitted = true; - } - } - ], - bindings: { - propertyId: '=', - propertyName: '=', - price: '=', - quantity: '=', - } -}); - -modules.component('fbCustomerChat', { - templateUrl: '/mix-app/views/app-client/components/fb-customer-chat/view.html', - controller: ['$location', function ($location) { - var ctrl = this; - this.$onInit = function () { - setTimeout(() => { - FB.XFBML.parse(); - }, 200); - } - }], - bindings: { - fbPageId: '=', - themeColor: '=', - inGreeting: '=', - outGreeting: '=' - } -}); - -modules.component('fbLike', { - templateUrl: '/mix-app/views/app-client/components/fb-like/fb-like.html', - controller: ['$location', function ($location) { - var ctrl = this; - ctrl.href = ctrl.href || window.top.location.href; - ctrl.layout = ctrl.layout || 'standard'; - ctrl.size = ctrl.size || 'small'; - ctrl.showFaces = ctrl.showFaces || true; - this.$onInit = function () { - setTimeout(() => { - FB.XFBML.parse(); - }, 200); - } - }], - bindings: { - href: '=', - layout: '=', - size: '=', - showFaces: '=' - } -}); -modules.component("fbLogin", { - templateUrl: "/mix-app/views/app-client/components/fb-login/view.html", - controller: [ - "$rootScope", - "$scope", - "$location", - function ($rootScope, $scope, $location) { - var ctrl = this; - ctrl.loginStatus = null; - ctrl.$onInit = function () { - ctrl.checkLoginState(); - }; - ctrl.translate = $rootScope.translate; - ctrl.login = function () { - FB.login( - function (response) { - ctrl.statusChangeCallback(response); - }, - { scope: "public_profile,email" } - ); - }; - ctrl.logout = function () { - FB.getLoginStatus(function (response) { - if (response.status === "connected") { - FB.logout(function (response) { - ctrl.loggedIn = false; - ctrl.profile = null; - $scope.$apply(); - }); - } - }); - }; - ctrl.getProfile = function () { - FB.api("/me", "GET", { fields: "id,name,email" }, function (response) { - ctrl.profile = response; - ctrl.loggedIn = true; - $scope.$apply(); - }); t - }; - ctrl.checkLoginState = function () { - FB.getLoginStatus(function (response) { - ctrl.statusChangeCallback(response); - ctrl.loginStatus = response; - }); - }; - ctrl.statusChangeCallback = function (response) { - // Called with the results from FB.getLoginStatus(). - if (response.status === "connected") { - // Logged into your webpage and Facebook. - ctrl.getProfile(); - } - }; - }, - ], - bindings: { - fbPageId: "=", - themeColor: "=", - inGreeting: "=", - outGreeting: "=", - }, -}); - - -modules.component('fbSend', { - templateUrl: '/mix-app/views/app-client/components/fb-send/fb-send.html', - controller: ['$location', function ($location) { - var ctrl = this; - ctrl.href = ctrl.href || window.top.location.href; - ctrl.send = function () { - var link = ctrl.href || window.top.location.href; - FB.ui({ - method: 'send', - link: link, - }, function (response) { }); - }; - }], - bindings: { - href: '=', - appId: '=' - } -}); - -modules.component('fbShare', { - templateUrl: '/mix-app/views/app-client/components/fb-share/fb-share.html', - controller: ['$location', function ($location) { - var ctrl = this; - ctrl.href = ctrl.href || window.top.location.href; - ctrl.share = function () { - var href = window.top.location.href; - FB.ui({ - method: 'share', - href: href, - }, function (response) { }); - }; - }], - bindings: { - href: '=' - } -}); -modules.component('googlePay', { - templateUrl: '/mix-app/views/app-client/components/google-pay/view.html', - controller: [ - '$rootScope', 'CommonService', - function ($rootScope, commonService) { - var ctrl = this; - ctrl.baseRequest = { - apiVersion: 2, - apiVersionMinor: 0 - }; - ctrl.tokenizationSpecification = { - type: 'PAYMENT_GATEWAY', - parameters: { - 'gateway': 'example', - 'gatewayMerchantId': 'exampleGatewayMerchantId' - } - }; - ctrl.allowedCardNetworks = ["AMEX", "DISCOVER", "JCB", "MASTERCARD", "VISA"]; - ctrl.allowedCardAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"]; - ctrl.baseCardPaymentMethod = { - type: 'CARD', - parameters: { - allowedAuthMethods: ctrl.allowedCardAuthMethods, - allowedCardNetworks: ctrl.allowedCardNetworks - } - }; - ctrl.cardPaymentMethod = Object.assign( - { tokenizationSpecification: ctrl.tokenizationSpecification }, - ctrl.baseCardPaymentMethod - ); - ctrl.paymentsClient = null; - ctrl.paymentDataRequest = null; - ctrl.getGoogleIsReadyToPayRequest = function () { - return Object.assign( - {}, - ctrl.baseRequest, - { - allowedPaymentMethods: [ctrl.baseCardPaymentMethod] - } - ); - }; - ctrl.getGooglePaymentDataRequest = function () { - ctrl.paymentDataRequest = Object.assign({}, ctrl.baseRequest); - ctrl.paymentDataRequest.allowedPaymentMethods = [ctrl.cardPaymentMethod]; - ctrl.paymentDataRequest.transactionInfo = ctrl.getGoogleTransactionInfo(); - ctrl.paymentDataRequest.merchantInfo = { - // @todo a merchant ID is available for a production environment after approval by Google - // See {@link https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-checklist|Integration checklist} - merchantId: '01234567890123456789', - merchantName: 'Example Merchant' - }; - return ctrl.paymentDataRequest; - }; - ctrl.getGooglePaymentsClient = function () { - if (ctrl.paymentsClient === null) { - ctrl.paymentsClient = new google.payments.api.PaymentsClient({ environment: 'TEST' }); - } - return ctrl.paymentsClient; - } - ctrl.onGooglePayLoaded = function () { - ctrl.paymentsClient = ctrl.getGooglePaymentsClient(); - ctrl.paymentsClient.isReadyToPay(ctrl.getGoogleIsReadyToPayRequest()) - .then(function (response) { - if (response.result) { - ctrl.addGooglePayButton(); - // @todo prefetch payment data to improve performance after confirming site functionality - // prefetchGooglePaymentData(); - } - }) - .catch(function (err) { - // show error in developer console for debugging - console.error(err); - }); - }; - ctrl.addGooglePayButton = function () { - ctrl.paymentsClient = ctrl.getGooglePaymentsClient(); - const button = - ctrl.paymentsClient.createButton({ onClick: ctrl.onGooglePaymentButtonClicked }); - document.getElementById('container').appendChild(button); - }; - ctrl.getGoogleTransactionInfo = function () { - return { - currencyCode: ctrl.currencyCode || 'USD', - totalPriceStatus: ctrl.totalPriceStatus || 'FINAL', - // set to cart total - totalPrice: ctrl.totalPrice || '0.00' - }; - }; - ctrl.prefetchGooglePaymentData = function () { - ctrl.paymentDataRequest = ctrl.getGooglePaymentDataRequest(); - // transactionInfo must be set but does not affect cache - ctrl.paymentDataRequest.transactionInfo = { - totalPriceStatus: 'NOT_CURRENTLY_KNOWN', - currencyCode: 'USD' - }; - ctrl.paymentsClient = ctrl.getGooglePaymentsClient(); - ctrl.paymentsClient.prefetchPaymentData(ctrl.paymentDataRequest); - }; - ctrl.onGooglePaymentButtonClicked = function () { - ctrl.paymentDataRequest = ctrl.getGooglePaymentDataRequest(); - ctrl.paymentDataRequest.transactionInfo = ctrl.getGoogleTransactionInfo(); - - ctrl.paymentsClient = ctrl.getGooglePaymentsClient(); - ctrl.paymentsClient.loadPaymentData(ctrl.paymentDataRequest) - .then(function (paymentData) { - // handle the response - ctrl.processPayment(paymentData); - }) - .catch(function (err) { - // show error in developer console for debugging - console.error(err); - }); - }; - ctrl.processPayment = function (paymentData) { - // show returned data in developer console for debugging - // console.log(paymentData); - // @todo pass payment token to your gateway to process payment - paymentToken = paymentData.paymentMethodData.tokenizationData.token; - }; - ctrl.init = function () { - setTimeout(() => { - ctrl.onGooglePayLoaded(); - }, 1000); - } - } - ], - bindings: { - totalPriceStatus: '=', - currencyCode: '=', - totalPrice: '=' - } -}); -modules.component("mixMessagesHubClient", { - templateUrl: - "/mix-app/views/app-client/components/mix-messages-hub-client/view.html", - bindings: { - attrSetName: "=", - isSave: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - "RestMixDatabaseDataClientService", - function ($rootScope, $scope, fieldService, service) { - var ctrl = this; - BaseHub.call(this, ctrl); - ctrl.settings = $rootScope.globalSettings; - ctrl.user = { - loggedIn: false, - connection: {}, - }; - ctrl.attrData = null; - ctrl.isHide = true; - ctrl.hideContact = true; - ctrl.fields = []; - ctrl.members = []; - ctrl.errors = []; - ctrl.messages = { - items: [], - }; - ctrl.message = { connection: {}, content: "" }; - ctrl.request = { - uid: "", - specificulture: "", - action: "", - objectType: null, - data: {}, - room: "", - isMyself: true, - isSave: false, - }; - ctrl.init = function () { - ctrl.attrSetId = ctrl.attrSetId || 0; - ctrl.request.specificulture = service.lang; - ctrl.request.room = ctrl.attrSetName; - ctrl.request.isSave = ctrl.isSave || false; - ctrl.startConnection("serviceHub", ctrl.checkLoginStatus); - }; - ctrl.loadData = async function () { - /* - If input is data id => load ctrl.attrData from service and handle it independently - Else modify input ctrl.attrData - */ - $rootScope.isBusy = true; - var getDefault = await service.initData(ctrl.attrSetName); - if (getDefault.isSucceed) { - ctrl.defaultData = getDefault.data; - ctrl.defaultData.data.user_name = ctrl.user.connection.name; - ctrl.defaultData.data.user_id = ctrl.user.connection.id; - ctrl.defaultData.data.user_avatar = ctrl.user.connection.avatar; - ctrl.defaultData.data.data_type = 9; - ctrl.defaultData.field = { - dataType: 9, - title: "Message", - name: "message", - }; - ctrl.attrData = angular.copy(ctrl.defaultData); - $rootScope.isBusy = false; - } - var getFields = await fieldService.initData(ctrl.attrSetName); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - ctrl.msgField = $rootScope.findObjectByKey( - ctrl.fields, - "name", - "message" - ); - } - }; - ctrl.submit = async function () { - if (ctrl.validate()) { - ctrl.request.action = "send_group_message"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.attrData.data; - ctrl.request.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - ctrl.attrData = angular.copy(ctrl.defaultData); - } - }; - ctrl.validate = function () { - var isValid = true; - ctrl.errors = []; - angular.forEach(ctrl.fields, function (field) { - if (field.regex) { - var regex = RegExp(field.regex, "g"); - isValid = regex.test(ctrl.attrData.data[field.name]); - if (!isValid) { - if (field.name == "message") { - ctrl.errors.push("Please don't use bad words in your message"); - } else { - ctrl.errors.push(`${field.name} is not match Regex`); - } - } - } - if (isValid && field.isEncrypt) { - ctrl.attrData.data[field.name] = $rootScope.encrypt( - ctrl.attrData.data[field.name] - ); - } - }); - return isValid; - }; - ctrl.receiveMessage = function (msg) { - switch (msg.responseKey) { - case "NewMember": - ctrl.newMember(msg.data); - // $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - case "NewMessage": - ctrl.newMessage(msg.data); - break; - case "ConnectSuccess": - ctrl.user.loggedIn = true; - ctrl.initListMember(msg.data); - $scope.$apply(); - break; - case "PreviousMessages": - msg.data.items.forEach((element) => { - element.msgField = angular.copy(ctrl.msgField); - element.msgField.dataType = element.data.data_type; - }); - ctrl.messages = msg.data; - $scope.$apply(); - break; - case "MemberOffline": - ctrl.removeMember(msg.data); - break; - case "Error": - console.error(msg.data); - break; - } - }; - ctrl.newMessage = function (msg) { - msg.msgField = angular.copy(ctrl.msgField); - ctrl.messages.items.push(msg); - $scope.$apply(); - }; - ctrl.newMember = function (member) { - var m = $rootScope.findObjectByKey(ctrl.members, "id", member.id); - if (!m) { - ctrl.members.push(member); - } - $scope.$apply(); - }; - ctrl.join = async function () { - ctrl.request.action = "join_group"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.user.connection; - ctrl.message.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - await ctrl.loadData(); - $scope.$apply(); - }; - ctrl.initListMember = function (data) { - data.forEach((member) => { - var index = ctrl.members.findIndex((x) => x.id === member.id); - if (index < 0) { - ctrl.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - }; - ctrl.updateDataType = function () { - ctrl.attrData.data.data_type = ctrl.msgField.dataType; - }; - ctrl.checkLoginStatus = function () { - FB.getLoginStatus(function (response) { - if (response.status === "connected") { - // The user is logged in and has authenticated your - // app, and response.authResponse supplies - // the user's ID, a valid access token, a signed - // request, and the time the access token - // and signed request each expire. - FB.api("/me", function (response) { - ctrl.user.connection.name = response.name; - ctrl.user.connection.id = response.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = - "//graph.facebook.com/" + - response.id + - "/picture?width=32&height=32"; - ctrl.user.loggedIn = true; - ctrl.join(); - }); - } else if (response.status === "authorization_expired") { - // The user has signed into your application with - // Facebook Login but must go through the login flow - // again to renew data authorization. You might remind - // the user they've used Facebook, or hide other options - // to avoid duplicate account creation, but you should - // collect a user gesture (e.g. click/touch) to launch the - // login dialog so popup blocking is not triggered. - } else if (response.status === "not_authorized") { - // The user hasn't authorized your application. They - // must click the Login button, or you must call FB.login - // in response to a user gesture, to launch a login dialog. - } else { - // The user isn't logged in to Facebook. You can launch a - // login dialog with a user gesture, but the user may have - // to log in to Facebook before authorizing your application. - } - }); - }; - ctrl.logout = function () { - FB.logout(function (response) { - // user is now logged out - ctrl.user.loggedIn = false; - }); - }; - ctrl.login = function () { - FB.login(function (response) { - if (response.authResponse) { - FB.api("/me", function (response) { - ctrl.user.connection.name = response.name; - ctrl.user.connection.id = response.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = - "//graph.facebook.com/" + - response.id + - "/picture?width=32&height=32"; - ctrl.user.loggedIn = true; - ctrl.join(); - $scope.$apply(); - }); - } else { - console.log("User cancelled login or did not fully authorize."); - } - }); - }; - }, - ], -}); - -modules.component("serviceHubClient", { - templateUrl: - "/mix-app/views/app-client/components/service-hub-client/view.html", - bindings: { - attrSetName: "=", - isSave: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - "RestMixDatabaseDataClientService", - function ($rootScope, $scope, fieldService, service) { - var ctrl = this; - BaseHub.call(this, ctrl); - ctrl.settings = $rootScope.globalSettings; - ctrl.user = { - loggedIn: false, - connection: {}, - }; - ctrl.attrData = null; - ctrl.isHide = true; - ctrl.hideContact = true; - ctrl.fields = []; - ctrl.members = []; - ctrl.errors = []; - ctrl.messages = { - items: [], - }; - ctrl.message = { connection: {}, content: "" }; - ctrl.request = { - uid: "", - specificulture: "", - action: "", - objectType: null, - data: {}, - room: "", - isMyself: true, - isSave: false, - }; - ctrl.init = function () { - ctrl.attrSetId = ctrl.attrSetId || 0; - ctrl.request.specificulture = service.lang; - ctrl.request.room = ctrl.attrSetName; - ctrl.request.isSave = ctrl.isSave == "true" || false; - ctrl.startConnection("serviceHub", ctrl.checkLoginStatus); - }; - ctrl.loadData = async function () { - /* - If input is data id => load ctrl.attrData from service and handle it independently - Else modify input ctrl.attrData - */ - $rootScope.isBusy = true; - var getDefault = await service.initData(ctrl.attrSetName); - if (getDefault.isSucceed) { - ctrl.defaultData = getDefault.data; - ctrl.defaultData.data.user_name = ctrl.user.connection.name; - ctrl.defaultData.data.user_id = ctrl.user.connection.id; - ctrl.defaultData.data.user_avatar = ctrl.user.connection.avatar; - ctrl.defaultData.data.data_type = 9; - ctrl.attrData = angular.copy(ctrl.defaultData); - $rootScope.isBusy = false; - } - var getFields = await fieldService.initData(ctrl.attrSetName); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - } - }; - ctrl.submit = async function () { - if (ctrl.validate()) { - ctrl.request.action = "send_group_message"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.attrData.data; - ctrl.request.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - ctrl.attrData = angular.copy(ctrl.defaultData); - } - }; - ctrl.validate = function () { - var isValid = true; - ctrl.errors = []; - angular.forEach(ctrl.fields, function (field) { - if (field.regex) { - var regex = RegExp(field.regex, "g"); - isValid = regex.test(ctrl.attrData.data[field.name]); - if (!isValid) { - ctrl.errors.push(`${field.name} is not match Regex`); - } - } - if (isValid && field.isEncrypt) { - ctrl.attrData.data[field.name] = $rootScope.encrypt( - ctrl.attrData.data[field.name] - ); - } - }); - return isValid; - }; - ctrl.receiveMessage = function (msg) { - switch (msg.responseKey) { - case "NewMember": - ctrl.newMember(msg.data); - // $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - case "NewMessage": - ctrl.newMessage(msg.data); - break; - case "ConnectSuccess": - ctrl.user.loggedIn = true; - ctrl.initListMember(msg.data); - $scope.$apply(); - break; - case "PreviousMessages": - ctrl.messages = msg.data; - $scope.$apply(); - break; - case "MemberOffline": - ctrl.removeMember(msg.data); - break; - case "Error": - console.error(msg.data); - break; - } - }; - ctrl.newMessage = function (msg) { - ctrl.messages.items.push(msg); - $scope.$apply(); - }; - ctrl.newMember = function (member) { - var m = $rootScope.findObjectByKey(ctrl.members, "id", member.id); - if (!m) { - ctrl.members.push(member); - } - $scope.$apply(); - }; - ctrl.join = async function () { - ctrl.request.action = "join_group"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.user.connection; - ctrl.message.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - await ctrl.loadData(); - $scope.$apply(); - }; - ctrl.initListMember = function (data) { - data.forEach((member) => { - var index = ctrl.members.findIndex((x) => x.id === member.id); - if (index < 0) { - ctrl.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - }; - - ctrl.checkLoginStatus = function () { - FB.getLoginStatus(function (response) { - if (response.status === "connected") { - // The user is logged in and has authenticated your - // app, and response.authResponse supplies - // the user's ID, a valid access token, a signed - // request, and the time the access token - // and signed request each expire. - FB.api("/me", function (response) { - ctrl.user.connection.name = response.name; - ctrl.user.connection.id = response.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = - "//graph.facebook.com/" + - response.id + - "/picture?width=32&height=32"; - ctrl.user.loggedIn = true; - ctrl.join(); - }); - } else if (response.status === "authorization_expired") { - // The user has signed into your application with - // Facebook Login but must go through the login flow - // again to renew data authorization. You might remind - // the user they've used Facebook, or hide other options - // to avoid duplicate account creation, but you should - // collect a user gesture (e.g. click/touch) to launch the - // login dialog so popup blocking is not triggered. - } else if (response.status === "not_authorized") { - // The user hasn't authorized your application. They - // must click the Login button, or you must call FB.login - // in response to a user gesture, to launch a login dialog. - } else { - // The user isn't logged in to Facebook. You can launch a - // login dialog with a user gesture, but the user may have - // to log in to Facebook before authorizing your application. - } - }); - }; - ctrl.logout = function () { - FB.logout(function (response) { - // user is now logged out - ctrl.user.loggedIn = false; - }); - }; - ctrl.login = function () { - FB.login(function (response) { - if (response.authResponse) { - FB.api("/me", function (response) { - ctrl.user.connection.name = response.name; - ctrl.user.connection.id = response.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = - "//graph.facebook.com/" + - response.id + - "/picture?width=32&height=32"; - ctrl.user.loggedIn = true; - ctrl.join(); - $scope.$apply(); - }); - } else { - console.log("User cancelled login or did not fully authorize."); - } - }); - }; - }, - ], -}); - -modules.component('shoppingCart', { - templateUrl: '/mix-app/views/app-client/components/shopping-cart/view.html', - controller: [ - '$rootScope', 'localStorageService', 'CommonService', - function ($rootScope, localStorageService, commonService) { - var ctrl = this; - ctrl.submitted = false; - ctrl.isShow = false; - - ctrl.edm = 'Url: View Tour
Name: [name]
' - + 'Phone: [phone]
' - + 'Email: [email]
' - + 'Quantity: [quantity]
' - + 'Message: [message]
' - + 'property: [property]
Price: [price]
'; - ctrl.init = function () { - - }; - ctrl.showShoppingCart = function () { - $('#modal-shopping-cart').modal('show'); - } - ctrl.calculate = function () { - ctrl.cartData.total = 0; - ctrl.cartData.totalItems = ctrl.cartData.items.length; - angular.forEach(ctrl.cartData.items, function (e) { - ctrl.cartData.total += (parseInt(e.price) * e.quantity); - }); - localStorageService.set('shoppingCart', ctrl.cartData); - }; - ctrl.removeItem = function (index) { - ctrl.cartData.items.splice(index, 1); - ctrl.calculate(); - } - ctrl.book = function () { - ctrl.edm = ctrl.edm.replace(/\[url\]/g, window.top.location.href); - ctrl.edm = ctrl.edm.replace(/\[name\]/g, ctrl.order.name); - ctrl.edm = ctrl.edm.replace(/\[phone\]/g, ctrl.order.phone); - ctrl.edm = ctrl.edm.replace(/\[email\]/g, ctrl.order.email); - ctrl.edm = ctrl.edm.replace(/\[message\]/g, ctrl.order.message); - ctrl.edm = ctrl.edm.replace(/\[property\]/g, ctrl.order.propertyId); - ctrl.edm = ctrl.edm.replace(/\[price\]/g, ctrl.order.price); - ctrl.edm = ctrl.edm.replace(/\[quantity\]/g, ctrl.order.quantity); - - commonService.sendMail('Booking - ' + ctrl.propertyName, ctrl.edm); - ctrl.submitted = true; - setTimeout(() => { - ctrl.submitted = false; - }, 1000); - ctrl.cartData = { - items: [], - totalItems: 0, - total: 0, - }; - localStorageService.set('shoppingCart', ctrl.cartData); - } - } - ], - bindings: { - cartData: '=' - } -}); -app.factory('ConnectionManager', [ - function () { - var serviceFactory = {}; - var _signaler, - _connections = {}, - _iceServers = [ - { "urls": "stun:ec2-54-176-1-181.us-west-1.compute.amazonaws.com:3478" }, - { - "urls": "turn:ec2-54-176-1-181.us-west-1.compute.amazonaws.com:3478", - "username": "tadhackuser", "credential": "tadhackpw" - }], // stun.l.google.com - Firefox does not support DNS names. - - /* Callbacks */ - _onReadyForStreamCallback = function () { console.log('UNIMPLEMENTED: _onReadyForStreamCallback'); }, - _onStreamAddedCallback = function () { console.log('UNIMPLEMENTED: _onStreamAddedCallback'); }, - _onStreamRemovedCallback = function () { console.log('UNIMPLEMENTED: _onStreamRemovedCallback'); }, - - // Initialize the ConnectionManager with a signaler and callbacks to handle events - _initialize = function (signaler, onReadyForStream, onStreamAdded, onStreamRemoved) { - _signaler = signaler; - _onReadyForStreamCallback = onReadyForStream || _onReadyForStreamCallback; - _onStreamAddedCallback = onStreamAdded || _onStreamAddedCallback; - _onStreamRemovedCallback = onStreamRemoved || _onStreamRemovedCallback; - }, - - // Create a new WebRTC Peer Connection with the given partner - _createConnection = function (partnerClientId) { - console.log('WebRTC: creating connection...'); - - // Create a new PeerConnection - var connection = new RTCPeerConnection({ iceServers: _iceServers, voiceActivityDetection: false }); - - // ICE Candidate Callback - connection.onicecandidate = function (event) { - if (event.candidate) { - // Found a new candidate - console.log('WebRTC: new ICE candidate'); - _signaler.invoke('sendSignal', JSON.stringify({ "candidate": event.candidate }), partnerClientId); - } else { - // Null candidate means we are done collecting candidates. - console.log('WebRTC: ICE candidate gathering complete'); - } - }; - - // State changing - connection.onstatechange = function () { - // Not doing anything here, but interesting to see the state transitions - var states = { - 'iceConnectionState': connection.iceConnectionState, - 'iceGatheringState': connection.iceGatheringState, - 'readyState': connection.readyState, - 'signalingState': connection.signalingState - }; - - console.log(JSON.stringify(states)); - }; - - // Stream handlers - connection.onaddstream = function (event) { - console.log('WebRTC: adding stream'); - // A stream was added, so surface it up to our UI via callback - _onStreamAddedCallback(connection, event); - }; - - connection.onremovestream = function (event) { - console.log('WebRTC: removing stream'); - // A stream was removed - _onStreamRemovedCallback(connection, event.stream.id); - }; - - // Store away the connection - _connections[partnerClientId] = connection; - - // And return it - return connection; - }, - - // Process a newly received SDP signal - _receivedSdpSignal = function (connection, partnerClientId, sdp) { - console.log('WebRTC: processing sdp signal'); - connection.setRemoteDescription(new RTCSessionDescription(sdp), function () { - if (connection.remoteDescription.type == "offer") { - console.log('WebRTC: received offer, sending response...'); - _onReadyForStreamCallback(connection); - connection.createAnswer(function (desc) { - connection.setLocalDescription(desc, function () { - _signaler.invoke('sendSignal', JSON.stringify({ "sdp": connection.localDescription }), partnerClientId); - }); - }, - function (error) { console.log('Error creating session description: ' + error); }); - } else if (connection.remoteDescription.type == "answer") { - console.log('WebRTC: received answer'); - } - }); - }, - - // Hand off a new signal from the signaler to the connection - _newSignal = function (partnerClientId, data) { - var signal = JSON.parse(data), - connection = _getConnection(partnerClientId); - - console.log('WebRTC: received signal'); - - // Route signal based on type - if (signal.sdp) { - _receivedSdpSignal(connection, partnerClientId, signal.sdp); - } else if (signal.candidate) { - _receivedCandidateSignal(connection, partnerClientId, signal.candidate); - } - }, - - // Process a newly received Candidate signal - _receivedCandidateSignal = function (connection, partnerClientId, candidate) { - console.log('WebRTC: processing candidate signal'); - connection.addIceCandidate(new RTCIceCandidate(candidate)); - }, - - // Retreive an existing or new connection for a given partner - _getConnection = function (partnerClientId) { - var connection = _connections[partnerClientId] || _createConnection(partnerClientId); - return connection; - }, - - // Close all of our connections - _closeAllConnections = function () { - for (var connectionId in _connections) { - _closeConnection(connectionId); - } - }, - - // Close the connection between myself and the given partner - _closeConnection = function (partnerClientId) { - var connection = _connections[partnerClientId]; - - if (connection) { - // Let the user know which streams are leaving - // todo: foreach connection.remoteStreams -> onStreamRemoved(stream.id) - _onStreamRemovedCallback(null, null); - - // Close the connection - connection.close(); - delete _connections[partnerClientId]; // Remove the property - } - }, - - // Send an offer for audio/video - _initiateOffer = function (partnerClientId, stream) { - // Get a connection for the given partner - var connection = _getConnection(partnerClientId); - - // Add our audio/video stream - connection.addStream(stream); - - console.log('stream added on my end'); - - // Send an offer for a connection - connection.createOffer(function (desc) { - connection.setLocalDescription(desc, function () { - _signaler.invoke('sendSignal', JSON.stringify({ "sdp": connection.localDescription }), partnerClientId); - }); - }, function (error) { console.log('Error creating session description: ' + error); }); - }; - - serviceFactory.initialize = _initialize; - serviceFactory.newSignal = _newSignal; - serviceFactory.closeConnection = _closeConnection; - serviceFactory.closeAllConnections = _closeAllConnections; - serviceFactory.initiateOffer = _initiateOffer; - return serviceFactory; - }]); -modules.component('videoChatHub', { - templateUrl: '/mix-app/views/app-client/components/video-chat-hub/view.html', - bindings: { - attrSetName: '=', - isSave: '=?' - }, - controller: ['$rootScope', '$scope', 'VideoChatService', 'ViewModel', 'ConnectionManager', - function ($rootScope, $scope, service, viewModel, connectionManager) { - var ctrl = this; - BaseHub.call(this, ctrl); - ctrl.settings = $rootScope.globalSettings; - - ctrl.init = function () { - ctrl.viewModel = viewModel; - _start(); - }; - ctrl.toogleMute = function () { - if (ctrl._mediaStream != null && ctrl._mediaStream.getAudioTracks().length > 0) { - ctrl.viewModel.muted = !ctrl.viewModel.muted; - ctrl._mediaStream.getAudioTracks()[0].enabled = ctrl.viewModel.muted; - } - }; - ctrl.toogleVideo = function () { - if (ctrl._mediaStream != null && ctrl._mediaStream.getVideoTracks().length > 0) { - ctrl.viewModel.video = !ctrl.viewModel.video; - ctrl._mediaStream.getVideoTracks()[0].enabled = ctrl.viewModel.video; - } - }; - - ctrl._mediaStream = null; - - var _hub, - _connect = function (username, onSuccess, onFailure) { - var hub = new signalR.HubConnectionBuilder() - .withUrl('/videoChatHub') - .withAutomaticReconnect() - .configureLogging(signalR.LogLevel.Information) - .build(); - // Setup client SignalR operations - _setupHubCallbacks(hub); - hub.start() - .then(function () { - console.log('connected to SignalR hub... connection id: ' + hub.connectionId); - - // Tell the hub what our username is - hub.invoke('Join', username); - - if (onSuccess) { - onSuccess(hub); - } - //scope.$apply(); - }) - .catch(function (error) { - console.log(`Cannot start the connection use transport.`, error); - if (onFailure) { - onFailure(event); - } - return Promise.reject(error); - }); - - _hub = hub; - }, - _start = function () { - // Show warning if WebRTC support is not detected - if (webrtcDetectedBrowser == null) { - console.log('Your browser doesnt appear to support WebRTC.'); - $('.browser-warning').show(); - } - - // Then proceed to the next step, gathering username - _getUsername(); - }, - _getUsername = function () { - alertify.prompt("What is your name?", function (e, username) { - if (e == false || username == '') { - username = 'User ' + Math.floor((Math.random() * 10000) + 1); - alertify.success('You really need a username, so we will call you... ' + username); - } - - // proceed to next step, get media access and start up our connection - _startSession(username); - }, ''); - }, - - _startSession = function (username) { - ctrl.viewModel.Username = username; // Set the selected username in the UI - ctrl.viewModel.Loading = true; // Turn on the loading indicator - $scope.$apply(); - // Ask the user for permissions to access the webcam and mic - getUserMedia( - { - // Permissions to request - video: true, - audio: true - }, - function (stream) { // succcess callback gives us a media stream - $('.instructions').hide(); - - // Now we have everything we need for interaction, so fire up SignalR - _connect(username, - function (hub) { - // tell the viewmodel our conn id, so we can be treated like the special person we are. - ctrl.viewModel.MyConnectionId = hub.connectionId; - - // Initialize our client signal manager, giving it a signaler (the SignalR hub) and some callbacks - console.log('initializing connection manager'); - connectionManager.initialize(hub, _callbacks.onReadyForStream, _callbacks.onStreamAdded, _callbacks.onStreamRemoved); - - // Store off the stream reference so we can share it later - ctrl._mediaStream = stream; - ctrl._mediaStream.getAudioTracks()[0].enabled = true; - ctrl._mediaStream.getVideoTracks()[0].enabled = false; - // Load the stream into a video element so it starts playing in the UI - //console.log('playing my local video feed'); - var videoElement = document.querySelector('.video.mine'); - videoElement.volume = 0; - setTimeout(() => { - videoElement.volume = 0.5; - }, 2000); - attachMediaStream(videoElement, ctrl._mediaStream); - - // Hook up the UI - ctrl.viewModel.Loading = false; - }, function (event) { - alertify.alert('

Failed SignalR Connection

We were not able to connect you to the signaling server.

Error: ' + JSON.stringify(event)); - ctrl.viewModel.Loading = false; - }); - }, - function (error) { // error callback - alertify.alert('

Failed to get hardware access!

Do you have another browser type open and using your cam/mic?

You were not connected to the server, because I didn\'t code to make browsers without media access work well.

Actual Error: ' + JSON.stringify(error)); - ctrl.viewModel.Loading = false; - } - ); - }, - _setupHubCallbacks = function (hub) { - // Hub Callback: Incoming Call - hub.on("incomingCall", (callingUser) => { - console.log('incoming call from: ' + callingUser); - callingUser = JSON.parse(callingUser); - // Ask if we want to talk - alertify.confirm(callingUser.Username + ' is calling. Do you want to chat?', function (e) { - if (e) { - // I want to chat - hub.invoke('answerCall', true, callingUser.ConnectionId); - - // So lets go into call mode on the UI - ctrl.viewModel.Mode = 'incall'; - } else { - // Go away, I don't want to chat with you - hub.invoke('answerCall', false, callingUser.ConnectionId); - } - }); - }); - - // Hub Callback: Call Accepted - hub.on("callAccepted", (acceptingUser) => { - console.log('call accepted from: ' + acceptingUser + '. Initiating WebRTC call and offering my stream up...'); - acceptingUser = JSON.parse(acceptingUser); - // Callee accepted our call, let's send them an offer with our video stream - connectionManager.initiateOffer(acceptingUser.ConnectionId, ctrl._mediaStream); - - // Set UI into call mode - ctrl.viewModel.Mode = 'incall'; - }); - - // Hub Callback: Call Declined - hub.on("callDeclined", (decliningConnectionId, reason) => { - console.log('call declined from: ' + decliningConnectionId); - - // Let the user know that the callee declined to talk - alertify.error(reason); - - // Back to an idle UI - ctrl.viewModel.Mode = 'idle'; - }); - - // Hub Callback: Call Ended - hub.on("callEnded", (connectionId, reason) => { - console.log('call with ' + connectionId + ' has ended: ' + reason); - - // Let the user know why the server says the call is over - alertify.error(reason); - - // Close the WebRTC connection - connectionManager.closeConnection(connectionId); - - // Set the UI back into idle mode - ctrl.viewModel.Mode = 'idle'; - }); - // Hub Callback: Update User List - hub.on("updateUserList", (userList) => { - ctrl.viewModel.Users = JSON.parse(userList); - $scope.$apply(); - }); - // Hub Callback: WebRTC Signal Received - hub.on("receiveSignal", (callingUser, data) => { - callingUser = JSON.parse(callingUser); - connectionManager.newSignal(callingUser.ConnectionId, data); - }); - }, - - // Connection Manager Callbacks - _callbacks = { - onReadyForStream: function (connection) { - // The connection manager needs our stream - // todo: not sure I like this - connection.addStream(ctrl._mediaStream); - }, - onStreamAdded: function (connection, event) { - console.log('binding remote stream to the partner window'); - - // Bind the remote stream to the partner window - var otherVideo = document.querySelector('.video.partner'); - attachMediaStream(otherVideo, event.stream); // from adapter.js - }, - onStreamRemoved: function (connection, streamId) { - // todo: proper stream removal. right now we are only set up for one-on-one which is why this works. - console.log('removing remote stream from partner window'); - - // Clear out the partner window - var otherVideo = document.querySelector('.video.partner'); - otherVideo.srcObject = null; - } - }; - ctrl.callUser = function (targetConnectionId) { - // Make sure we are in a state where we can make a call - if (ctrl.viewModel.Mode !== 'idle') { - alertify.error('Sorry, you are already in a call. Conferencing is not yet implemented.'); - return; - } - // Then make sure we aren't calling ourselves. - if (targetConnectionId != ctrl.viewModel.MyConnectionId) { - // Initiate a call - _hub.invoke('callUser', targetConnectionId); - - // UI in calling mode - ctrl.viewModel.Mode = 'calling'; - } else { - alertify.error("Ah, nope. Can't call yourself."); - } - }; - ctrl.hangup = function () { - // Only allow hangup if we are not idle - if (ctrl.viewModel.Mode != 'idle') { - _hub.invoke('hangUp'); - connectionManager.closeAllConnections(); - ctrl.viewModel.Mode = 'idle'; - } - }; - }] -}); -'use strict'; -app.factory('VideoChatService', ['ViewModel', 'ConnectionManager', - function (viewModel, connectionManager) { - var serviceFactory = {}; - var _mediaStream, - _hub, - _connect = function (username, onSuccess, onFailure) { - var hub = new signalR.HubConnectionBuilder() - .withUrl('/videoChatHub') - .withAutomaticReconnect() - .configureLogging(signalR.LogLevel.Information) - .build(); - hub.start() - .then(function () { - console.log('connected to SignalR hub... connection id: ' + hub.connectionId); - - // Tell the hub what our username is - hub.invoke('Join', username); - - if (onSuccess) { - onSuccess(hub); - } - //scope.$apply(); - }) - .catch(function (error) { - console.log(`Cannot start the connection use transport.`, error); - if (onFailure) { - onFailure(event); - } - return Promise.reject(error); - }); - // Setup client SignalR operations - _setupHubCallbacks(hub); - _hub = hub; - }, - _start = function (vm) { - // Show warning if WebRTC support is not detected - viewModel = vm; - if (webrtcDetectedBrowser == null) { - console.log('Your browser doesnt appear to support WebRTC.'); - $('.browser-warning').show(); - } - - // Then proceed to the next step, gathering username - _getUsername(); - }, - _getUsername = function () { - alertify.prompt("What is your name?", function (e, username) { - if (e == false || username == '') { - username = 'User ' + Math.floor((Math.random() * 10000) + 1); - alertify.success('You really need a username, so we will call you... ' + username); - } - - // proceed to next step, get media access and start up our connection - _startSession(username); - }, ''); - }, - - _startSession = function (username) { - viewModel.Username = username; // Set the selected username in the UI - viewModel.Loading = true; // Turn on the loading indicator - - // Ask the user for permissions to access the webcam and mic - getUserMedia( - { - // Permissions to request - video: true, - audio: false - }, - function (stream) { // succcess callback gives us a media stream - $('.instructions').hide(); - - // Now we have everything we need for interaction, so fire up SignalR - _connect(username, - function (hub) { - // tell the viewmodel our conn id, so we can be treated like the special person we are. - viewModel.MyConnectionId = hub.connectionId; - - // Initialize our client signal manager, giving it a signaler (the SignalR hub) and some callbacks - console.log('initializing connection manager'); - connectionManager.initialize(hub, _callbacks.onReadyForStream, _callbacks.onStreamAdded, _callbacks.onStreamRemoved); - - // Store off the stream reference so we can share it later - _mediaStream = stream; - - // Load the stream into a video element so it starts playing in the UI - //console.log('playing my local video feed'); - var videoElement = document.querySelector('.video.mine'); - attachMediaStream(videoElement, _mediaStream); - - // Hook up the UI - - viewModel.Loading = false; - }, function (event) { - alertify.alert('

Failed SignalR Connection

We were not able to connect you to the signaling server.

Error: ' + JSON.stringify(event)); - viewModel.Loading = false; - }); - }, - function (error) { // error callback - alertify.alert('

Failed to get hardware access!

Do you have another browser type open and using your cam/mic?

You were not connected to the server, because I didn\'t code to make browsers without media access work well.

Actual Error: ' + JSON.stringify(error)); - viewModel.Loading = false; - } - ); - }, - _callUser = function (targetConnectionId) { - // Make sure we are in a state where we can make a call - if (viewModel.Mode !== 'idle') { - alertify.error('Sorry, you are already in a call. Conferencing is not yet implemented.'); - return; - } - // Then make sure we aren't calling ourselves. - if (targetConnectionId != viewModel.MyConnectionId) { - // Initiate a call - _hub.server.invoke('callUser', targetConnectionId); - - // UI in calling mode - viewModel.Mode = 'calling'; - } else { - alertify.error("Ah, nope. Can't call yourself."); - } - }, - _hangup = function () { - // Only allow hangup if we are not idle - if (viewModel.Mode != 'idle') { - _hub.server.invoke('hangUp'); - connectionManager.closeAllConnections(); - viewModel.Mode = 'idle'; - } - }, - - _setupHubCallbacks = function (hub) { - // Hub Callback: Incoming Call - - hub.on("incomingCall", (callingUser) => { - console.log('incoming call from: ' + JSON.stringify(callingUser)); - - // Ask if we want to talk - alertify.confirm(callingUser.Username + ' is calling. Do you want to chat?', function (e) { - if (e) { - // I want to chat - hub.server.answerCall(true, callingUser.ConnectionId); - - // So lets go into call mode on the UI - viewModel.Mode = 'incall'; - } else { - // Go away, I don't want to chat with you - hub.server.answerCall(false, callingUser.ConnectionId); - } - }); - }); - - // Hub Callback: Call Accepted - hub.on("callAccepted", (acceptingUser) => { - console.log('call accepted from: ' + JSON.stringify(acceptingUser) + '. Initiating WebRTC call and offering my stream up...'); - - // Callee accepted our call, let's send them an offer with our video stream - connectionManager.initiateOffer(acceptingUser.ConnectionId, _mediaStream); - - // Set UI into call mode - viewModel.Mode = 'incall'; - }); - - // Hub Callback: Call Declined - hub.on("callDeclined", (decliningConnectionId, reason) => { - console.log('call declined from: ' + decliningConnectionId); - - // Let the user know that the callee declined to talk - alertify.error(reason); - - // Back to an idle UI - viewModel.Mode = 'idle'; - }); - - // Hub Callback: Call Ended - hub.on("callEnded", (connectionId, reason) => { - console.log('call with ' + connectionId + ' has ended: ' + reason); - - // Let the user know why the server says the call is over - alertify.error(reason); - - // Close the WebRTC connection - connectionManager.closeConnection(connectionId); - - // Set the UI back into idle mode - viewModel.Mode = 'idle'; - }); - // Hub Callback: Update User List - hub.on("updateUserList", (userList) => { - viewModel.setUsers(userList); - }); - // Hub Callback: WebRTC Signal Received - hub.on("receiveSignal", (callingUser, data) => { - connectionManager.newSignal(callingUser.ConnectionId, data); - }); - }, - - // Connection Manager Callbacks - _callbacks = { - onReadyForStream: function (connection) { - // The connection manager needs our stream - // todo: not sure I like this - connection.addStream(_mediaStream); - }, - onStreamAdded: function (connection, event) { - console.log('binding remote stream to the partner window'); - - // Bind the remote stream to the partner window - var otherVideo = document.querySelector('.video.partner'); - attachMediaStream(otherVideo, event.stream); // from adapter.js - }, - onStreamRemoved: function (connection, streamId) { - // todo: proper stream removal. right now we are only set up for one-on-one which is why this works. - console.log('removing remote stream from partner window'); - - // Clear out the partner window - var otherVideo = document.querySelector('.video.partner'); - otherVideo.src = ''; - } - }; - // serviceFactory._connect = _connect; - // serviceFactory._start = _start; - // serviceFactory._getUsername = _getUsername; - // serviceFactory._startSession = _startSession; - // serviceFactory._attachUiHandlers = _attachUiHandlers; - // serviceFactory._setupHubCallbacks = _setupHubCallbacks; - // serviceFactory._callbacks = _callbacks; - // serviceFactory._mediaStream = _mediaStream; - // serviceFactory._hub = _hub; - // Define more service methods here - serviceFactory.viewModel = viewModel; - serviceFactory.callUser = _callUser; // Starts the UI process - serviceFactory.hangup = _hangup; // Starts the UI process - serviceFactory.start = _start; // Starts the UI process - serviceFactory.getStream = function () { // Temp hack for the connection manager to reach back in here for a stream - return _mediaStream; - } - return serviceFactory; - }]); - -app.factory('ViewModel', ['$rootScope', - function ($rootScope) { - var viewModel = { - Users: [], // List of users that are logged in and ready for connections - Username: 'not logged in.', // My username, to be reflected in UI - MyConnectionId: '', // My connection Id, so I can tell who I am - Mode: 'idle', // UI mode ['idle', 'calling', 'incall'] - Loading: false, // Loading indicator control - muted: 'muted' // Loading indicator control - }; - - // The user that represents me - viewModel.Me = function () { - return $rootScope.findObjectByKey(this.Users, 'MyConnectionId', viewModel.MyConnectionId); - }; - - // The readable status of the UI - viewModel.CallStatus = function () { - var callStatus; - - if (this.Mode == 'idle') { - callStatus = 'Idle'; - } else if (this.Mode == 'calling') { - callStatus = 'Calling...'; - } else { - callStatus = 'In Call'; - } - - return callStatus; - }; - - // Set a new array of users. We could simply do viewModel.Users([array]), - // but the mapping plugin converts all the user props to observables for us. - viewModel.setUsers = function (userArray) { - viewModel.Users = userArray; - }; - - // Retreives the css class that should be used to represent the user status. - // I can't get this to work as just a dynamic class property for some reason. - viewModel.getUserStatus = function (user) { - var css; - - if (user == viewModel.Me()) { - css = 'icon-user'; - } else if (user.InCall()) { - css = 'icon-phone-3'; - } else { - css = 'icon-phone-4'; - } - - return css; - }; - - // Return the viewmodel so that we can change props later - return viewModel; - }]); -modules.component("tclLogin", { - binding: { - user: "=", - }, - templateUrl: "/mix-app/views/app-client/components/customs/login/view.html", - controller: [ - "$scope", - "$rootScope", - "RestMixDatabaseDataClientService", - function ($scope, $rootScope, service) { - var ctrl = this; - ctrl.loginData = { - username: "", - password: "", - pageSize: 1, - pageIndex: 0, - mixDatabaseName: "tcl_user", - filterType: "equal", - }; - ctrl.$onInit = async function () {}; - ctrl.isBusy = false; - ctrl.translate = $rootScope.translate; - ctrl.submit = async function () { - $rootScope.isBusy = true; - var result = await service.getList(ctrl.loginData); - if (result.isSucceed) { - if (result.data.totalItems > 0) { - if ( - result.data.items[0].obj.password == ctrl.loginData.password && - result.data.items[0].obj.username == ctrl.loginData.username - ) { - ctrl.onSuccess(result); - } else { - ctrl.onFail(result); - } - } else { - ctrl.onFail(result); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - ctrl.onFail(result); - ctrl.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.onSuccess = function (result) { - $rootScope.isLogin = true; - ctrl.user = result.data.items[0]; - $rootScope.user = result.data.items[0]; - $scope.$apply(); - }; - - ctrl.onFail = function (result) { - ctrl.msg = { - color: "red", - text: "Sai tên đăng nhập hoặc mật khẩu!", - }; - }; - }, - ], -}); - - -modules.component('haiyenLoader', { - templateUrl: '/mix-app/views/app-client/components/customs/loader/view.html', - controller: ['$scope', '$location', function ($scope, $location) { - var ctrl = this; - ctrl.imageDataArray = []; - ctrl.canvasCount = 10; - ctrl.duration = 500; - ctrl.bgDuration = 2500; - ctrl.canvas = null; - ctrl.isLoaded = false; - ctrl.init = function () { - setTimeout(() => { - $scope.$apply(ctrl.isLoaded = true); - }, (500)); - }; - - }], - - bindings: { - } -}); -modules.component("tclOrder", { - binding: { - user: "=", - }, - templateUrl: "/mix-app/views/app-client/components/customs/order/view.html", - controller: [ - "$scope", - "$rootScope", - "ngAppSettings", - "RestMixDatabaseDataClientService", - function ($scope, $rootScope, ngAppSettings, service) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.request.mixDatabaseName = "tcl_package"; - ctrl.packages = []; - ctrl.$onInit = async function () { - ctrl.user = $rootScope.user; - - if (ctrl.user.obj.order_packages.length == 0) { - await ctrl.loadDefaultPackages(); - ctrl.saveDefaultData().then(() => { - service.clearCache([ctrl.user.obj.id]); - }); - } - ctrl.totalUnit = 0; - angular.forEach(ctrl.user.obj.order_packages, function (pack) { - ctrl.calculateItems(pack); - if (pack.obj.quantity > 0) { - ctrl.totalUnit += pack.obj.total * pack.obj.quantity; - } - }); - }; - - ctrl.loadDefaultPackages = async function () { - $rootScope.isBusy = true; - ctrl.request.parentId = ctrl.user.id; - ctrl.request.parentType = "Set"; - var getPackages = await service.getList(ctrl.request); - if (getPackages.isSucceed) { - ctrl.user.obj.order_packages = getPackages.data.items; - angular.forEach(ctrl.user.obj.order_packages, function (pack) { - pack.parentId = ctrl.user.id; - pack.mixDatabaseId = 0; - pack.parentType = "Set"; - pack.status = 2; - pack.mixDatabaseName = "order_package"; - pack.id = null; - pack.obj.quantity = 0; - pack.obj.total = 0; - pack.parentId = ctrl.user.id; - pack.parentType = "Set"; - angular.forEach(pack.obj.package_slots, function (slot) { - slot.id = null; - slot.mixDatabaseName = "order_package_slot"; - slot.parentType = "Set"; - slot.status = 2; - slot.mixDatabaseId = 0; - angular.forEach(slot.obj.package_items, function (item) { - item.id = null; - item.mixDatabaseName = "order_package_item"; - item.parentType = "Set"; - item.mixDatabaseId = 0; - }); - }); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.saveDefaultData = async function () { - angular.forEach(ctrl.user.obj.order_packages, async function (pack) { - var savePackage = await ctrl.saveData(pack); - if (savePackage.isSucceed) { - pack.id = savePackage.data.id; - pack.mixDatabaseId = savePackage.data.mixDatabaseId; - pack.obj.id = savePackage.data.id; - angular.forEach(pack.obj.gifts, async function (gift) { - gift.parentId = pack.id; - gift.parentType = "Set"; - await ctrl.saveData(gift); - }); - angular.forEach(pack.obj.package_slots, async function (slot) { - slot.parentId = pack.id; - - var saveSlot = await ctrl.saveData(slot); - if (saveSlot.isSucceed) { - slot.mixDatabaseId = saveSlot.data.mixDatabaseId; - slot.id = saveSlot.data.id; - slot.mixDatabaseId = saveSlot.data.mixDatabaseId; - slot.obj.id = saveSlot.data.id; - slot.status = 2; - angular.forEach(slot.obj.package_items, async function (item) { - item.parentId = slot.id; - - var saveItem = await ctrl.saveData(item); - if (saveItem.isSucceed) { - item.id = saveItem.data.id; - item.obj.id = saveItem.data.id; - item.mixDatabaseId = saveItem.data.mixDatabaseId; - angular.forEach(item.obj.products, async function ( - product - ) { - product.parentId = item.id; - product.parentType = "Set"; - await ctrl.saveData(product); - }); - } - }); - } - }); - } - }); - }; - ctrl.isBusy = false; - ctrl.translate = $rootScope.translate; - - ctrl.updatePackageQuantity = async function (pack, value) { - pack.obj.quantity += value; - var result = await ctrl.saveData(pack); - ctrl.handleResult(result); - ctrl.totalUnit += value * pack.obj.total; - service.clearCache([ctrl.user.obj.id]); - // ctrl.calculateItems(); - }; - - ctrl.updateItemQuantity = async function (pack, item, value) { - const newVal = item.obj.quantity + value; - if (newVal < 0) { - return; - } - if (item.obj.max_quantity >= newVal) { - item.obj.quantity = newVal; - var result = await ctrl.saveData(item); - ctrl.handleResult(result); - ctrl.calculateItems(pack); - if (!pack.isValid) { - ctrl.totalUnit -= pack.obj.unit * pack.obj.quantity; - pack.obj.quantity = 0; - } - service.clearCache([pack.id]); - } else { - alert( - `Bạn không thể mua nhiều hơn ${item.obj.max_quantity} sản phẩm ${item.obj.product_title}` - ); - } - }; - - ctrl.calculateItems = function (pack) { - pack.obj.total = 0; - angular.forEach(pack.obj.package_slots, function (slot) { - slot.obj.total_unit = 0; - angular.forEach(slot.obj.package_items, function (item) { - slot.obj.total_unit += item.obj.quantity; - }); - pack.obj.total += slot.obj.total_unit; - }); - pack.isValid = pack.obj.total == pack.obj.unit; - }; - - ctrl.submit = async function () { - if (ctrl.validate()) { - $rootScope.isBusy = true; - var result = await service.save(ctrl.user); - ctrl.handleResult(result); - } - }; - - ctrl.saveData = async function (data) { - var result = await service.save(data); - return result; - }; - - ctrl.handleResult = function (result) { - if (result.isSucceed) { - ctrl.onSuccess(result); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - ctrl.onFail(result); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.validate = function () { - let result = true; - angular.forEach(ctrl.user.obj.order_packages, function (pack) { - if (!pack.isValid && pack.obj.quantity > 0) { - result = false; - alert(`${pack.obj.title} chỉ chấp nhận ${pack.obj.unit} sản phẩm`); - } - }); - return result; - }; - ctrl.onSuccess = function (result) { - $rootScope.isLogin = true; - $rootScope.isBusy = false; - $scope.$apply(); - }; - - ctrl.onFail = function (result) { - ctrl.msg = { - color: "red", - text: "Sai tên đăng nhập hoặc mật khẩu!", - }; - $rootScope.isBusy = false; - $scope.$apply(); - }; - - ctrl.export = function () { - if (ctrl.validate()) { - $rootScope.isBusy = true; - var canvasdiv = document.getElementById("receipt"); - html2canvas(canvasdiv, { - backgroundColor: "#5b4298", - }).then((canvas) => { - var a = document.createElement("a"); - a.href = canvas.toDataURL("image/png"); - a.download = ctrl.user.obj.username + "_receipt_.png"; - a.click(); - $rootScope.isBusy = false; - $scope.$apply(); - }); - } - }; - }, - ], -}); - -modules.component("haiyenSubscriber", { - binding: {}, - templateUrl: - "/mix-app/views/app-client/components/customs/subscriber/view.html", - controller: [ - "$scope", - "$rootScope", - "RestMixDatabaseDataClientService", - function ($scope, $rootScope, service) { - var ctrl = this; - ctrl.subscriber = null; - ctrl.formName = "subscribers"; - ctrl.$onInit = async function () { - var initData = await service.initData(ctrl.formName); - if (initData.isSucceed) { - ctrl.default = initData.data; - ctrl.subscriber = angular.copy(ctrl.default); - $scope.$apply(); - } - }; - ctrl.isBusy = false; - ctrl.submit = async function () { - ctrl.isBusy = true; - var result = await service.save(ctrl.subscriber); - if (result.isSucceed) { - ctrl.onSuccess(result); - ctrl.subscriber = angular.copy(ctrl.default); - ctrl.isBusy = false; - } else { - ctrl.onFail(result); - ctrl.isBusy = false; - } - $scope.$apply(); - }; - ctrl.onSuccess = function (result) { - ctrl.msg = { - color: "green", - text: "Cám ơn bạn đã đăng ký thành công!", - }; - }; - - ctrl.onFail = function (result) { - ctrl.msg = { - color: "red", - text: result.errors[0], - }; - }; - }, - ], -}); diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-init.min.js b/src/Mix.Cms.Web/wwwroot/mix-app/js/app-init.min.js deleted file mode 100644 index 419a1bdfa..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-init.min.js +++ /dev/null @@ -1,752 +0,0 @@ -'use strict'; -var app = angular.module('MixPortal', - ['ngRoute', 'ngFileUpload', 'LocalStorageModule', 'components']); -var modules = angular.module('components', []); -app.config(function ($routeProvider, $locationProvider, $sceProvider) { - $locationProvider.html5Mode(true); - - $routeProvider.when("/init", { - controller: "Step1Controller", - templateUrl: "/mix-app/views/app-init/pages/step1/index.html" - }); - - $routeProvider.when("/init/step2", { - controller: "Step2Controller", - templateUrl: "/mix-app/views/app-init/pages/step2/view.html" - }); - $routeProvider.when("/init/step3", { - controller: "Step3Controller", - templateUrl: "/mix-app/views/app-init/pages/step3/view.html" - }); - $routeProvider.when("/init/step4", { - controller: "Step4Controller", - templateUrl: "/mix-app/views/app-init/pages/step4/view.html" - }); - $routeProvider.when("/init/step5", { - controller: "Step5Controller", - templateUrl: "/mix-app/views/app-init/pages/step5/view.html" - }); - $routeProvider.otherwise({ - redirectTo: "/init" - }); -}); -"use strict"; -app.controller("Step1Controller", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$timeout", - "$location", - "$http", - "CommonService", - "Step1Services", - function ( - $scope, - $rootScope, - ngAppSettings, - $timeout, - $location, - $http, - commonService, - step1Services - ) { - var rand = Math.floor(Math.random() * 10000) + 1; - $scope.settings = { - providers: [ - { - text: "MySQL Database", - value: "MySQL", - port: "3306", - img: "/mix-app/assets/img/mysql.jpg", - }, - { - text: "Microsoft SQL Server Database", - value: "MSSQL", - port: null, - img: "/mix-app/assets/img/mssql.jpg", - }, - { - text: "PostgreSQL Database", - value: "PostgreSQL", - port: "5432", - img: "/mix-app/assets/img/postgresql.jpg", - }, - { - text: "SQLite Database", - value: "SQLITE", - port: null, - img: "/mix-app/assets/img/sqlite.jpg", - }, - ], - cultures: [], - }; - $scope.loadSettings = async function () { - step1Services.saveDefaultSettings(); - var getCultures = await commonService.loadJArrayData("cultures.json"); - if (getCultures.isSucceed) { - $scope.settings.cultures = getCultures.data; - $scope.initCmsModel.culture = $scope.settings.cultures[0]; - $scope.dbProvider = $scope.settings.providers[0]; - $scope.initCmsModel.databaseProvider = $scope.dbProvider.value; - $scope.initCmsModel.databasePort = $scope.dbProvider.port; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (getCultures) { - $rootScope.showErrors(getCultures.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.changeTypeDB = async function (type) { - $scope.initCmsModel.isUseLocal = type; - }; - - $scope.canConnect = function () { - return ( - ($scope.initCmsModel.databaseServer && - $scope.initCmsModel.databaseName && - $scope.initCmsModel.databaseUser && - $scope.initCmsModel.culture) || - ($scope.initCmsModel.databaseProvider == "SQLITE" && - $scope.initCmsModel.sqliteDbConnectionString) - ); - }; - $scope.initCmsModel = { - isUseLocal: false, - localDbConnectionString: - "Server=(localdb)\\MSSQLLocalDB;Initial Catalog=" + - rand + - "-mix-cms.db;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=True", - sqliteDbConnectionString: "Data Source=MixContent\\mix-cms.db", - localDbName: rand + "-mix-cms", - databaseServer: "", - databasePort: "", - databaseName: "", - databaseUser: "", - databasePassword: "", - adminPassword: "", - lang: "en-us", - isMysql: false, - databaseProvider: "", - culture: $scope.settings.cultures[0], - }; - - $scope.updateLocalDbName = function () { - $scope.initCmsModel.localDbName = $scope.initCmsModel.localDbName + ".db"; - $scope.initCmsModel.localDbConnectionString = - "Server=(localdb)\\mssqllocaldb;Database=" + - $scope.initCmsModel.localDbName + - ";Trusted_Connection=True;MultipleActiveResultSets=true"; - $scope.initCmsModel.sqliteDbConnectionString = - "Data Source=" + $scope.initCmsModel.localDbName; - }; - $scope.updateDbProvider = function () { - $scope.initCmsModel.databaseProvider = $scope.dbProvider.value; - $scope.initCmsModel.databasePort = $scope.dbProvider.port; - }; - $scope.initCms = async function () { - if (!$scope.canConnect()) { - $rootScope.showErrors(["Please check your connection info"]); - return; - } - $rootScope.isBusy = true; - if ($scope.initCmsModel.siteName && $scope.initCmsModel.siteName != "") { - var result = await step1Services.initCms($scope.initCmsModel); - if (result.isSucceed) { - $rootScope.isBusy = false; - $rootScope.goToPath("/init/step2"); - $scope.$apply(); - } else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - $rootScope.showErrors(["Site name is required"]); - $rootScope.isBusy = false; - } - }; - }, -]); - -'use strict'; -app.factory('Step1Services', ['$http', '$rootScope', 'AppSettings', 'CommonService' - , function ($http, $rootScope, appSettings, commonService) { - - var step1ServiceFactory = {}; - var _saveDefaultSettings = async function () { - var req = { - method: 'GET', - url: '/portal/app-settings/save-default' - }; - return commonService.getAnonymousApiResult(req); - }; - - var _initCms = async function (data) { - var req = { - method: 'POST', - url: '/init/init-cms/step-1', - data: JSON.stringify(data) - }; - return await commonService.getAnonymousApiResult(req); - }; - - step1ServiceFactory.initCms = _initCms; - step1ServiceFactory.saveDefaultSettings = _saveDefaultSettings; - return step1ServiceFactory; - - }]); - -'use strict'; -app.controller('Step2Controller', - ['$scope', '$rootScope', '$location', 'Step2Services', 'AuthService', - function ($scope, $rootScope, $location, services, authService) { - $scope.user = { - userName: '', - email: '', - password: '', - confirmPassword: '', - isAgreed: false - } - $scope.register = async function () { - if (!$scope.user.isAgreed) { - var ele = document.getElementById("notTNCYetChecked"); - ele.style.display = "block"; - // $rootScope.showMessage('Please agreed with our policy', 'warning'); - } else { - if ($scope.password !== $scope.confirmPassword) { - $rootScope.showErrors(['Confirm Password is not matched']); - } else { - $rootScope.isBusy = true; - var result = await services.register($scope.user); - if (result.isSucceed) { - var loginData = { - userName: $scope.user.userName, - password: $scope.user.password, - rememberMe: true - } - var result = await authService.login(loginData); - if (result.isSucceed) { - $rootScope.isBusy = false; - $rootScope.goToPath("/init/step3"); - $scope.$apply(); - } - else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } - } - $scope.advanceSetup = async function () { - if (!$scope.user.isAgreed) { - var ele = document.getElementById("notTNCYetChecked"); - ele.style.display = "block"; - // $rootScope.showMessage('Please agreed with our policy', 'warning'); - } else { - if ($scope.password !== $scope.confirmPassword) { - $rootScope.showErrors(['Confirm Password is not matched']); - } else { - $rootScope.isBusy = true; - var result = await services.register($scope.user); - if (result.isSucceed) { - var loginData = { - userName: $scope.user.userName, - password: $scope.user.password, - rememberMe: true - } - var result = await authService.login(loginData); - if (result) { - $rootScope.isBusy = false; - // $location.url('/init/step3'); - $scope.$apply(); - } - else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } - } - }]); -'use strict'; -app.factory('Step2Services', ['$http', 'CommonService', function ($http, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var usersServiceFactory = {}; - var _register = async function (user) { - var req = { - method: 'POST', - url: '/init/init-cms/step-2', - data: JSON.stringify(user) - }; - - return await commonService.getApiResult(req); - }; - - usersServiceFactory.register = _register; - return usersServiceFactory; - -}]); - -"use strict"; -app.controller("Step3Controller", [ - "$scope", - "$rootScope", - "CommonService", - "AuthService", - "Step3Services", - function ($scope, $rootScope, commonService, authService, service) { - var rand = Math.random(); - $scope.data = { - isCreateDefault: true, - theme: null, - }; - $scope.themeType = "materialkit"; - $scope.init = async function () { - $scope.form = document.getElementById("frm-theme"); - $(".preventUncheck").on("change", function (e) { - if ($(".preventUncheck:checked").length == 0 && !this.checked) - this.checked = true; - }); - $(".option").click(function () { - $(".option").removeClass("active"); - $(this).addClass("active"); - }); - }; - $scope.submit = async function () { - $rootScope.isBusy = true; - var frm = new FormData(); - var url = "/init/init-cms/step-3"; - $scope.data.isCreateDefault = $scope.themeType === "materialkit"; - $rootScope.isBusy = true; - // Looping over all files and add it to FormData object - frm.append("theme", $scope.form["theme"].files[0]); - // Adding one more key to FormData object - frm.append("model", angular.toJson($scope.data)); - var response = await service.ajaxSubmitForm(frm, url); - if (response.isSucceed) { - $scope.viewModel = response.data; - authService.initSettings().then(function () { - $rootScope.isBusy = false; - setTimeout(() => { - $rootScope.goToSiteUrl("/portal"); - }, 500); - $scope.$apply(); - }); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('Step3Services', ['CommonService' - , function (commonService) { - - var service = {}; - var _submit = async function (data) { - var req = { - method: 'POST', - url: '/init/init-cms/step-3', - data: JSON.stringify(data) - }; - return await commonService.getApiResult(req); - }; - var _ajaxSubmitForm = async function (form, url) { - var req = { - method: 'POST', - url: url, - headers: { 'Content-Type': undefined }, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: form - }; - return await commonService.getApiResult(req); - }; - service.submit = _submit; - service.ajaxSubmitForm = _ajaxSubmitForm; - return service; - - }]); - -'use strict'; -app.controller('Step4Controller', ['$scope', '$rootScope', - 'CommonService', 'AuthService', 'Step4Services', - function ($scope, $rootScope, commonService, authService, service) { - var rand = Math.random(); - $scope.data = []; - $scope.init = async function () { - var getData = await commonService.loadJArrayData('languages.json'); - if (getData.isSucceed) { - $scope.data = getData.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (getData) { - $rootScope.showErrors(getData.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - - }; - $scope.submit = async function () { - $rootScope.isBusy = true; - var result = await service.submit($scope.data); - if (result.isSucceed) { - authService.initSettings().then(function () { - $rootScope.isBusy = false; - window.top.location = '/'; - }); - - } - else { - if (result) { $rootScope.showErrors(result.errors); } - $rootScope.isBusy = false; - } - } - }]); -'use strict'; -app.factory('Step4Services', ['CommonService' - , function (commonService) { - - var service = {}; - var _submit = async function (data) { - var req = { - method: 'POST', - url: '/init/init-cms/step-4', - data: JSON.stringify(data) - }; - return await commonService.getApiResult(req); - }; - service.submit = _submit; - return service; - - }]); - -'use strict'; -app.controller('Step5Controller', ['$scope', '$rootScope', '$location', - 'CommonService', 'Step5Services', - function ($scope, $rootScope, $location, commonService, service) { - var rand = Math.random(); - $scope.data = []; - $scope.init = async function () { - var getData = await commonService.loadJArrayData('configurations.json'); - if (getData.isSucceed) { - $scope.data = getData.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (getData) { - $rootScope.showErrors(getData.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - - }; - $scope.submit = async function () { - $rootScope.isBusy = true; - var result = await service.submit($scope.data); - if (result.isSucceed) { - $rootScope.isBusy = false; - window.top.location = "/"; - } - else { - if (result) { $rootScope.showErrors(result.errors); } - $rootScope.isBusy = false; - } - } - }]); -'use strict'; -app.factory('Step5Services', ['CommonService' - , function (commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var service = {}; - var _submit = async function (data) { - var req = { - method: 'POST', - url: '/init/init-cms/step-5', - data: JSON.stringify(data) - }; - return await commonService.getApiResult(req); - }; - service.submit = _submit; - return service; - - }]); - -modules.component('mssqlLocalInfo', { - templateUrl: '/mix-app/views/app-init/pages/step1/components/mssql-local-info/view.html', - controller: ['$rootScope', - function ($rootScope) { - var ctrl = this; - - } - ], - bindings: { - initCmsModel: '=' - } -}); -modules.component('mssqlInfo', { - templateUrl: '/mix-app/views/app-init/pages/step1/components/mssql-info/view.html', - controller: ['$rootScope', - function ($rootScope) { - var ctrl = this; - - } - ], - bindings: { - initCmsModel: '=' - } -}); -modules.component('mysqlInfo', { - templateUrl: '/mix-app/views/app-init/pages/step1/components/mysql-info/view.html', - controller: ['$rootScope', - function ($rootScope) { - var ctrl = this; - } - ], - bindings: { - initCmsModel: '=' - } -}); -modules.component('posgresqlInfo', { - templateUrl: '/mix-app/views/app-init/pages/step1/components/posgresql-info/view.html', - controller: ['$rootScope', - function ($rootScope) { - var ctrl = this; - } - ], - bindings: { - initCmsModel: '=' - } -}); -modules.component('sqliteInfo', { - templateUrl: '/mix-app/views/app-init/pages/step1/components/sqlite-info/view.html', - controller: ['$rootScope', - function ($rootScope) { - var ctrl = this; - - } - ], - bindings: { - initCmsModel: '=' - } -}); - -app.component('initCommonLanguages', { - templateUrl: '/mix-app/views/app-init/pages/step4/components/common-languages/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.languages, ['category'], ['Common']); - } - }], - bindings: { - languages: '=', - } -}); - -app.component('initPortalLanguages', { - templateUrl: '/mix-app/views/app-init/pages/step4/components/portal-languages/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.languages, ['category'], ['Portal']); - } - }], - bindings: { - languages: '=', - } -}); - -app.component('initFbConfigurations', { - templateUrl: '/mix-app/views/app-init/pages/step3/components/fb-configurations/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.configurations, ['category'], ['Social_Facebook']); - } - }], - bindings: { - configurations: '=', - } -}); - -app.component('initGgConfigurations', { - templateUrl: '/mix-app/views/app-init/pages/step3/components/gg-configurations/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.configurations, ['category'], ['Social_Google']); - } - }], - bindings: { - configurations: '=', - } -}); - -modules.component('initValueEditor', { - templateUrl: '/mix-app/views/app-init/pages/step3/components/init-value-editor/view.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', 'FileService' - , function ($rootScope, $scope, ngAppSettings, fileService) { - var ctrl = this; - ctrl.icons = ngAppSettings.icons; - ctrl.mediaFile = { - file: null, - fullPath: '', - fileFolder: 'content/site', - title: '', - description: '' - }; - this.dataTypes = ngAppSettings.dataTypes; - ctrl.initEditor = function () { - ctrl.data.value = ctrl.data.default || null; - setTimeout(function () { - // Init Code editor - $.each($('.code-editor'), function (i, e) { - var container = $(this); - var editor = ace.edit(e); - if (container.hasClass('json')) { - editor.session.setMode("ace/mode/json"); - } - else { - editor.session.setMode("ace/mode/razor"); - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - - editor.session.setUseWrapMode(true); - editor.setOptions({ - maxLines: Infinity - }); - editor.getSession().on('change', function (e) { - // e.type, etc - $(container).parent().find('.code-content').val(editor.getValue()); - }); - }) - $.each($('.editor-content'), function (i, e) { - var $demoTextarea = $(e); - $demoTextarea.trumbowyg({ - semantic: false - }).on('tbwblur', function () { - ctrl.data.value = $demoTextarea.val(); - }); - }); - }, 200); - }; - ctrl.selectFile = function (file, errFiles) { - if (file !== undefined && file !== null) { - ctrl.mediaFile.folder = ctrl.folder ? ctrl.folder : 'Media'; - ctrl.mediaFile.title = ctrl.title ? ctrl.title : ''; - ctrl.mediaFile.description = ctrl.description ? ctrl.description : ''; - ctrl.mediaFile.file = file; - - ctrl.uploadFile(file); - } - }; - ctrl.uploadFile = async function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = async function () { - ctrl.mediaFile.fileName = file.name.substring(0, file.name.lastIndexOf('.')); - ctrl.mediaFile.extension = file.name.substring(file.name.lastIndexOf('.')); - ctrl.mediaFile.fileStream = reader.result; - var resp = await fileService.save(ctrl.mediaFile); - if (resp && resp.isSucceed) { - ctrl.data.value = resp.data.webPath; - ctrl.srcUrl = resp.data.webPath; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - reader.onerror = function (error) { - - }; - } - else { - return null; - } - - } - - } - ], - bindings: { - data: '=', - inputClass: '=', - isShowTitle: '=', - title: '=' - } -}); - -app.component('initSiteConfigurations', { - templateUrl: '/mix-app/views/app-init/pages/step3/components/site-configurations/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.configurations, ['category'], ['Site_Common']); - } - }], - bindings: { - configurations: '=', - } -}); - -app.component('initSysConfigurations', { - templateUrl: '/mix-app/views/app-init/pages/step3/components/site-configurations/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.data = []; - ctrl.$onInit = function () { - ctrl.data = $rootScope.filterArray(ctrl.configurations, ['category'], ['System']); - }; - }], - bindings: { - configurations: '=', - } -}); \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-portal-required.min.js b/src/Mix.Cms.Web/wwwroot/mix-app/js/app-portal-required.min.js deleted file mode 100644 index 51f1b9295..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-portal-required.min.js +++ /dev/null @@ -1 +0,0 @@ -/* Wed Feb 24 2021 09:22:49 GMT+0700 (Indochina Time) */!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],i=Object.getPrototypeOf,r=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,f=c.toString,d=f.call(Object),h={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},g=function(e){return null!=e&&e===e.window},m=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var i,r,o=(n=n||m).createElement("script");if(o.text=e,t)for(i in v)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var _="3.5.1",w=function(e,t){return new w.fn.init(e,t)};function x(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!p(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+H+")"+H+"*"),U=new RegExp(H+"|>"),X=new RegExp(F),K=new RegExp("^"+M+"$"),Y={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,V=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+H+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},se=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(D=O.call(w.childNodes),w.childNodes),D[w.childNodes.length].nodeType}catch(t){P={apply:D.length?function(e,t){j.apply(e,O.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function ae(e,t,i,r){var o,a,u,c,f,p,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return i;if(!r&&(d(t),t=t||h,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(u=t.getElementById(o)))return i;if(u.id===o)return i.push(u),i}else if(y&&(u=y.getElementById(o))&&b(t,u)&&u.id===o)return i.push(u),i}else{if(f[2])return P.apply(i,t.getElementsByTagName(e)),i;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return P.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!A[e+" "]&&(!m||!m.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===w&&(U.test(e)||z.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(ie,re):t.setAttribute("id",c=_)),a=(p=s(e)).length;a--;)p[a]=(c?"#"+c:":scope")+" "+be(p[a]);v=p.join(",")}try{return P.apply(i,y.querySelectorAll(v)),i}catch(t){A(e,!0)}finally{c===_&&t.removeAttribute("id")}}}return l(e.replace($,"$1"),t,i,r)}function le(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ue(e){return e[_]=!0,e}function ce(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function me(e){return ue(function(t){return t=+t,ue(function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!G.test(t||n&&n.nodeName||"HTML")},d=ae.setDocument=function(e){var t,r,s=e?e.ownerDocument||e:w;return s!=h&&9===s.nodeType&&s.documentElement&&(p=(h=s).documentElement,g=!o(h),w!=h&&(r=h.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.scope=ce(function(e){return p.appendChild(e).appendChild(h.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(h.getElementsByClassName),n.getById=ce(function(e){return p.appendChild(e).id=_,!h.getElementsByName||!h.getElementsByName(_).length}),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=J.test(h.querySelectorAll))&&(ce(function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+H+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+H+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+_+"-]").length||m.push("~="),(t=h.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+H+"*name"+H+"*="+H+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+H+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=J.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",F)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=J.test(p.compareDocumentPosition),b=t||J.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},L=t?function(e,t){if(e===t)return f=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==h||e.ownerDocument==w&&b(w,e)?-1:t==h||t.ownerDocument==w&&b(w,t)?1:c?I(c,e)-I(c,t):0:4&i?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o)return e==h?-1:t==h?1:r?-1:o?1:c?I(c,e)-I(c,t):0;if(r===o)return de(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?de(s[i],a[i]):s[i]==w?-1:a[i]==w?1:0}),h},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&g&&!A[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(i){var r=ae.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function S(e,t,n){return p(t)?w.grep(e,function(e,i){return!!t.call(e,i,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:N.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:m,!0)),L.test(i[1])&&w.isPlainObject(t))for(i in t)p(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=m.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,D=w(m);var j=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,pe=/^$|^module$|\/(?:java|ecma)script/i;ce=m.createDocumentFragment().appendChild(m.createElement("div")),(fe=m.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),h.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",h.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",h.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,i=e.length;n",""]);var ye=/<|&#?\w+;/;function be(e,t,n,i,r){for(var o,s,a,l,u,c,f=t.createDocumentFragment(),d=[],h=0,p=e.length;h\s*$/g;function Ne(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Pe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,i,r,o,s,a;if(1===t.nodeType){if(G.hasData(e)&&(a=G.get(e).events))for(r in G.remove(t,"handle events"),a)for(n=0,i=a[r].length;n").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),m.head.appendChild(t[0])},abort:function(){n&&n()}}});var Ut,Xt=[],Kt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||w.expando+"_"+Et.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,i){var r,o,s,a=!1!==t.jsonp&&(Kt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Kt,"$1"+r):!1!==t.jsonp&&(t.url+=(Tt.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||w.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){s=arguments},i.always(function(){void 0===o?w(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Xt.push(r)),s&&p(o)&&o(s[0]),s=o=void 0}),"script"}),h.createHTMLDocument=((Ut=m.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(h.createHTMLDocument?((i=(t=m.implementation.createHTMLDocument("")).createElement("base")).href=m.location.href,t.head.appendChild(i)):t=m),o=!n&&[],(r=L.exec(e))?[t.createElement(r[1])]:(r=be([e],t,o),o&&o.length&&w(o).remove(),w.merge([],r.childNodes)));var i,r,o},w.fn.load=function(e,t,n){var i,r,o,s=this,a=e.indexOf(" ");return-1").append(w.parseHTML(e)).find(i):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var i,r,o,s,a,l,u=w.css(e,"position"),c=w(e),f={};"static"===u&&(e.style.position="relative"),a=c.offset(),o=w.css(e,"top"),l=w.css(e,"left"),("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(s=(i=c.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),p(t)&&(t=t.call(e,n,w.extend({},a))),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+r),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===w.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),r.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-w.css(i,"marginTop",!0),left:t.left-r.left-w.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||ie})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(i){return $(this,function(e,i,r){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r},e,i,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=$e(h.pixelPosition,function(e,n){if(n)return n=Re(e,t),He.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){w.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return $(this,function(t,n,r){var o;return g(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?w.css(t,n,a):w.style(t,n,r,a)},t,s?r:void 0,s)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return 00,i._pointerEvent=Boolean(window.PointerEvent),i._addEventListeners(),i}o(t,e);var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&v(this._element)&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(e){e||(this._isPaused=!0),K(".carousel-item-next, .carousel-item-prev",this._element)&&(h(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(e){var t=this;this._activeElement=K(".active.carousel-item",this._element);var n=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)q.one(this._element,"slid.bs.carousel",function(){return t.to(e)});else{if(n===e)return this.pause(),void this.cycle();var i=e>n?"next":"prev";this._slide(i,this._items[e])}},n.dispose=function(){e.prototype.dispose.call(this),q.off(this._element,".bs.carousel"),this._items=null,this._config=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(e){return e=r({},V,e),m("carousel",e,Q),e},n._handleSwipe=function(){var e=Math.abs(this.touchDeltaX);if(!(e<=40)){var t=e/this.touchDeltaX;this.touchDeltaX=0,t>0&&(w?this.next():this.prev()),t<0&&(w?this.prev():this.next())}},n._addEventListeners=function(){var e=this;this._config.keyboard&&q.on(this._element,"keydown.bs.carousel",function(t){return e._keydown(t)}),"hover"===this._config.pause&&(q.on(this._element,"mouseenter.bs.carousel",function(t){return e.pause(t)}),q.on(this._element,"mouseleave.bs.carousel",function(t){return e.cycle(t)})),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var e=this,t=function(t){!e._pointerEvent||"pen"!==t.pointerType&&"touch"!==t.pointerType?e._pointerEvent||(e.touchStartX=t.touches[0].clientX):e.touchStartX=t.clientX},n=function(t){!e._pointerEvent||"pen"!==t.pointerType&&"touch"!==t.pointerType||(e.touchDeltaX=t.clientX-e.touchStartX),e._handleSwipe(),"hover"===e._config.pause&&(e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval))};X(".carousel-item img",this._element).forEach(function(e){q.on(e,"dragstart.bs.carousel",function(e){return e.preventDefault()})}),this._pointerEvent?(q.on(this._element,"pointerdown.bs.carousel",function(e){return t(e)}),q.on(this._element,"pointerup.bs.carousel",function(e){return n(e)}),this._element.classList.add("pointer-event")):(q.on(this._element,"touchstart.bs.carousel",function(e){return t(e)}),q.on(this._element,"touchmove.bs.carousel",function(t){return function(t){t.touches&&t.touches.length>1?e.touchDeltaX=0:e.touchDeltaX=t.touches[0].clientX-e.touchStartX}(t)}),q.on(this._element,"touchend.bs.carousel",function(e){return n(e)}))},n._keydown=function(e){/input|textarea/i.test(e.target.tagName)||("ArrowLeft"===e.key?(e.preventDefault(),w?this.next():this.prev()):"ArrowRight"===e.key&&(e.preventDefault(),w?this.prev():this.next()))},n._getItemIndex=function(e){return this._items=e&&e.parentNode?X(".carousel-item",e.parentNode):[],this._items.indexOf(e)},n._getItemByDirection=function(e,t){var n="next"===e,i="prev"===e,r=this._getItemIndex(t),o=this._items.length-1;if((i&&0===r||n&&r===o)&&!this._config.wrap)return t;var s=(r+("prev"===e?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},n._triggerSlideEvent=function(e,t){var n=this._getItemIndex(e),i=this._getItemIndex(K(".active.carousel-item",this._element));return q.trigger(this._element,"slide.bs.carousel",{relatedTarget:e,direction:t,from:i,to:n})},n._setActiveIndicatorElement=function(e){if(this._indicatorsElement){var t=K(".active",this._indicatorsElement);t.classList.remove("active"),t.removeAttribute("aria-current");for(var n=X("[data-bs-target]",this._indicatorsElement),i=0;i0)for(var i=0;i0&&r--,"ArrowDown"===e.key&&rdocument.documentElement.clientHeight;t||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var n=d(this._dialog);q.off(this._element,"transitionend"),q.one(this._element,"transitionend",function(){e._element.classList.remove("modal-static"),t||(q.one(e._element,"transitionend",function(){e._element.style.overflowY=""}),g(e._element,n))}),g(this._element,n),this._element.focus()}},n._adjustDialog=function(){var e=this._element.scrollHeight>document.documentElement.clientHeight;(!this._isBodyOverflowing&&e&&!w||this._isBodyOverflowing&&!e&&w)&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),(this._isBodyOverflowing&&!e&&!w||!this._isBodyOverflowing&&e&&w)&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(e.left+e.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Te={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},ke=function(n){function s(e,i){var r;if(void 0===t)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(r=n.call(this,e)||this)._isEnabled=!0,r._timeout=0,r._hoverState="",r._activeTrigger={},r._popper=null,r.config=r._getConfig(i),r.tip=null,r._setListeners(),r}o(s,n);var a=s.prototype;return a.enable=function(){this._isEnabled=!0},a.disable=function(){this._isEnabled=!1},a.toggleEnabled=function(){this._isEnabled=!this._isEnabled},a.toggle=function(e){if(this._isEnabled)if(e){var t=this._initializeOnDelegatedTarget(e);t._activeTrigger.click=!t._activeTrigger.click,t._isWithActiveTrigger()?t._enter(null,t):t._leave(null,t)}else{if(this.getTipElement().classList.contains("show"))return void this._leave(null,this);this._enter(null,this)}},a.dispose=function(){clearTimeout(this._timeout),q.off(this._element,this.constructor.EVENT_KEY),q.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.tip&&this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.config=null,this.tip=null,n.prototype.dispose.call(this)},a.show=function(){var t=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this.isWithContent()&&this._isEnabled){var n=q.trigger(this._element,this.constructor.Event.SHOW),i=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var n=t.getRootNode();return n instanceof ShadowRoot?n:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null}(this._element),r=null===i?this._element.ownerDocument.documentElement.contains(this._element):i.contains(this._element);if(!n.defaultPrevented&&r){var o=this.getTipElement(),s=l(this.constructor.NAME);o.setAttribute("id",s),this._element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&o.classList.add("fade");var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this._element):this.config.placement,u=this._getAttachment(a);this._addAttachmentClass(u);var c=this._getContainer();T(o,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||c.appendChild(o),q.trigger(this._element,this.constructor.Event.INSERTED),this._popper=e.createPopper(this._element,o,this._getPopperConfig(u)),o.classList.add("show");var f,h,p="function"==typeof this.config.customClass?this.config.customClass():this.config.customClass;p&&(f=o.classList).add.apply(f,p.split(" ")),"ontouchstart"in document.documentElement&&(h=[]).concat.apply(h,document.body.children).forEach(function(e){q.on(e,"mouseover",function(){})});var m=function(){var e=t._hoverState;t._hoverState=null,q.trigger(t._element,t.constructor.Event.SHOWN),"out"===e&&t._leave(null,t)};if(this.tip.classList.contains("fade")){var v=d(this.tip);q.one(this.tip,"transitionend",m),g(this.tip,v)}else m()}}},a.hide=function(){var e=this;if(this._popper){var t=this.getTipElement(),n=function(){"show"!==e._hoverState&&t.parentNode&&t.parentNode.removeChild(t),e._cleanTipClass(),e._element.removeAttribute("aria-describedby"),q.trigger(e._element,e.constructor.Event.HIDDEN),e._popper&&(e._popper.destroy(),e._popper=null)};if(!q.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented){var i;if(t.classList.remove("show"),"ontouchstart"in document.documentElement&&(i=[]).concat.apply(i,document.body.children).forEach(function(e){return q.off(e,"mouseover",y)}),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this.tip.classList.contains("fade")){var r=d(t);q.one(t,"transitionend",n),g(t,r)}else n();this._hoverState=""}}},a.update=function(){null!==this._popper&&this._popper.update()},a.isWithContent=function(){return Boolean(this.getTitle())},a.getTipElement=function(){if(this.tip)return this.tip;var e=document.createElement("div");return e.innerHTML=this.config.template,this.tip=e.children[0],this.tip},a.setContent=function(){var e=this.getTipElement();this.setElementContent(K(".tooltip-inner",e),this.getTitle()),e.classList.remove("fade","show")},a.setElementContent=function(e,t){if(null!==e)return"object"==typeof t&&p(t)?(t.jquery&&(t=t[0]),void(this.config.html?t.parentNode!==e&&(e.innerHTML="",e.appendChild(t)):e.textContent=t.textContent)):void(this.config.html?(this.config.sanitize&&(t=ye(t,this.config.allowList,this.config.sanitizeFn)),e.innerHTML=t):e.textContent=t)},a.getTitle=function(){var e=this._element.getAttribute("data-bs-original-title");return e||(e="function"==typeof this.config.title?this.config.title.call(this._element):this.config.title),e},a.updateAttachment=function(e){return"right"===e?"end":"left"===e?"start":e},a._initializeOnDelegatedTarget=function(e,t){var n=this.constructor.DATA_KEY;return(t=t||k(e.delegateTarget,n))||(t=new this.constructor(e.delegateTarget,this._getDelegateConfig()),T(e.delegateTarget,n,t)),t},a._getOffset=function(){var e=this,t=this.config.offset;return"string"==typeof t?t.split(",").map(function(e){return Number.parseInt(e,10)}):"function"==typeof t?function(n){return t(n,e._element)}:t},a._getPopperConfig=function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{altBoundary:!0,fallbackPlacements:this.config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this.config.boundary}},{name:"arrow",options:{element:"."+this.constructor.NAME+"-arrow"}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:function(e){return t._handlePopperPlacementChange(e)}}],onFirstUpdate:function(e){e.options.placement!==e.placement&&t._handlePopperPlacementChange(e)}};return r({},n,"function"==typeof this.config.popperConfig?this.config.popperConfig(n):this.config.popperConfig)},a._addAttachmentClass=function(e){this.getTipElement().classList.add("bs-tooltip-"+this.updateAttachment(e))},a._getContainer=function(){return!1===this.config.container?document.body:p(this.config.container)?this.config.container:K(this.config.container)},a._getAttachment=function(e){return xe[e.toUpperCase()]},a._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)q.on(e._element,e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if("manual"!==t){var n="hover"===t?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,i="hover"===t?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;q.on(e._element,n,e.config.selector,function(t){return e._enter(t)}),q.on(e._element,i,e.config.selector,function(t){return e._leave(t)})}}),this._hideModalHandler=function(){e._element&&e.hide()},q.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},a._fixTitle=function(){var e=this._element.getAttribute("title"),t=typeof this._element.getAttribute("data-bs-original-title");(e||"string"!==t)&&(this._element.setAttribute("data-bs-original-title",e||""),!e||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",e),this._element.setAttribute("title",""))},a._enter=function(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusin"===e.type?"focus":"hover"]=!0),t.getTipElement().classList.contains("show")||"show"===t._hoverState?t._hoverState="show":(clearTimeout(t._timeout),t._hoverState="show",t.config.delay&&t.config.delay.show?t._timeout=setTimeout(function(){"show"===t._hoverState&&t.show()},t.config.delay.show):t.show())},a._leave=function(e,t){t=this._initializeOnDelegatedTarget(e,t),e&&(t._activeTrigger["focusout"===e.type?"focus":"hover"]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState="out",t.config.delay&&t.config.delay.hide?t._timeout=setTimeout(function(){"out"===t._hoverState&&t.hide()},t.config.delay.hide):t.hide())},a._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},a._getConfig=function(e){var t=U.getDataAttributes(this._element);return Object.keys(t).forEach(function(e){_e.has(e)&&delete t[e]}),e&&"object"==typeof e.container&&e.container.jquery&&(e.container=e.container[0]),"number"==typeof(e=r({},this.constructor.Default,t,"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),m("tooltip",e,this.constructor.DefaultType),e.sanitize&&(e.template=ye(e.template,e.allowList,e.sanitizeFn)),e},a._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},a._cleanTipClass=function(){var e=this.getTipElement(),t=e.getAttribute("class").match(be);null!==t&&t.length>0&&t.map(function(e){return e.trim()}).forEach(function(t){return e.classList.remove(t)})},a._handlePopperPlacementChange=function(e){var t=e.state;t&&(this.tip=t.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(t.placement)))},s.jQueryInterface=function(e){return this.each(function(){var t=k(this,"bs.tooltip"),n="object"==typeof e&&e;if((t||!/dispose|hide/.test(e))&&(t||(t=new s(this,n)),"string"==typeof e)){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},i(s,null,[{key:"Default",get:function(){return Ee}},{key:"NAME",get:function(){return"tooltip"}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Te}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return we}}]),s}(F);x("tooltip",ke);var Ce=new RegExp("(^|\\s)bs-popover\\S+","g"),Ae=r({},ke.Default,{placement:"right",offset:[0,8],trigger:"click",content:"",template:''}),Le=r({},ke.DefaultType,{content:"(string|element|function)"}),Se={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},De=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.isWithContent=function(){return this.getTitle()||this._getContent()},n.setContent=function(){var e=this.getTipElement();this.setElementContent(K(".popover-header",e),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this._element)),this.setElementContent(K(".popover-body",e),t),e.classList.remove("fade","show")},n._addAttachmentClass=function(e){this.getTipElement().classList.add("bs-popover-"+this.updateAttachment(e))},n._getContent=function(){return this._element.getAttribute("data-bs-content")||this.config.content},n._cleanTipClass=function(){var e=this.getTipElement(),t=e.getAttribute("class").match(Ce);null!==t&&t.length>0&&t.map(function(e){return e.trim()}).forEach(function(t){return e.classList.remove(t)})},t.jQueryInterface=function(e){return this.each(function(){var n=k(this,"bs.popover"),i="object"==typeof e?e:null;if((n||!/dispose|hide/.test(e))&&(n||(n=new t(this,i),T(this,"bs.popover",n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},i(t,null,[{key:"Default",get:function(){return Ae}},{key:"NAME",get:function(){return"popover"}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return Se}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return Le}}]),t}(ke);x("popover",De);var Ne={offset:10,method:"auto",target:""},je={offset:"number",method:"string",target:"(string|element)"},Pe=function(e){function t(t,n){var i;return(i=e.call(this,t)||this)._scrollElement="BODY"===t.tagName?window:t,i._config=i._getConfig(n),i._selector=i._config.target+" .nav-link, "+i._config.target+" .list-group-item, "+i._config.target+" .dropdown-item",i._offsets=[],i._targets=[],i._activeTarget=null,i._scrollHeight=0,q.on(i._scrollElement,"scroll.bs.scrollspy",function(){return i._process()}),i.refresh(),i._process(),i}o(t,e);var n=t.prototype;return n.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?"offset":"position",n="auto"===this._config.method?t:this._config.method,i="position"===n?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),X(this._selector).map(function(e){var t=c(e),r=t?K(t):null;if(r){var o=r.getBoundingClientRect();if(o.width||o.height)return[U[n](r).top+i,t]}return null}).filter(function(e){return e}).sort(function(e,t){return e[0]-t[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},n.dispose=function(){e.prototype.dispose.call(this),q.off(this._scrollElement,".bs.scrollspy"),this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(e){if("string"!=typeof(e=r({},Ne,"object"==typeof e&&e?e:{})).target&&p(e.target)){var t=e.target.id;t||(t=l("scrollspy"),e.target.id=t),e.target="#"+t}return m("scrollspy",e,je),e},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&e0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;)this._activeTarget!==this._targets[r]&&e>=this._offsets[r]&&(void 0===this._offsets[r+1]||e li > .active":".active";t=(t=X(r,i))[t.length-1]}var o=t?q.trigger(t,"hide.bs.tab",{relatedTarget:this._element}):null;if(!(q.trigger(this._element,"show.bs.tab",{relatedTarget:t}).defaultPrevented||null!==o&&o.defaultPrevented)){this._activate(this._element,i);var s=function(){q.trigger(t,"hidden.bs.tab",{relatedTarget:e._element}),q.trigger(e._element,"shown.bs.tab",{relatedTarget:t})};n?this._activate(n,n.parentNode,s):s()}}},n._activate=function(e,t,n){var i=this,r=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?Y(t,".active"):X(":scope > li > .active",t))[0],o=n&&r&&r.classList.contains("fade"),s=function(){return i._transitionComplete(e,r,n)};if(r&&o){var a=d(r);r.classList.remove("show"),q.one(r,"transitionend",s),g(r,a)}else s()},n._transitionComplete=function(e,t,n){if(t){t.classList.remove("active");var i=K(":scope > .dropdown-menu .active",t.parentNode);i&&i.classList.remove("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}e.classList.add("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),b(e),e.classList.contains("fade")&&e.classList.add("show"),e.parentNode&&e.parentNode.classList.contains("dropdown-menu")&&(e.closest(".dropdown")&&X(".dropdown-toggle").forEach(function(e){return e.classList.add("active")}),e.setAttribute("aria-expanded",!0)),n&&n()},t.jQueryInterface=function(e){return this.each(function(){var n=k(this,"bs.tab")||new t(this);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},i(t,null,[{key:"DATA_KEY",get:function(){return"bs.tab"}}]),t}(F);q.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',function(e){e.preventDefault(),(k(this,"bs.tab")||new Oe(this)).show()}),x("tab",Oe);var Ie={animation:"boolean",autohide:"boolean",delay:"number"},Be={animation:!0,autohide:!0,delay:5e3},He=function(e){function t(t,n){var i;return(i=e.call(this,t)||this)._config=i._getConfig(n),i._timeout=null,i._setListeners(),i}o(t,e);var n=t.prototype;return n.show=function(){var e=this;if(!q.trigger(this._element,"show.bs.toast").defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var t=function(){e._element.classList.remove("showing"),e._element.classList.add("show"),q.trigger(e._element,"shown.bs.toast"),e._config.autohide&&(e._timeout=setTimeout(function(){e.hide()},e._config.delay))};if(this._element.classList.remove("hide"),b(this._element),this._element.classList.add("showing"),this._config.animation){var n=d(this._element);q.one(this._element,"transitionend",t),g(this._element,n)}else t()}},n.hide=function(){var e=this;if(this._element.classList.contains("show")&&!q.trigger(this._element,"hide.bs.toast").defaultPrevented){var t=function(){e._element.classList.add("hide"),q.trigger(e._element,"hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var n=d(this._element);q.one(this._element,"transitionend",t),g(this._element,n)}else t()}},n.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),q.off(this._element,"click.dismiss.bs.toast"),e.prototype.dispose.call(this),this._config=null},n._getConfig=function(e){return e=r({},Be,U.getDataAttributes(this._element),"object"==typeof e&&e?e:{}),m("toast",e,this.constructor.DefaultType),e},n._setListeners=function(){var e=this;q.on(this._element,"click.dismiss.bs.toast",'[data-bs-dismiss="toast"]',function(){return e.hide()})},n._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t.jQueryInterface=function(e){return this.each(function(){var n=k(this,"bs.toast");if(n||(n=new t(this,"object"==typeof e&&e)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e](this)}})},i(t,null,[{key:"DefaultType",get:function(){return Ie}},{key:"Default",get:function(){return Be}},{key:"DATA_KEY",get:function(){return"bs.toast"}}]),t}(F);return x("toast",He),{Alert:R,Button:$,Carousel:J,Collapse:te,Dropdown:fe,Modal:pe,Popover:De,ScrollSpy:Pe,Tab:Oe,Toast:He,Tooltip:ke}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(t,i,r){i={content:{message:"object"==typeof i?i.message:i,title:i.title?i.title:"",icon:i.icon?i.icon:"",url:i.url?i.url:"#",target:i.target?i.target:"-"}},r=e.extend(!0,{},i,r),this.settings=e.extend(!0,{},n,r),this._defaults=n,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var n={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:''};String.format=function(){for(var e=arguments[0],t=1;t .progress-bar').removeClass("progress-bar-"+e.settings.type),e.settings.type=i[t],this.$ele.addClass("alert-"+i[t]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[t]);break;case"icon":var r=this.$ele.find('[data-notify="icon"]');"class"==e.settings.icon_type.toLowerCase()?r.removeClass(e.settings.content.icon).addClass(i[t]):(r.is("img")||r.find("img"),r.attr("src",i[t]));break;case"progress":var o=e.settings.delay-e.settings.delay*(i[t]/100);this.$ele.data("notify-delay",o),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[t]).css("width",i[t]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[t]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[t]);break;default:this.$ele.find('[data-notify="'+t+'"]').html(i[t])}var s=this.$ele.outerHeight()+parseInt(e.settings.spacing)+parseInt(e.settings.offset.y);e.reposition(s)},close:function(){e.close()}}},buildNotify:function(){var t=this.settings.content;this.$ele=e(String.format(this.settings.template,this.settings.type,t.title,t.message,t.url,t.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('Notify Icon')},styleDismiss:function(){this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1})},placement:function(){var t=this,n=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},r=!1,o=this.settings;switch(e('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){return n=Math.max(n,parseInt(e(this).css(o.placement.from))+parseInt(e(this).outerHeight())+parseInt(o.spacing))}),1==this.settings.newest_on_top&&(n=this.settings.offset.y),i[this.settings.placement.from]=n+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),e.each(Array("webkit","moz","o","ms",""),function(e,n){t.$ele[0].style[n+"AnimationIterationCount"]=1}),e(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(n=parseInt(n)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(n)),e.isFunction(t.settings.onShow)&&t.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(e){r=!0}).one(this.animations.end,function(n){e.isFunction(t.settings.onShown)&&t.settings.onShown.call(this)}),setTimeout(function(){r||e.isFunction(t.settings.onShown)&&t.settings.onShown.call(this)},600)},bind:function(){var t=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){t.close()}),this.$ele.mouseover(function(t){e(this).data("data-hover","true")}).mouseout(function(t){e(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){t.$ele.data("notify-delay",t.settings.delay);var n=setInterval(function(){var e=parseInt(t.$ele.data("notify-delay"))-t.settings.timer;if("false"===t.$ele.data("data-hover")&&"pause"==t.settings.mouse_over||"pause"!=t.settings.mouse_over){var i=(t.settings.delay-e)/t.settings.delay*100;t.$ele.data("notify-delay",e),t.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}e<=-t.settings.timer&&(clearInterval(n),t.close())},t.settings.timer)}},close:function(){var t=this,n=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),t.reposition(n),e.isFunction(t.settings.onClose)&&t.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(e){i=!0}).one(this.animations.end,function(n){e(this).remove(),e.isFunction(t.settings.onClosed)&&t.settings.onClosed.call(this)}),setTimeout(function(){i||(t.$ele.remove(),t.settings.onClosed&&t.settings.onClosed(t.$ele))},600)},reposition:function(t){var n=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',r=this.$ele.nextAll(i);1==this.settings.newest_on_top&&(r=this.$ele.prevAll(i)),r.each(function(){e(this).css(n.settings.placement.from,t),t=parseInt(t)+parseInt(n.settings.spacing)+e(this).outerHeight()})}}),e.notify=function(e,n){return new t(this,e,n).notify},e.notifyDefaults=function(t){return n=e.extend(!0,{},n,t)},e.notifyClose=function(t){void 0===t||"all"==t?e("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):e('[data-notify-position="'+t+'"]').find('[data-notify="dismiss"]').trigger("click")}});var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof i?new i(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof l)){if(g&&b!=t.length-1){if(d.lastIndex=_,!(A=d.exec(e)))break;for(var x=A.index+(p?A[1].length:0),E=A.index+A[0].length,T=b,k=_,C=t.length;T"+o.content+""},!_self.document)return _self.addEventListener&&(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),i=t.language,r=t.code,o=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[i],i)),o&&_self.close()},!1)),_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism),Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css",greedy:!0}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}}),Prism.languages.javascript["template-string"].inside.interpolation.inside.rest=Prism.languages.javascript,Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript",greedy:!0}}),Prism.languages.js=Prism.languages.javascript,"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(t){for(var n,i=t.getAttribute("data-src"),r=t,o=/\blang(?:uage)?-([\w-]+)\b/i;r&&!o.test(r.className);)r=r.parentNode;if(r&&(n=(t.className.match(o)||[,""])[1]),!n){var s=(i.match(/\.(\w+)$/)||[,""])[1];n=e[s]||s}var a=document.createElement("code");a.className="language-"+n,t.textContent="",a.textContent="Loading…",t.appendChild(a);var l=new XMLHttpRequest;l.open("GET",i,!0),l.onreadystatechange=function(){4==l.readyState&&(l.status<400&&l.responseText?(a.textContent=l.responseText,Prism.highlightElement(a)):400<=l.status?a.textContent="✖ Error "+l.status+" while fetching file: "+l.statusText:a.textContent="✖ Error: File does not exist or is empty")},l.send(null)}),Prism.plugins.toolbar&&Prism.plugins.toolbar.registerButton("download-file",function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-src")&&t.hasAttribute("data-download-link")){var n=t.getAttribute("data-src"),i=document.createElement("a");return i.textContent=t.getAttribute("data-download-link-label")||"Download",i.setAttribute("download",""),i.href=n,i}})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight)),function(e,t,n){var i,r=e.getElementsByTagName(t)[0];e.getElementById(n)||((i=e.createElement(t)).id=n,i.src="https://connect.facebook.net/en_US/sdk.js",r.parentNode.insertBefore(i,r))}(document,"script","facebook-jssdk"),function(e,t,n,i,r,o){(i=e.gapi||(e.gapi={})).analytics={q:[],ready:function(e){this.q.push(e)}},r=t.createElement(n),o=t.getElementsByTagName(n)[0],r.src="https://apis.google.com/js/platform.js",o.parentNode.insertBefore(r,o),r.onload=function(){i.load("analytics")}}(window,document,"script"),function(e,t,n){var i,r=e.getElementsByTagName(t)[0];e.getElementById(n)||((i=e.createElement(t)).id=n,i.src="https://connect.facebook.net/vi_VN/sdk/xfbml.customerchat.js",r.parentNode.insertBefore(i,r))}(document,"script","facebook-jssdk"),function(e){e.fn.qrcode=function(t){var n;function i(e){this.mode=n,this.data=e}function r(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function o(e,t){if(null==e.length)throw Error(e.length+"/"+t);for(var n=0;ne||this.moduleCount<=e||0>t||this.moduleCount<=t)throw Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){var e=1;for(e=1;40>e;e++){for(var t=s.getRSBlocks(e,this.errorCorrectLevel),n=new a,i=0,r=0;r=n;n++)if(!(-1>=e+n||this.moduleCount<=e+n))for(var i=-1;7>=i;i++)-1>=t+i||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&6>=n&&(0==i||6==i)||0<=i&&6>=i&&(0==n||6==n)||2<=n&&4>=n&&2<=i&&4>=i)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;8>n;n++){this.makeImpl(!0,n);var i=l.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},createMovieClip:function(e,t,n){for(e=e.createEmptyMovieClip(t,n),this.make(),t=0;t=o;o++)for(var s=-2;2>=s;s++)this.modules[i+o][r+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(e){for(var t=l.getBCHTypeNumber(this.typeNumber),n=0;18>n;n++){var i=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;18>n;n++)i=!e&&1==(t>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i},setupTypeInfo:function(e,t){for(var n=l.getBCHTypeInfo(this.errorCorrectLevel<<3|t),i=0;15>i;i++){var r=!e&&1==(n>>i&1);6>i?this.modules[i][8]=r:8>i?this.modules[i+1][8]=r:this.modules[this.moduleCount-15+i][8]=r}for(i=0;15>i;i++)r=!e&&1==(n>>i&1),8>i?this.modules[8][this.moduleCount-i-1]=r:9>i?this.modules[8][15-i-1+1]=r:this.modules[8][15-i-1]=r;this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;0a;a++)if(null==this.modules[i][s-a]){var u=!1;o>>r&1)),l.getMask(t,i,s-a)&&(u=!u),this.modules[i][s-a]=u,-1==--r&&(o++,r=7)}if(0>(i+=n)||this.moduleCount<=i){i-=n,n=-n;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(e,t,n){t=s.getRSBlocks(e,t);for(var i=new a,o=0;o8*e)throw Error("code length overflow. ("+i.getLengthInBits()+">"+8*e+")");for(i.getLengthInBits()+4<=8*e&&i.put(0,4);0!=i.getLengthInBits()%8;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*e||(i.put(r.PAD0,8),i.getLengthInBits()>=8*e));)i.put(r.PAD1,8);return r.createBytes(i,t)},r.createBytes=function(e,t){for(var n=0,i=0,r=0,s=Array(t.length),a=Array(t.length),u=0;u>>=1;return t},getPatternPosition:function(e){return l.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case 0:return 0==(t+n)%2;case 1:return 0==t%2;case 2:return 0==n%3;case 3:return 0==(t+n)%3;case 4:return 0==(Math.floor(t/2)+Math.floor(n/3))%2;case 5:return 0==t*n%2+t*n%3;case 6:return 0==(t*n%2+t*n%3)%2;case 7:return 0==(t*n%3+(t+n)%2)%2;default:throw Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new o([1],0),n=0;nt)switch(e){case 1:return 10;case 2:return 9;case n:case 8:return 8;default:throw Error("mode:"+e)}else if(27>t)switch(e){case 1:return 12;case 2:return 11;case n:return 16;case 8:return 10;default:throw Error("mode:"+e)}else{if(!(41>t))throw Error("type:"+t);switch(e){case 1:return 14;case 2:return 13;case n:return 16;case 8:return 12;default:throw Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,i=0;i=a;a++)if(!(0>i+a||t<=i+a))for(var l=-1;1>=l;l++)0>r+l||t<=r+l||0==a&&0==l||s==e.isDark(i+a,r+l)&&o++;5e)throw Error("glog("+e+")");return u.LOG_TABLE[e]},gexp:function(e){for(;0>e;)e+=255;for(;256<=e;)e-=255;return u.EXP_TABLE[e]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},c=0;8>c;c++)u.EXP_TABLE[c]=1<c;c++)u.EXP_TABLE[c]=u.EXP_TABLE[c-4]^u.EXP_TABLE[c-5]^u.EXP_TABLE[c-6]^u.EXP_TABLE[c-8];for(c=0;255>c;c++)u.LOG_TABLE[u.EXP_TABLE[c]]=c;return o.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=Array(this.getLength()+e.getLength()-1),n=0;nthis.getLength()-e.getLength())return this;for(var t=u.glog(this.get(0))-u.glog(e.get(0)),n=Array(this.getLength()),i=0;i>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},"string"==typeof t&&(t={text:t}),t=e.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:2,background:"#ffffff",foreground:"#000000"},t),this.each(function(){var n;if("canvas"==t.render){(n=new r(t.typeNumber,t.correctLevel)).addData(t.text),n.make();var i=document.createElement("canvas");i.width=t.width,i.height=t.height;for(var o=i.getContext("2d"),s=t.width/n.getModuleCount(),a=t.height/n.getModuleCount(),l=0;l").css("width",t.width+"px").css("height",t.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",t.background),o=t.width/n.getModuleCount(),s=t.height/n.getModuleCount(),a=0;a").css("height",s+"px").appendTo(i),u=0;u").css("width",o+"px").css("background-color",n.isDark(a,u)?t.foreground:t.background).appendTo(l);n=i,jQuery(n).appendTo(this)})}}(jQuery),function(){"use strict";var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},t="undefined"!=typeof module&&module.exports,n=function(){for(var t,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=0,r=n.length,o={};i { - ngAppSettings.icons = resp.data; - }); - commonService.loadJsonData("enums.json").then((resp) => { - ngAppSettings.enums = resp.data; - }); - commonService.fillAllSettings($scope.lang).then(function (response) { - ngAppSettings.settings = $rootScope.settings.data; - if ($rootScope.globalSettings) { - $scope.portalThemeSettings = - $rootScope.globalSettings.portalThemeSettings; - authService.fillAuthData().then(function (response) { - $rootScope.authentication = authService.authentication; - $scope.isAuth = - authService.authentication != null && - authService.authentication.isAuth; - if ( - authService.authentication && - authService.authentication.isAuth - ) { - $scope.isAdmin = authService.authentication.isAdmin; - } else { - window.top.location.href = "/security/login"; - } - }); - $rootScope.isInit = true; - $scope.isInit = true; - $rootScope.isBusy = false; - // $scope.$apply(); - } else { - window.top.location.href = "/security/login"; - } - }); - } - }; - $scope.alert = function (message) { - ons.notification.alert(message); - }; - $scope.prettyJsonObj = function (obj) { - return JSON.stringify(obj, null, "\t"); - }; - $scope.$on("$routeChangeStart", function ($event, next, current) { - // ... you could trigger something here ... - if (current && current.$$route) { - $rootScope.referrerUrl = current.$$route.originalPath; - Object.keys(current.params).forEach(function (key, index) { - // key: the name of the object key - // index: the ordinal position of the key within the object - if ($rootScope.referrerUrl.indexOf(":" + key) >= 0) { - $rootScope.referrerUrl = $rootScope.referrerUrl.replace( - ":" + key, - current.params[key] - ); - } else { - if ($rootScope.referrerUrl.indexOf("?") < 0) { - $rootScope.referrerUrl += "?"; - } - $rootScope.referrerUrl += key + "=" + current.params[key] + "&"; - } - }); - } - $scope.pageTagName = $location.$$path.toString().split("/")[2]; - $scope.pageTagTypeName = $location.$$path.toString().split("/")[3]; - if ($scope.pageTagTypeName == "list") $scope.pageTagType = 1; - if ($scope.pageTagTypeName == "create") $scope.pageTagType = 2; - }); - $rootScope.limString = function (str, max) { - return str.substring(0, max); - }; - }, -]); - -app.config(function ($routeProvider, $locationProvider, $sceProvider, ngAppSettings) { - $locationProvider.html5Mode(true); - var data = $.parseJSON($('#portal-menus').val()); - ngAppSettings.routes = data.routes; - angular.forEach(ngAppSettings.routes, function (cate, key) { - if (cate.items.length) { - angular.forEach(cate.items, function (item, key) { - $routeProvider.when(item.path, { - controller: item.controller, - templateUrl: item.templatePath - }); - }); - } - }); - $routeProvider.otherwise({ redirectTo: "/portal" }); -}); - -'use strict'; -app.factory('AttributeDataService', ['BaseService', - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('attribute-data'); - // Define more service methods here - return serviceFactory; - }]); - -'use strict'; -app.factory('TemplateService', ['BaseRestService', 'CommonService', - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('template/portal', true); - var _copy = async function (id) { - var url = this.prefixUrl + '/copy/' + id; - var req = { - method: 'GET', - url: url - }; - return await commonService.getRestApiResult(req); - }; - serviceFactory.copy = _copy; - return serviceFactory; - - }]); - -"use strict"; -app.controller("AppSettingsController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$timeout", - "$location", - "AuthService", - "CommonService", - "AppSettingsServices", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $timeout, - $location, - authService, - commonService, - appSettingsServices - ) { - $scope.appSettings = null; - $scope.errors = []; - $scope.statuses = ngAppSettings.contentStatuses; - $scope.getAppSettings = async function (id) { - $rootScope.isBusy = true; - var resp = await appSettingsServices.getAppSettings(); - if (resp && resp.isSucceed) { - $scope.appSettings = JSON.stringify(resp.data); - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadAppSettings = async function () { - $rootScope.isBusy = true; - - var id = $routeParams.id; - var response = await appSettingsServices.getAppSettings(); - if (response && response.isSucceed) { - $scope.appSettings = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response?.errors || ["Failed"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - - var result = await commonService.getSettings(); - if (result.isSucceed) { - $scope.settings = result.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.isBusy = false; - } - - // load portal menus - commonService.loadJArrayData("portal-menus.json").then((resp) => { - $scope.menus = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - - $scope.saveAppSettings = async function (appSettings) { - $rootScope.isBusy = true; - var resp = await appSettingsServices.saveAppSettings(appSettings); - if (resp && resp.isSucceed) { - $scope.appSettings = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('AppSettingsServices', ['$http', '$rootScope', 'CommonService', function ($http, $rootScope, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var appSettingssServiceFactory = {}; - - var settings = $rootScope.globalSettings; - - var _getAppSettings = async function () { - var url = '/portal/app-settings/details'; - - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - }; - - var _saveAppSettings = async function (appSettings) { - var apiUrl = '/portal/app-settings/save'; - var req = { - method: 'POST', - url: apiUrl, - data: JSON.stringify(appSettings) - }; - return await commonService.getApiResult(req); - }; - var _saveGlobalSettings = async function (name, content) { - var apiUrl = '/portal/app-settings/save-global/' + name; - var req = { - method: 'POST', - url: apiUrl, - data: JSON.stringify(content) - }; - return await commonService.getApiResult(req); - }; - - appSettingssServiceFactory.getAppSettings = _getAppSettings; - appSettingssServiceFactory.saveAppSettings = _saveAppSettings; - appSettingssServiceFactory.saveGlobalSettings = _saveGlobalSettings; - return appSettingssServiceFactory; - -}]); - -"use strict"; -app.controller("ConfigurationController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ConfigurationService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - commonService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - - $scope.getSingleSuccessCallback = function () { - $scope.cates = ngAppSettings.enums.configuration_cates; - $scope.settings = $rootScope.globalSettings; - $scope.request.category = $routeParams.category || ""; - if (!$scope.viewModel.category) { - $scope.viewModel.category = "Site"; - } - }; - $scope.saveSuccessCallback = function () { - commonService.initAllSettings().then(function () { - // $location.url($scope.referrerUrl); - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - $scope.removeCallback = function () { - commonService.initAllSettings().then(function () { - $location.url($scope.referrerUrl); - }); - }; - }, -]); - -"use strict"; -app.factory("ConfigurationService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("configuration"); - - var _uploadConfiguration = async function (configurationFile) { - //var container = $(this).parents('.model-configuration').first().find('.custom-file').first(); - if ( - configurationFile.file !== undefined && - configurationFile.file !== null - ) { - // Create FormData object - var files = new FormData(); - - // Looping over all files and add it to FormData object - files.append(configurationFile.file.name, configurationFile.file); - - // Adding one more key to FormData object - files.append("fileFolder", configurationFile.folder); - files.append("title", configurationFile.title); - files.append("description", configurationFile.description); - - var req = { - url: this.prefixUrl + "/upload", - type: "POST", - headers: {}, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: files, - }; - - return await commonService.getApiResult(req); - } - }; - serviceFactory.uploadConfiguration = _uploadConfiguration; - return serviceFactory; - }, -]); - -'use strict'; -app.controller('CultureController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', 'CultureService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, service, commonService) { - $scope.cultures = [ - - { specificulture: 'en-us', fullName: 'United States - English', icon: 'flag-icon-us' }, - { specificulture: 'fr-dz', fullName: 'Algeria - Français', icon: 'flag-icon-dz' }, - { specificulture: 'es-ar', fullName: 'Argentina - Español', icon: 'flag-icon-ar' }, - { specificulture: 'en-au', fullName: 'Australia - English', icon: 'flag-icon-au' }, - { specificulture: 'nl-be', fullName: 'België - Nederlands', icon: 'flag-icon-be' }, - { specificulture: 'fr-be', fullName: 'Belgique - Français', icon: 'flag-icon-be' }, - { specificulture: 'es-bo', fullName: 'Bolivia - Español', icon: 'flag-icon-bo' }, - { specificulture: 'bs-ba', fullName: 'Bosna i Hercegovina – Bosanski', icon: 'flag-icon-ba' }, - { specificulture: 'pt-br', fullName: 'Brasil - Português', icon: 'flag-icon-br' }, - { specificulture: 'en-ca', fullName: 'Canada - English', icon: 'flag-icon-ca' }, - { specificulture: 'fr-ca', fullName: 'Canada - Français', icon: 'flag-icon-ca' }, - { specificulture: 'cs-cz', fullName: 'Česká Republika - Čeština', icon: 'flag-icon-cz' }, - { specificulture: 'es-cl', fullName: 'Chile - Español', icon: 'flag-icon-cl' }, - { specificulture: 'es-co', fullName: 'Colombia - Español', icon: 'flag-icon-co' }, - { specificulture: 'es-cr', fullName: 'Costa Rica - Español', icon: 'flag-icon-cr' }, - { specificulture: 'sr-latn-me', fullName: 'Crna Gora - Srpski', icon: 'flag-icon-me' }, - { specificulture: 'en-cy', fullName: 'Cyprus - English', icon: 'flag-icon-cy' }, - { specificulture: 'da-dk', fullName: 'Danmark - Dansk', icon: 'flag-icon-dk' }, - { specificulture: 'de-de', fullName: 'Deutschland - Deutsch', icon: 'flag-icon-de' }, - { specificulture: 'es-ec', fullName: 'Ecuador - Español', icon: 'flag-icon-ec' }, - { specificulture: 'et-ee', fullName: 'Eesti - Eesti', icon: 'flag-icon-ee' }, - { specificulture: 'en-eg', fullName: 'Egypt - English', icon: 'flag-icon-eg' }, - { specificulture: 'es-sv', fullName: 'El Salvador - Español', icon: 'flag-icon-sv' }, - { specificulture: 'es-es', fullName: 'España - Español', icon: 'flag-icon-es' }, - { specificulture: 'fr-fr', fullName: 'France - Français', icon: 'flag-icon-fr' }, - { specificulture: 'es-gt', fullName: 'Guatemala - Español', icon: 'flag-icon-gt' }, - { specificulture: 'en-gulf', fullName: 'Gulf - English', icon: 'flag-icon-lf' }, - { specificulture: 'es-hn', fullName: 'Honduras - Español', icon: 'flag-icon-hn' }, - { specificulture: 'en-hk', fullName: 'Hong Kong SAR - English', icon: 'flag-icon-hk' }, - { specificulture: 'hr-hr', fullName: 'Hrvatska - Hrvatski', icon: 'flag-icon-hr' }, - { specificulture: 'en-in', fullName: 'India - English', icon: 'flag-icon-in' }, - { specificulture: 'id-id', fullName: 'Indonesia - Bahasa Indonesia', icon: 'flag-icon-id' }, - { specificulture: 'en-ie', fullName: 'Ireland - English', icon: 'flag-icon-ie' }, - { specificulture: 'is-is', fullName: 'Ísland - Íslenska', icon: 'flag-icon-is' }, - { specificulture: 'it-it', fullName: 'Italia - Italiano', icon: 'flag-icon-it' }, - { specificulture: 'ja-jp', fullName: 'Japanese - 日本語', icon: 'flag-icon-jp' }, - { specificulture: 'en-jo', fullName: 'Jordan - English', icon: 'flag-icon-jo' }, - { specificulture: 'lv-lv', fullName: 'Latvija - Latviešu', icon: 'flag-icon-lv' }, - { specificulture: 'en-lb', fullName: 'Lebanon - English', icon: 'flag-icon-lb' }, - { specificulture: 'lt-lt', fullName: 'Lietuva - Lietuvių', icon: 'flag-icon-lt' }, - { specificulture: 'hu-hu', fullName: 'Magyarország - Magyar', icon: 'flag-icon-hu' }, - { specificulture: 'en-my', fullName: 'Malaysia - English', icon: 'flag-icon-my' }, - { specificulture: 'en-mt', fullName: 'Malta - English', icon: 'flag-icon-mt' }, - { specificulture: 'es-mx', fullName: 'México - Español', icon: 'flag-icon-mx' }, - { specificulture: 'fr-ma', fullName: 'Morocco - Français', icon: 'flag-icon-ma' }, - { specificulture: 'nl-nl', fullName: 'Nederland - Nederlands', icon: 'flag-icon-nl' }, - { specificulture: 'en-nz', fullName: 'New Zealand - English', icon: 'flag-icon-nz' }, - { specificulture: 'es-ni', fullName: 'Nicaragua - Español', icon: 'flag-icon-ni' }, - { specificulture: 'en-ng', fullName: 'Nigeria - English', icon: 'flag-icon-ng' }, - { specificulture: 'nb-no', fullName: 'Norge - Bokmål', icon: 'flag-icon-no' }, - { specificulture: 'de-at', fullName: 'Österreich - Deutsch', icon: 'flag-icon-at' }, - { specificulture: 'en-pk', fullName: 'Pakistan - English', icon: 'flag-icon-pk' }, - { specificulture: 'es-pa', fullName: 'Panamá - Español', icon: 'flag-icon-pa' }, - { specificulture: 'es-py', fullName: 'Paraguay - Español', icon: 'flag-icon-py' }, - { specificulture: 'es-pe', fullName: 'Perú - Español', icon: 'flag-icon-pe' }, - { specificulture: 'en-ph', fullName: 'Philippines - English', icon: 'flag-icon-ph' }, - { specificulture: 'pl-pl', fullName: 'Polska - Polski', icon: 'flag-icon-pl' }, - { specificulture: 'pt-pt', fullName: 'Portugal - Português', icon: 'flag-icon-pt' }, - { specificulture: 'es-pr', fullName: 'Puerto Rico - Español', icon: 'flag-icon-pr' }, - { specificulture: 'es-do', fullName: 'República Dominicana - Español', icon: 'flag-icon-do' }, - { specificulture: 'ro-md', fullName: 'Republica Moldova - Română', icon: 'flag-icon-md' }, - { specificulture: 'ro-ro', fullName: 'România - Română', icon: 'flag-icon-ro' }, - { specificulture: 'en-sa', fullName: 'Saudi Arabia - English', icon: 'flag-icon-sa' }, - { specificulture: 'de-ch', fullName: 'Schweiz - Deutsch', icon: 'flag-icon-ch' }, - { specificulture: 'en-sg', fullName: 'Singapore - English', icon: 'flag-icon-sg' }, - { specificulture: 'sl-si', fullName: 'Slovenija - Slovenščina', icon: 'flag-icon-si' }, - { specificulture: 'sk-sk', fullName: 'Slovensko - Slovenčina', icon: 'flag-icon-sk' }, - { specificulture: 'en-za', fullName: 'South Africa - English', icon: 'flag-icon-za' }, - { specificulture: 'sr-latn-rs', fullName: 'Srbija - Srpski', icon: 'flag-icon-rs' }, - { specificulture: 'en-lk', fullName: 'Sri Lanka - English', icon: 'flag-icon-lk' }, - { specificulture: 'fr-ch', fullName: 'Suisse - Français', icon: 'flag-icon-ch' }, - { specificulture: 'fi-fi', fullName: 'Suomi - Suomi', icon: 'flag-icon-fi' }, - { specificulture: 'sv-se', fullName: 'Sverige - Svenska', icon: 'flag-icon-se' }, - { specificulture: 'fr-tn', fullName: 'Tunisia - Français', icon: 'flag-icon-tn' }, - { specificulture: 'tr-tr', fullName: 'Türkiye - Türkçe', icon: 'flag-icon-tr' }, - { specificulture: 'en-gb', fullName: 'United Kingdom - English', icon: 'flag-icon-gb' }, - { specificulture: 'en-us', fullName: 'United States - English', icon: 'flag-icon-us' }, - { specificulture: 'es-uy', fullName: 'Uruguay - Español', icon: 'flag-icon-uy' }, - { specificulture: 'es-ve', fullName: 'Venezuela - Español', icon: 'flag-icon-ve' }, - { specificulture: 'vi-vn', fullName: 'Việt Nam - Tiếng việt', icon: 'flag-icon-vn' }, - { specificulture: 'el-gr', fullName: 'Ελλάδα - Ελληνικά', icon: 'flag-icon-gr' }, - { specificulture: 'ru-by', fullName: 'Беларусь - Беларуская', icon: 'flag-icon-by' }, - { specificulture: 'bg-bg', fullName: 'България - Български', icon: 'flag-icon-bg' }, - { specificulture: 'ru-kz', fullName: 'Казахстан - Русский', icon: 'flag-icon-kz' }, - { specificulture: 'ru-ru', fullName: 'Россия - Русский', icon: 'flag-icon-ru' }, - { specificulture: 'uk-ua', fullName: 'Україна - Українська', icon: 'flag-icon-ua' }, - { specificulture: 'he-il', fullName: 'ישראל - עברית', icon: 'flag-icon-il' }, - { specificulture: 'ar-iq', fullName: 'العراق - العربية', icon: 'flag-icon-iq' }, - { specificulture: 'ar-sa', fullName: 'المملكة العربية السعودية - العربية', icon: 'flag-icon-sa' }, - { specificulture: 'ar-ly', fullName: 'ليبيا - العربية', icon: 'flag-icon-ly' }, - { specificulture: 'ar-eg', fullName: 'مصر - العربية', icon: 'flag-icon-eg' }, - { specificulture: 'ar-gulf', fullName: 'دول الخليج - العربية', icon: 'flag-icon-lf' }, - { specificulture: 'th-th', fullName: 'ไทย - ไทย', icon: 'flag-icon-th' }, - { specificulture: 'ko-kr', fullName: '대한민국 - 한국어', icon: 'flag-icon-kr' }, - { specificulture: 'zh-cn', fullName: '中国 - 简体中文', icon: 'flag-icon-cn' }, - { specificulture: 'zh-tw', fullName: '台灣 - 繁體中文', icon: 'flag-icon-tw' }, - { specificulture: 'ja-jp', fullName: '日本 - 日本語', icon: 'flag-icon-jp' }, - { specificulture: 'zh-hk', fullName: '香港特別行政區 - 繁體中文', icon: 'flag-icon-hk' } - - ]; - $scope.selected = null; - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.saveSuccessCallback = function () { - commonService.initAllSettings().then( - () => commonService.fillAllSettings($scope.lang).then( - () => window.location.href = '/portal/culture/list') - ); - - } - $scope.removeCallback = function () { - commonService.initAllSettings().then( - () => commonService.fillAllSettings($scope.lang).then( - () => window.location.href = '/portal/culture/list') - ); - } - $scope.changeData = function (selected) { - if (selected) { - $scope.viewModel.specificulture = selected.specificulture; - $scope.viewModel.fullName = selected.fullName; - $scope.viewModel.icon = selected.icon; - } - } - }]); - -'use strict'; -app.factory('CultureService', ['BaseService', function (baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('culture'); - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - - var _syncTemplates = async function (id) { - var apiUrl = '/culture/'; - var url = apiUrl + 'sync/' + id; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - serviceFactory.syncTemplates = _syncTemplates; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - -}]); - -'use strict'; -app.controller('CustomerController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'CustomerServices', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, customerServices) { - $scope.request = angular.copy(ngAppSettings.request); - $scope.request.contentStatuses = [ - 'Active' - ]; - $scope.request.status = '0'; - $scope.activedCustomer = null; - $scope.relatedCustomers = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - }; - $scope.errors = []; - - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - - $scope.loadCustomer = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var response = await customerServices.getCustomer(id, 'portal'); - if (response.isSucceed) { - $scope.activedCustomer = response.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadCustomers = async function (pageIndex) { - - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - var resp = await customerServices.getCustomers($scope.request); - if (resp && resp.isSucceed) { - - ($scope.data = resp.data); - //$("html, body").animate({ "scrollTop": "0px" }, 500); - $.each($scope.data.items, function (i, customer) { - - $.each($scope.activedCustomers, function (i, e) { - if (e.customerId === customer.id) { - customer.isHidden = true; - } - }) - }) - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $scope.$apply(); - } - }; - - $scope.removeCustomer = function (id) { - $rootScope.showConfirm($scope, 'removeCustomerConfirmed', [id], null, 'Remove Customer', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - } - - $scope.removeCustomerConfirmed = async function (id) { - var result = await customerServices.removeCustomer(id); - if (result.isSucceed) { - $rootScope.showMessage('success', 'success'); - $scope.loadCustomers(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - - - $scope.saveCustomer = async function (customer) { - customer.content = $('.editor-content').val(); - var resp = await customerServices.saveCustomer(customer); - if (resp && resp.isSucceed) { - $scope.activedCustomer = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/portal/customer/details/' + resp.data.id); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $scope.$apply(); - } - }; - - }]); - -'use strict'; -app.factory('CustomerServices', ['$http', '$rootScope', 'CommonService', function ($http, $rootScope, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var customersServiceFactory = {}; - - var settings = $rootScope.globalSettings - - var _getCustomer = async function (id, type) { - var apiUrl = '/queen-beauty/customer/'; - var url = apiUrl + 'details/' + type; - if (id) { - url += '/' + id; - } - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _initCustomer = async function (type) { - var apiUrl = '/queen-beauty/customer/'; - var req = { - method: 'GET', - url: apiUrl + 'init/' + type, - }; - return await commonService.getApiResult(req) - }; - - var _getCustomers = async function (request) { - var apiUrl = '/queen-beauty/customer/'; - var req = { - method: 'POST', - url: apiUrl + 'list', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _removeCustomer = async function (id) { - var apiUrl = '/queen-beauty/customer/'; - var req = { - method: 'GET', - url: apiUrl + 'delete/' + id - }; - return await commonService.getApiResult(req) - }; - - var _saveCustomer = async function (customer) { - var apiUrl = '/queen-beauty/customer/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(customer) - }; - return await commonService.getApiResult(req) - }; - - customersServiceFactory.getCustomer = _getCustomer; - customersServiceFactory.initCustomer = _initCustomer; - customersServiceFactory.getCustomers = _getCustomers; - customersServiceFactory.removeCustomer = _removeCustomer; - customersServiceFactory.saveCustomer = _saveCustomer; - return customersServiceFactory; - -}]); - -'use strict'; -app.controller('DashboardController', ['$scope', '$rootScope', 'ngAppSettings', '$timeout', '$location', 'DashboardServices', function ($scope, $rootScope, ngAppSettings, $timeout, $location, dashboardServices) { - $scope.pageClass = 'page-dashboard'; - $('.side-nav li').removeClass('active'); - $('.side-nav .page-dashboard').addClass('active'); - $scope.data = { - totalPage: 0, - totalPost: 0, - totalProduct: 0, - totalUser: 0 - } - $scope.users = []; - $scope.$on('$viewContentLoaded', function () { - $rootScope.isBusy = false; - - }); - $scope.getDashboardInfo = async function () { - $rootScope.isBusy = true; - var response = await dashboardServices.getDashboardInfo(); - if (response.isSucceed) { - // $('#mainSection').removeClass('card'); - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - // $scope.getChart(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - $scope.getChart = function () { - var ctx = document.getElementById("myChart"); - var myChart = new Chart(ctx, { - // type: 'pie', - // data: { - // labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - // datasets: [{ - // label: "Population (millions)", - // backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - // data: [2478,5267,734,784,433] - // }] - // }, - // options: { - // title: { - // display: true, - // text: 'Predicted world population (millions) in 2050' - // } - // } - }); - } -}]); -'use strict'; -app.factory('DashboardServices', ['$rootScope', '$http', 'CommonService', function ($rootScope, $http, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var usersServiceFactory = {}; - var apiUrl = '/portal/' + $rootScope.settings.lang; - var _getDashboardInfo = async function () { - var req = { - method: 'GET', - url: apiUrl + '/dashboard' - }; - return await commonService.getApiResult(req); - }; - - usersServiceFactory.getDashboardInfo = _getDashboardInfo; - return usersServiceFactory; - -}]); - -'use strict'; -app.controller('FileController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'AuthService', 'FileServices', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, authService, fileServices) { - $scope.request = { - pageSize: '10', - pageIndex: 0, - status: 'Published', - orderBy: 'CreatedDateTime', - direction: 'Desc', - fromDate: null, - toDate: null, - keyword: '', - key: '' - }; - - $scope.activedFile = null; - $scope.relatedFiles = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - }; - $scope.errors = []; - - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - $scope.loadPage = async function (folder) { - if (folder) { - $scope.request.key += ($scope.request.key !== '') ? '/' : ''; - $scope.request.key += folder; - } - $location.url('/portal/file/list?folder=' + encodeURIComponent($scope.request.key)); - }; - $scope.loadFile = async function () { - $rootScope.isBusy = true; - $scope.listUrl = '/portal/file/list?folder/' + $routeParams.folder; - $rootScope.isBusy = true; - var response = await fileServices.getFile($routeParams.folder, $routeParams.filename); - if (response.isSucceed) { - $scope.activedFile = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadFiles = async function (folder) { - if (folder) { - $scope.request.key += ($scope.request.key !== '') ? 'wwwroot/' : 'wwwroot'; - $scope.request.key += folder; - } else { - $scope.request.key = $routeParams.folder ? $routeParams.folder : 'wwwroot'; - } - if ($routeParams.folder) { - $scope.backUrl = '/portal/file/list?folder=' + $routeParams.folder.substring(0, $routeParams.folder.lastIndexOf('/')); - } - $rootScope.isBusy = true; - var resp = await fileServices.getFiles($scope.request); - if (resp && resp.isSucceed) { - - ($scope.data = resp.data); - $.each($scope.data.items, function (i, file) { - - $.each($scope.activedFiles, function (i, e) { - if (e.fileId === file.id) { - file.isHidden = true; - } - }) - }) - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - - }; - - $scope.removeFile = async function (id) { - if (confirm("Are you sure!")) { - $rootScope.isBusy = true; - var resp = await fileServices.removeFile(id); - if (resp && resp.isSucceed) { - $scope.loadFiles(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - - $scope.saveFile = async function (file) { - $rootScope.isBusy = true; - var resp = await fileServices.saveFile(file); - if (resp && resp.isSucceed) { - $scope.activedFile = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - }]); - -'use strict'; -app.factory('FileServices', ['$http', '$rootScope', 'CommonService', 'BaseService', function ($http, $rootScope, commonService, baseService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var filesServiceFactory = angular.copy(baseService); - filesServiceFactory.init('file', true); - var settings = $rootScope.globalSettings - - var _getFile = async function (folder, filename) { - var apiUrl = '/file/'; - var url = apiUrl + 'details?folder=' + folder + '&filename=' + filename; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _initFile = async function (type) { - var apiUrl = '/file/'; - var req = { - method: 'GET', - url: apiUrl + 'init/' + type, - }; - return await commonService.getApiResult(req) - }; - - var _getFiles = async function (request) { - var apiUrl = '/file/'; - var req = { - method: 'POST', - url: apiUrl + 'list', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _removeFile = async function (fullPath) { - var apiUrl = '/file/'; - var req = { - method: 'GET', - url: apiUrl + 'delete/?fullPath=' + fullPath - }; - return await commonService.getApiResult(req) - }; - - var _saveFile = async function (file) { - var apiUrl = '/file/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(file) - }; - return await commonService.getApiResult(req) - }; - var _uploadFile = async function (file, folder) { - var apiUrl = '/file/upload-file'; - var fd = new FormData(); - fd.append('folder', folder); - fd.append('file', file); - return await filesServiceFactory.ajaxSubmitForm(fd, apiUrl); - } - - filesServiceFactory.getFile = _getFile; - filesServiceFactory.initFile = _initFile; - filesServiceFactory.getFiles = _getFiles; - filesServiceFactory.removeFile = _removeFile; - filesServiceFactory.saveFile = _saveFile; - filesServiceFactory.uploadFile = _uploadFile; - return filesServiceFactory; - -}]); - -'use strict'; -app.controller('ImportFileController', - ['$scope', '$rootScope', 'ImportFileServices', 'TranslatorService', 'GlobalSettingsService', - function ($scope, $rootScope, service, translatorService, GlobalSettingsService) { - - $scope.saveImportFile = async function () { - $rootScope.isBusy = true; - var form = document.getElementById('frm-import'); - var frm = new FormData(); - frm.append('assets', form['assets'].files[0]); - var response = await service.saveImportFile(frm); - if (response.isSucceed) { - $scope.viewModel = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }]); - -'use strict'; -app.factory('ImportFileServices', ['$rootScope', 'BaseService', - function ($rootScope, baseService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var serviceFactory = {}; - - var settings = $rootScope.globalSettings; - var serviceFactory = Object.create(baseService); - serviceFactory.init('portal', true); - var _saveImportFile = async function (frm) { - var apiUrl = this.prefixUrl + '/' + settings.lang + '/import'; - return await this.ajaxSubmitForm(frm, apiUrl); - }; - - serviceFactory.saveImportFile = _saveImportFile; - return serviceFactory; - - }]); - -'use strict'; -app.controller('JsonDataController', - ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'AuthService', 'JsonDataService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, authService, service) { - $scope.request = { - pageSize: '10', - pageIndex: 0, - status: 'Published', - orderBy: 'CreatedDateTime', - direction: 'Desc', - fromDate: null, - toDate: null, - keyword: '', - key: '' - }; - - $scope.activedFile = null; - $scope.editorVisible = false; - $scope.data = null; - $scope.relatedFiles = []; - $rootScope.isBusy = false; - - $scope.errors = []; - - $scope.loadPage = async function (folder) { - if (folder) { - $scope.request.key += ($scope.request.key !== '') ? '/' : ''; - $scope.request.key += folder; - } - $location.url('/portal/json-data/list?folder=' + encodeURIComponent($scope.request.key)); - }; - $scope.init = async function () { - $rootScope.isBusy = true; - $scope.filename = $routeParams.filename; - $scope.folder = $routeParams.folder; - $scope.listUrl = '/portal/json-data/list?folder=' + $routeParams.folder; - $rootScope.isBusy = true; - var response = await service.getFile($routeParams.folder, $routeParams.filename); - if (response.isSucceed) { - $scope.activedFile = response.data; - $scope.data = $.parseJSON(response.data.content); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadFiles = async function (folder) { - if (folder) { - $scope.request.key += ($scope.request.key !== '') ? '/' : ''; - $scope.request.key += folder; - } else { - $scope.request.key = $routeParams.folder ? $routeParams.folder : 'data'; - } - - $rootScope.isBusy = true; - var resp = await service.getFiles($scope.request); - if (resp && resp.isSucceed) { - - ($scope.data = resp.data); - $.each($scope.data.items, function (i, file) { - - $.each($scope.activedFiles, function (i, e) { - if (e.fileId === file.id) { - file.isHidden = true; - } - }) - }) - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - - }; - - $scope.removeFile = async function (id) { - if (confirm("Are you sure!")) { - $rootScope.isBusy = true; - var resp = await service.removeFile(id); - if (resp && resp.isSucceed) { - $scope.loadFiles(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.selectPane = function (pane) { - $scope.editorVisible = pane.header == 'Content'; - }; - $scope.save = async function (data) { - $scope.activedFile.contennt = JSON.stringify(data); - $scope.saveFile($scope.activedFile); - } - $scope.updateData = async function (data) { - $scope.data = data; - } - $scope.saveFile = async function (file) { - $rootScope.isBusy = true; - file.content = JSON.stringify($scope.data); - var resp = await service.saveFile(file); - if (resp && resp.isSucceed) { - $scope.activedFile = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - }]); - -'use strict'; -app.factory('JsonDataService', ['$http', '$rootScope', 'CommonService', function ($http, $rootScope, commonService) { - - var filesServiceFactory = {}; - - var settings = $rootScope.globalSettings - - var _getFile = async function (folder, filename) { - var apiUrl = '/file/'; - var url = apiUrl + 'details?folder=' + folder + '&filename=' + filename; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _initFile = async function (type) { - var apiUrl = '/file/'; - var req = { - method: 'GET', - url: apiUrl + 'init/' + type, - }; - return await commonService.getApiResult(req) - }; - - var _getFiles = async function (request) { - var apiUrl = '/file/'; - var req = { - method: 'POST', - url: apiUrl + 'list', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _removeFile = async function (id) { - var apiUrl = '/file/'; - var req = { - method: 'GET', - url: apiUrl + 'delete/' + id - }; - return await commonService.getApiResult(req) - }; - - var _saveFile = async function (file) { - var apiUrl = '/file/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(file) - }; - return await commonService.getApiResult(req) - }; - - filesServiceFactory.getFile = _getFile; - filesServiceFactory.initFile = _initFile; - filesServiceFactory.getFiles = _getFiles; - filesServiceFactory.removeFile = _removeFile; - filesServiceFactory.saveFile = _saveFile; - return filesServiceFactory; - -}]); - -'use strict'; -app.controller('loginController', ['$rootScope', '$scope', 'ngAppSettings', '$location', 'AuthService', 'ngAppSettings', function ($rootScope, $scope, ngAppSettings, $location, authService, ngAuthSettings) { - if (authService.authentication && authService.authentication.isAuth && authService.authentication.isAdmin) { - authService.referredUrl = $location.path(); - $location.path('/portal'); - } - - $scope.pageClass = 'page-login'; - - $scope.loginData = { - username: "", - password: "", - rememberme: false - }; - - $scope.message = ""; - $scope.$on('$viewContentLoaded', function () { - $rootScope.isBusy = false; - }); - $scope.login = async function () { - - if (authService.referredUrl === "/init/login") { - authService.referredUrl = "/portal"; - } - $rootScope.isBusy = true; - var result = await authService.login($scope.loginData); - if (result) { - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.authExternalProvider = function (provider) { - - var redirectUri = location.protocol + '//' + location.host + '/authcomplete.html'; - - var externalProviderUrl = ngAuthSettings.apiServiceBaseUri + "api/Account/ExternalLogin?provider=" + provider - + "&response_type=token&client_id=" + ngAuthSettings.clientId - + "&redirect_uri=" + redirectUri; - window.$windowScope = $scope; - - var oauthWindow = window.open(externalProviderUrl, "Authenticate Account", "location=0,status=0,width=600,height=750"); - }; - - $scope.authCompletedCB = function (fragment) { - - $scope.$apply(function () { - - if (fragment.haslocalaccount === 'False') { - - authService.logOut(); - - authService.externalAuthData = { - provider: fragment.provider, - userName: fragment.external_user_name, - externalAccessToken: fragment.external_access_token - }; - - $location.path('/associate'); - - } - else { - //Obtain access token and redirect to orders - var externalData = { provider: fragment.provider, externalAccessToken: fragment.external_access_token }; - authService.obtainAccessToken(externalData).then(function (response) { - - $location.path('/orders'); - - }, - function (err) { - $scope.message = err.error_description; - }); - } - - }); - } -}]); -"use strict"; -app.controller("LocalizeController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "LocalizeService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - commonService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.cates = []; - $scope.settings = $rootScope.globalSettings; - $scope.defaultId = "default"; - $scope.languageFile = { - file: null, - fullPath: "", - folder: "Language", - title: "", - description: "", - }; - $scope.dataTypes = $rootScope.globalSettings.dataTypes; - $scope.$on("$viewContentLoaded", function () { - $scope.cates = ngAppSettings.enums.language_cates; - $scope.settings = $rootScope.globalSettings; - $scope.cate = $scope.cates[0]; - }); - $scope.getSingleSuccessCallback = function () { - $scope.viewModel.category = "Site"; - }; - $scope.saveSuccessCallback = function () { - commonService.initAllSettings().then(function () { - $location.url($scope.referrerUrl || "/portal/localize/list"); - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - $scope.removeCallback = function () { - commonService.initAllSettings().then(function () { - // $location.url($scope.referrerUrl); - }); - }; - $scope.generateDefault = function (text, cate) { - if (!$routeParams.id && !$scope.viewModel.keyword) { - $scope.viewModel.defaultValue = text; - $scope.viewModel.keyword = - cate.prefix + - text - .replace(/[^a-zA-Z0-9]+/g, "_") - .replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2") - .replace(/([a-z])([A-Z])/g, "$1-$2") - .replace(/([0-9])([^0-9])/g, "$1-$2") - .replace(/([^0-9])([0-9])/g, "$1-$2") - .replace(/-+/g, "_") - .toLowerCase(); - } - }; - }, -]); - -'use strict'; -app.factory('LocalizeService', ['BaseRestService', 'CommonService', function (baseService, commonService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('language'); - - var _uploadLanguage = async function (languageFile) { - //var container = $(this).parents('.model-language').first().find('.custom-file').first(); - if (languageFile.file !== undefined && languageFile.file !== null) { - // Create FormData object - var files = new FormData(); - - // Looping over all files and add it to FormData object - files.append(languageFile.file.name, languageFile.file); - - // Adding one more key to FormData object - files.append('fileFolder', languageFile.folder); files.append('title', languageFile.title); - files.append('description', languageFile.description); - - var req = { - url: this.prefixUrl + '/upload', - type: "POST", - headers: { - }, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: files, - }; - - return await commonService.getApiResult(req) - } - }; - serviceFactory.uploadLanguage = _uploadLanguage; - return serviceFactory; - -}]); - -"use strict"; -app.controller("MixDatabaseController", [ - "$scope", - "$rootScope", - "$location", - "ngAppSettings", - "$routeParams", - "RestMixDatabaseColumnPortalService", - "RestMixDatabasePortalService", - function ( - $scope, - $rootScope, - $location, - ngAppSettings, - $routeParams, - mixDatabaseColumnService, - service - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.defaultAttr = null; - $scope.actions = ["Delete"]; - // $scope.request.selects = 'id,title,name,createdDateTime'; - $scope.orders = [ - { title: "Id", value: "id" }, - { title: "Name", value: "name" }, - { title: "Created Date", value: "createdDateTime" }, - ]; - $scope.request.orderBy = "createdDateTime"; - $scope.getSingleSuccessCallback = async function () { - var getDefaultAttr = await mixDatabaseColumnService.getDefault(); - if (getDefaultAttr.isSucceed) { - $scope.defaultAttr = getDefaultAttr.data; - $scope.defaultAttr.options = []; - } - $scope.$apply(); - }; - }, -]); - -"use strict"; -app.factory("MixDatabaseService", [ - "BaseRestService", - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database/portal", true); - // Define more service methods here - return serviceFactory; - }, -]); - -"use strict"; -app.controller("MixDatabaseDataController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseColumnPortalService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - fieldService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.queries = {}; - $scope.data = {}; - $scope.exportAll = true; - $scope.settings = $rootScope.globalSettings; - $scope.request.orderBy = "Priority"; - $scope.request.direction = "Asc"; - $scope.filterType = "contain"; - $scope.defaultId = "default"; - $scope.importFile = { - file: null, - fullPath: "", - folder: "import", - title: "", - description: "", - }; - $scope.initRouteParams = () => { - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.mixDatabaseTitle = $routeParams.mixDatabaseTitle; - $scope.parentId = $routeParams.parentId; - $scope.parentType = $routeParams.parentType; - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - if ($routeParams.backUrl) { - $scope.backUrl = decodeURIComponent($routeParams.backUrl); - } - if ($routeParams.dataId != $scope.defaultId) { - $scope.dataId = $routeParams.dataId; - } - - if ($scope.parentId && $scope.parentType) { - $scope.refDataModel = { - parentId: $scope.parentId, - parentType: $scope.parentType, - }; - } - }; - $scope.init = async function () { - $scope.initRouteParams(); - if ($scope.mixDatabaseName || $scope.mixDatabaseId) { - var getFields = await fieldService.initData( - $scope.mixDatabaseName || $scope.mixDatabaseId - ); - if (getFields.isSucceed) { - $scope.fields = getFields.data; - $scope.$apply(); - } - } - }; - $scope.saveData = function (data) { - $scope.viewModel = data; - $scope.save(); - }; - $scope.selectData = function () { - if ($scope.selectedList.data.length) { - $scope.viewModel = $scope.selectedList.data[0]; - } - }; - $scope.saveSuccessCallback = function () { - if ($location.path() == "/portal/mix-database-data/create") { - let backUrl = - $scope.backUrl || - `/portal/mix-database-data/details?dataId=${$scope.viewModel.id}`; - $rootScope.goToSiteUrl(backUrl); - } else { - if ($scope.parentId && $scope.parentType == 'Set') { - $rootScope.goToSiteUrl(`/portal/mix-database-data/details?dataId=${$scope.parentId}`); - } else { - let backUrl = - $scope.backUrl || - `/portal/mix-database-data/list?mixDatabaseId=${$scope.viewModel.mixDatabaseId}&mixDatabaseName=${$scope.viewModel.mixDatabaseName}&mixDatabaseTitle=${$scope.viewModel.mixDatabaseName}`; - $rootScope.goToSiteUrl(backUrl); - } - } - }; - - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.edit = function (data) { - $rootScope.goToPath( - "/portal/mix-database-data/details?dataId=" + data.id + "&abc" - ); - }; - $scope.remove = function (data) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (dataId) { - $rootScope.isBusy = true; - var result = await service.delete([dataId]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.import = async function () { - if ($scope.validateDataFile()) { - $rootScope.isBusy = true; - var form = document.getElementById("form-portal"); - var result = await service.import( - $scope.mixDatabaseName, - form["import-data-inp"].files[0] - ); - if (result.isSucceed) { - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.getList(0); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.validateDataFile = function () { - if (!$scope.importFile.file) { - $rootScope.showMessage("Please choose data file", "danger"); - return false; - } else { - return true; - } - }; - $scope.sendMail = function (data) { - var email = ""; - angular.forEach(data.values, function (e) { - if (e.mixDatabaseColumnName == "email") { - email = e.stringValue; - } - }); - $rootScope.showConfirm( - $scope, - "sendMailConfirmed", - [data], - null, - "Send mail", - "Are you sure to send mail to " + email - ); - }; - $scope.sendMailConfirmed = async function (data) { - $rootScope.isBusy = true; - $rootScope.isBusy = true; - var result = await service.sendMail([data.id]); - if (result.isSucceed) { - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.selectImportFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - $scope.importFile.folder = "imports"; - $scope.importFile.title = $scope.mixDatabaseName; - $scope.importFile.description = $scope.mixDatabaseName + "'s data"; - $scope.importFile.file = file; - - // if (ctrl.auto=='true') { - // ctrl.uploadFile(file); - // } - // else { - // ctrl.getBase64(file); - // } - } - }; - $scope.getList = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var df = new Date($scope.request.fromDate); - $scope.request.fromDate = df.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var query = {}; - if ($routeParams.mixDatabaseId) { - $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; - } - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.request.filterType = $routeParams.filterType || "contain"; - Object.keys($scope.queries).forEach((e) => { - if ($scope.queries[e]) { - query[e] = $scope.queries[e]; - } - }); - $scope.request.query = JSON.stringify(query); - $rootScope.isBusy = true; - var resp = await service.getList($scope.request); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $.each($scope.data.items, function (i, data) { - $.each($scope.activeddata, function (i, e) { - if (e.dataId === data.id) { - data.isHidden = true; - } - }); - }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - $("html, body").animate( - { - scrollTop: "0px", - }, - 500 - ); - if (!resp.data || !resp.data.items.length) { - $scope.queries = {}; - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } - $scope.queries = {}; - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.export = async function (pageIndex, exportAll) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var df = new Date($scope.request.fromDate); - $scope.request.fromDate = df.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var query = {}; - if ($routeParams.mixDatabaseId) { - $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; - } - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.request.filterType = $routeParams.filterType || "contain"; - Object.keys($scope.queries).forEach((e) => { - if ($scope.queries[e]) { - query[e] = $scope.queries[e]; - } - }); - $scope.request.query = JSON.stringify(query); - var request = angular.copy($scope.request); - $scope.exportAll = $scope.exportAll; - if (exportAll) { - request.pageSize = 10000; - request.pageIndex = 0; - } - $rootScope.isBusy = true; - var resp = await service.export(request); - if (resp && resp.isSucceed) { - if (resp.data) { - window.top.location = resp.data.webPath; - } else { - $rootScope.showMessage("Nothing to export"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -"use strict"; -app.factory("MixRestMixDatabasePortalService", [ - "BaseService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database-data"); - var _saveByName = async function (name, objData) { - var url = this.prefixUrl + "/save/" + name; - var req = { - serviceBase: this.serviceBase, - method: "POST", - url: url, - data: JSON.stringify(objData), - }; - return await commonService.getApiResult(req); - }; - var _sendMail = async function (params = []) { - var url = - (this.prefixUrl || "/" + this.lang + "/" + this.modelName) + - "/sendmail"; - for (let i = 0; i < params.length; i++) { - if (params[i]) { - url += "/" + params[i]; - } - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getApiResult(req); - }; - - var _import = async function (mixDatabaseName, file) { - var url = - (this.prefixUrl || "/" + this.lang + "/" + this.modelName) + - "/import-data/" + - mixDatabaseName; - var frm = new FormData(); - frm.append("file", file); - return serviceFactory.ajaxSubmitForm(frm, url); - }; - serviceFactory.saveByName = _saveByName; - serviceFactory.import = _import; - serviceFactory.sendMail = _sendMail; - return serviceFactory; - }, -]); - -"use strict"; -app.controller("ModuleController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$location", - "$routeParams", - "ModuleRestService", - "SharedModuleDataService", - "RestRelatedMixDatabasePortalService", - "RestMixDatabaseDataPortalService", - function ( - $scope, - $rootScope, - ngAppSettings, - $location, - $routeParams, - moduleServices, - moduleDataService, - RestRelatedMixDatabasePortalService, - dataService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - moduleServices, - "product" - ); - $scope.contentUrl = ""; - $scope.getSingleSuccessCallback = function () { - $scope.loadAdditionalData(); - - if ($scope.viewModel.id > 0) { - // module => list post or list product - if ($scope.viewModel.type == 2 || $scope.viewModel.type == 6) { - $scope.contentUrl = "/portal/module-post/list/" + $scope.viewModel.id; - } else { - $scope.contentUrl = "/portal/module/data/" + $scope.viewModel.id; - } - } - if ($scope.viewModel.sysCategories) { - angular.forEach($scope.viewModel.sysCategories, function (e) { - e.attributeData.obj.isActived = true; - }); - } - - if ($scope.viewModel.sysTags) { - angular.forEach($scope.viewModel.sysTags, function (e) { - e.attributeData.obj.isActived = true; - }); - } - - if ($routeParams.template) { - $scope.viewModel.view = $rootScope.findObjectByKey( - $scope.viewModel.templates, - "fileName", - $routeParams.template - ); - } - }; - $scope.getListByType = async function (pageIndex) { - $scope.request.query = "?type=" + $scope.type; - await $scope.getList(pageIndex); - }; - $scope.defaultAttr = { - name: "", - options: [], - priority: 0, - dataType: 7, - isGroupBy: false, - isSelect: false, - isDisplay: true, - width: 3, - }; - $scope.type = "-1"; - - $scope.settings = $rootScope.globalSettings; - $scope.viewModel = null; - $scope.editDataUrl = ""; - - $scope.loadModuleDatas = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.dataColumns = []; - var response = await moduleServices.getSingle([id]); - if (response.isSucceed) { - $scope.viewModel = response.data; - $scope.editDataUrl = - "/portal/module-data/details/" + $scope.viewModel.id; - $scope.loadMoreModuleDatas(); - angular.forEach($scope.viewModel.columns, function (e, i) { - if (e.isDisplay) { - $scope.dataColumns.push({ - title: e.title, - name: e.name, - filter: true, - type: 0, // string - ngAppSettings.dataTypes[0] - }); - } - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.loadMoreModuleDatas = async function (pageIndex) { - $scope.request.query = "&module_id=" + $scope.viewModel.id; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - $rootScope.isBusy = true; - var resp = await moduleDataService.getModuleDatas($scope.request); - if (resp && resp.isSucceed) { - $scope.viewModel.data = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.exportModuleData = async function (pageIndex) { - $scope.request.query = "&module_id=" + $scope.viewModel.id; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - $rootScope.isBusy = true; - var resp = await moduleDataService.exportModuleData($scope.request); - if (resp && resp.isSucceed) { - window.top.location = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeData = function (id) { - if ($scope.viewModel) { - $rootScope.showConfirm( - $scope, - "removeDataConfirmed", - [id], - null, - "Remove Data", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - } - }; - - $scope.removeDataConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await moduleDataService.removeModuleData(id); - if (result.isSucceed) { - $scope.loadModuleDatas(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.updateModuleDataField = async function (item, propertyName) { - var result = await moduleDataService.saveFields( - item.id, - propertyName, - item[propertyName] - ); - if (result.isSucceed) { - $scope.loadModuleDatas(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.updateDataInfos = async function (items) { - $rootScope.isBusy = true; - var resp = await moduleDataService.updateInfos(items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = async function () { - if ($scope.additionalData) { - $scope.additionalData.parentId = $scope.viewModel.id; - $scope.additionalData.parentType = "Module"; - var saveData = await dataService.saveAdditionalData( - $scope.additionalData - ); - if (saveData.isSucceed) { - if ($location.path() == "/portal/module/create") { - $scope.goToDetail($scope.viewModel.id, "module"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $scope.additionalData = saveData.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } - }; - $scope.loadPosts = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.postRequest.query += "&page_id=" + id; - var response = await pagePostRestService.getList($scope.postRequest); - if (response.isSucceed) { - $scope.pageData.posts = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.selectedCol = null; - $scope.dragoverCallback = function (index, item, external, type) { - //console.log('drop ', index, item, external, type); - }; - $scope.insertColCallback = function (index, item, external, type) {}; - $scope.removeAttribute = function (attr, index) { - $rootScope.showConfirm( - $scope, - "removeAttributeConfirmed", - [attr, index], - null, - "Remove Field", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - $scope.removeAttributeConfirmed = function (attr, index) { - RestRelatedMixDatabasePortalService.delete([]); - $scope.viewModel.attributeData.data.values.splice(index, 1); - }; - $scope.loadAdditionalData = async function () { - const obj = { - parentType: "Module", - parentId: $scope.viewModel.id, - databaseName: "sys_additional_field_module", - }; - const getData = await dataService.getAdditionalData(obj); - if (getData.isSucceed) { - $scope.additionalData = getData.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('ModuleRestService', ['BaseRestService', - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('module/portal'); - // Define more service methods here - return serviceFactory; - }]); - -"use strict"; -app.controller("ModuleDataController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ModuleDataRestService", - "ModuleRestService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - moduleService, - commonService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.orderBy = "Priority"; - $scope.request.direction = "Asc"; - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.moduleId = $routeParams.moduleId; - $scope.backUrl = `/portal/module-data/list/${$scope.moduleId}`; - $scope.module = null; - $scope.dataColumns = []; - $scope.editDataUrl = "/portal/module-data/details/" + $scope.moduleId; - $scope.init = async function () { - $scope.id = $routeParams.id; - if (!$scope.module) { - var getModule = await moduleService.getSingle([$scope.moduleId]); - if (getModule.isSucceed) { - $scope.module = getModule.data; - angular.forEach($scope.module.columns, function (e, i) { - if (e.isDisplay) { - $scope.dataColumns.push({ - title: e.title, - name: e.name, - datatype: e.dataType, - filter: true, - type: 0, // string - ngAppSettings.dataTypes[0] - }); - } - }); - $scope.$apply(); - } - } - }; - $scope.getList = async function () { - $rootScope.isBusy = true; - $scope.request.module_id = $scope.moduleId; - var response = await service.getList($scope.request); - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.export = async function () { - $rootScope.isBusy = true; - $scope.request.module_id = $scope.moduleId; - var response = await service.export($scope.request); - if (response.isSucceed) { - window.top.location = response.data.webPath; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var resp = await service.getSingle($routeParams.id, "portal"); - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (dataId) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [dataId], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (dataId) { - $rootScope.isBusy = true; - var result = await service.delete([dataId]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeCallback = function () { }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('ModuleDataRestService', ['BaseRestService', 'CommonService', - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('module-data/portal'); - // Define more service methods here - - var _initForm = async function (moduleId) { - var url = `${this.prefixUrl}/init-form/${moduleId}`; - var req = { - method: 'GET', - url: url - }; - return await commonService.getRestApiResult(req); - }; - serviceFactory.initForm = _initForm; - return serviceFactory; - }]); - -'use strict'; -app.controller('ModuleGalleryController', - ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', 'ModuleGalleryService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, service, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.cates = ['Site', 'System']; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.moduleId = $routeParams.id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - $scope.translate = $rootScope.translate; - $scope.moduleId = $routeParams.id; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.moduleId = $routeParams.id; - $scope.request.query = '&module_id=' + id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - var response = await service.getList($scope.request); - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (moduleId, postId) { - $rootScope.showConfirm($scope, 'removeConfirmed', [moduleId, postId], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (moduleId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(moduleId, postId); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeCallback = function () { - } - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); - -'use strict'; -app.factory('ModuleGalleryService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('module-post'); - var _delete = async function (moduleId, postId) { - var url = this.prefixUrl + '/delete/' + moduleId + '/' + postId; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (modules) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(modules) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -"use strict"; -app.controller("ModulePostController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ModulePostRestService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - commonService - ) { - BaseCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.translate = $rootScope.translate; - $scope.moduleIds = $routeParams.moduleIds || $routeParams.id; - $scope.pageIds = $routeParams.page_ids; - $scope.type = $routeParams.type; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.moduleId = $routeParams.id; - $scope.request.query = "&module_id=" + id; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - var response = await service.getList($scope.request); - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.remove = function (moduleId, postId) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [moduleId, postId], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (moduleId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(moduleId, postId); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeCallback = function () { }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('ModulePostRestService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('module-post'); - var _delete = async function (moduleId, postId) { - var url = this.prefixUrl + '/delete/' + moduleId + '/' + postId; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (modules) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(modules) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -'use strict'; -app.controller('OrderController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'AuthService', 'OrderServices', 'ngAppSettings', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, authService, orderServices) { - $scope.request = angular.copy(ngAppSettings.request); - $scope.request.contentStatuses = [ - 'Waiting', - 'Serving', - 'Rated', - 'Finished' - ]; - $scope.request.status = '2'; - $scope.activedOrder = null; - $scope.relatedOrders = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - items: [] - }; - $scope.errors = []; - - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - } - - $scope.loadOrder = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var response = await orderServices.getOrder(id, 'portal'); - if (response.isSucceed) { - $scope.activedOrder = response.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadOrders = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - $rootScope.isBusy = true; - var resp = await orderServices.getOrders($scope.request); - if (resp && resp.isSucceed) { - - ($scope.data = resp.data); - //$("html, body").animate({ "scrollTop": "0px" }, 500); - $.each($scope.data.items, function (i, order) { - - $.each($scope.activedOrders, function (i, e) { - if (e.orderId === order.id) { - order.isHidden = true; - } - }) - }) - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeOrder = function (id) { - $rootScope.showConfirm($scope, 'removeOrderConfirmed', [id], null, 'Remove Order', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeOrderConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await orderServices.removeOrder(id); - if (result.isSucceed) { - $scope.loadOrders(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOrder = async function (order) { - order.content = $('.editor-content.content').val(); - order.excerpt = $('.editor-content.excerpt').val(); - $rootScope.isBusy = true; - var resp = await orderServices.saveOrder(order); - if (resp && resp.isSucceed) { - $scope.activedOrder = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/portal/order/details/' + resp.data.id); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.preview = function (item) { - $rootScope.preview('order', item, item.title, 'modal-lg'); - }; - }]); - -'use strict'; -app.factory('OrderServices', ['$http', '$rootScope', 'CommonService', function ($http, $rootScope, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var ordersServiceFactory = {}; - - var settings = $rootScope.globalSettings - - var _getOrder = async function (id, type) { - var apiUrl = '/' + settings.lang + '/order/'; - var url = apiUrl + 'details/' + type; - if (id) { - url += '/' + id; - } - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _initOrder = async function (type) { - var apiUrl = '/' + settings.lang + '/order/'; - var req = { - method: 'GET', - url: apiUrl + 'init/' + type, - }; - return await commonService.getApiResult(req) - }; - - var _getOrders = async function (request) { - var apiUrl = '/' + settings.lang + '/order/'; - var req = { - method: 'POST', - url: apiUrl + 'list', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _removeOrder = async function (id) { - var apiUrl = '/' + settings.lang + '/order/'; - var req = { - method: 'GET', - url: apiUrl + 'delete/' + id - }; - return await commonService.getApiResult(req) - }; - - var _saveOrder = async function (order) { - var apiUrl = '/' + settings.lang + '/order/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(order) - }; - return await commonService.getApiResult(req) - }; - - ordersServiceFactory.getOrder = _getOrder; - ordersServiceFactory.initOrder = _initOrder; - ordersServiceFactory.getOrders = _getOrders; - ordersServiceFactory.removeOrder = _removeOrder; - ordersServiceFactory.saveOrder = _saveOrder; - return ordersServiceFactory; - -}]); - -"use strict"; -app.controller("PageController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$location", - "$routeParams", - "PageRestService", - "PagePostRestService", - "PagePageRestService", - "UrlAliasService", - "RestMixDatabaseDataPortalService", - function ( - $scope, - $rootScope, - ngAppSettings, - $location, - $routeParams, - service, - pagePostRestService, - pagePageRestService, - urlAliasService, - dataService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.query = "level=0"; - $scope.pageType = ""; - $scope.pageTypes = $rootScope.globalSettings.pageTypes; - $scope.selectedCategories = []; - $scope.selectedTags = []; - $scope.pageData = { - posts: [], - products: [], - data: [], - }; - $scope.postRequest = angular.copy(ngAppSettings.request); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.loadPosts = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.postRequest.query += "&page_id=" + id; - var response = await pagePostRestService.getList($scope.postRequest); - if (response.isSucceed) { - $scope.pageData.posts = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.getSingleSuccessCallback = function () { - $scope.loadAdditionalData(); - if ($routeParams.template) { - $scope.viewModel.view = $rootScope.findObjectByKey( - $scope.viewModel.templates, - "fileName", - $routeParams.template - ); - } - }; - $scope.getListSuccessCallback = function () { - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - }; - $scope.loadAdditionalData = async function () { - const obj = { - parentType: "Page", - parentId: $scope.viewModel.id, - databaseName: "sys_additional_field_page", - }; - const getData = await dataService.getAdditionalData(obj); - if (getData.isSucceed) { - $scope.additionalData = getData.data; - $scope.$apply(); - } - }; - $scope.showChilds = function (id) { - $("#childs-" + id).toggleClass("collapse"); - }; - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.selPageType = function () { - $scope.request.query = "level=0&pageType=" + $scope.pageType; - $scope.getList(); - }; - $scope.goUp = async function (items, index) { - items[index].priority -= 1; - items[index - 1].priority += 1; - }; - - $scope.goDown = async function (items, index) { - items[index].priority += 1; - items[index - 1].priority -= 1; - }; - - $scope.updatePagePage = async function (items) { - $rootScope.isBusy = true; - var resp = await pagePageRestService.updateInfos(items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $scope.getList(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = async function () { - if ($scope.additionalData) { - $scope.additionalData.parentId = $scope.viewModel.id; - $scope.additionalData.parentType = "Page"; - var saveData = await dataService.save($scope.additionalData); - if (saveData.isSucceed) { - if ($location.path() == "/portal/page/create") { - $scope.goToDetail($scope.viewModel.id, "page"); - } else { - $scope.additionalData = saveData.data; - } - } - } - $rootScope.isBusy = false; - $scope.$apply(); - }; - $scope.validate = async function () { - // Add default alias if create new page - if (!$scope.viewModel.id && !$scope.viewModel.urlAliases.length) { - // Ex: en-us/page-seo-name - // await $scope.addAlias($scope.viewModel.specificulture + '/' + $scope.viewModel.seoName); - return true; - } else { - return true; - } - }; - $scope.addAlias = async function (alias) { - var getAlias = await urlAliasService.getSingle(); - if (getAlias.isSucceed) { - if (alias) { - getAlias.data.alias = alias; - } - $scope.viewModel.urlAliases.push(getAlias.data); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(getAlias.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.updateSysCategories = function (data) { - // Loop selected categories - angular.forEach($scope.selectedCategories, function (e) { - // add if not exist in sysCategories - var current = $rootScope.findObjectByKey( - $scope.viewModel.sysCategories, - "id", - e.id - ); - if (!current) { - $scope.viewModel.sysCategories.push({ - id: e.id, - parentId: $scope.viewModel.id, - mixDatabaseName: "sys_category", - }); - } - }); - }; - $scope.updateSysTags = function (data) { - // Loop selected categories - angular.forEach($scope.selectedTags, function (e) { - // add if not exist in sysCategories - var current = $rootScope.findObjectByKey( - $scope.viewModel.sysTags, - "id", - e.id - ); - if (!current) { - $scope.viewModel.sysCategories.push({ - id: e.id, - parentId: $scope.viewModel.id, - mixDatabaseName: "sys_tag", - }); - } - }); - }; - $scope.removeAliasCallback = async function (index) { - $scope.viewModel.urlAliases.splice(index, 1); - $scope.$apply(); - }; - }, -]); - -'use strict'; -app.factory('PageRestService', ['$rootScope', 'CommonService', 'BaseRestService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page/portal'); - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -'use strict'; -app.controller('PageGalleryController', - [ - '$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', - 'PageGalleryService', 'PostRestService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, - service, postService, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.cates = ['Site', 'System']; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.pageId = $routeParams.id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = '&page_id=' + id; - var response = await service.getList($scope.request); - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (pageId, postId) { - $rootScope.showConfirm($scope, 'removeConfirmed', [pageId, postId], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (pageId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(pageId, postId); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); - -'use strict'; -app.factory('PageGalleryService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page-post'); - var _delete = async function (pageId, postId) { - var url = this.prefixUrl + '/delete/' + pageId + '/' + postId; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -'use strict'; -app.controller('PagePageController', - [ - '$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', - 'PagePostRestService', 'PostRestService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, - service, postService, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.cates = ['Site', 'System']; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.pageId = $routeParams.id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = '&page_id=' + id; - var response = await service.getList($scope.request); - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (pageId, postId) { - $rootScope.showConfirm($scope, 'removeConfirmed', [pageId, postId], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (pageId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(pageId, postId); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); - -'use strict'; -app.factory('PagePageRestService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page-page'); - var _delete = async function (pageId, postId) { - var url = this.prefixUrl + '/delete/' + pageId + '/' + postId; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -'use strict'; -app.controller('PagePositionController', - [ - '$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', - 'PagePositionService', 'PostRestService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, - service, postService, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.cates = ['Site', 'System']; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.pageId = $routeParams.id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = '&page_id=' + id; - var response = await service.getList($scope.request); - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = '/portal/post/details/' + item.id; - $rootScope.preview('post', item, item.title, 'modal-lg'); - }; - $scope.remove = function (pageId, postId) { - $rootScope.showConfirm($scope, 'removeConfirmed', [pageId, postId], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (pageId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(pageId, postId); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); - -'use strict'; -app.factory('PagePositionService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page-position'); - var _delete = async function (pageId, positionId) { - var url = this.prefixUrl + '/delete/' + pageId + '/' + positionId; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -"use strict"; -app.controller("PagePostController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "PagePostRestService", - "PostRestService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - postService, - commonService - ) { - BaseCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.init = function () { - $scope.pageId = $routeParams.id; - $scope.type = $routeParams.type; - $scope.template = $routeParams.template || ""; - $scope.pageIds = $routeParams.page_ids || $routeParams.id; - $scope.moduleIds = $routeParams.module_ids || ""; - $scope.canDrag = - $scope.request.orderBy === "Priority" && - $scope.request.direction === "Asc"; - $scope.createUrl = - $routeParams.post_type === "gallery" - ? "/portal/post/create-gallery" - : `/portal/post/create?page_ids=${$scope.pageIds}&module_ids=${$scope.moduleIds}&type=${$scope.type}&template=${$scope.template}`; - $scope.updateUrl = - $routeParams.post_type === "gallery" - ? "/portal/post/gallery-details" - : "/portal/post/details"; - }; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = "&page_id=" + id; - var response = await service.getList($scope.request); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.remove = function (pageId, postId) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [pageId, postId], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete(id); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('PagePostRestService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page-post'); - var _delete = async function (id) { - var url = this.prefixUrl + '/delete/' + id; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - } - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -"use strict"; -app.controller("PermissionController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "CommonService", - "PermissionService", - "RestPortalPageNavigationService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - commonService, - service, - navService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.level = 0; - $scope.miOptions = ngAppSettings.miIcons; - $scope.initDialog = function () { - $("#dlg-permission").on("shown.bs.modal", function () { - $scope.initCurrentPath(); - }); - }; - - $scope.initCurrentPath = async function () { - var resp = await service.getDefault(); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $scope.viewModel.url = $location.url(); - $rootScope.isBusy = false; - $scope.$applyAsync(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = function () { - $scope.getSingle(); - }; - - $scope.dragStart = function (index) { - $scope.minPriority = $scope.data.items[0].priority; - $scope.dragStartIndex = index; - }; - $scope.updateOrders = function (index) { - if (index > $scope.dragStartIndex) { - $scope.data.items.splice($scope.dragStartIndex, 1); - } else { - $scope.data.items.splice($scope.dragStartIndex + 1, 1); - } - angular.forEach($scope.data.items, function (e, i) { - e.priority = $scope.minPriority + i; - service.saveFields(e.id, { priority: e.priority }).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); - }); - }; - - $scope.updateChildInfos = async function (items) { - $rootScope.isBusy = true; - var resp = await service.updateChildInfos(items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $("#dlg-favorite").on("show.bs.modal", function (event) { - $scope.initCurrentPath(); - }); - }, -]); - -'use strict'; -app.factory('PermissionService', ['BaseRestService', 'CommonService', function (baseService, commonService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('permission', true); - var _updateInfos = async function (pages) { - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - - var _updateChildInfos = async function (pages) { - var req = { - method: 'POST', - url: this.prefixUrl + '/update-child-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - - serviceFactory.updateInfos = _updateInfos; - serviceFactory.updateChildInfos = _updateChildInfos; - return serviceFactory; - -}]); - -'use strict'; -app.factory('RestPortalPageNavigationService', ['BaseRestService', 'CommonService', function (baseService, commonService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('portal-page-navigation', true); - - return serviceFactory; - -}]); - -"use strict"; -app.controller("PostController", [ - "$scope", - "$rootScope", - "$location", - "$filter", - "ngAppSettings", - "$routeParams", - "PostRestService", - "UrlAliasService", - "RestMixDatabaseDataPortalService", - function ( - $scope, - $rootScope, - $location, - $filter, - ngAppSettings, - $routeParams, - service, - urlAliasService, - dataService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.additionalData = null; - $scope.createUrl = "/portal/post/create"; - $scope.selectedCategories = []; - $scope.selectedTags = []; - $scope.postTypes = [ - { - title: "All", - attribute_set_name: "", - }, - ]; - - $scope.postTypeRequest = angular.copy(ngAppSettings.request); - $scope.postTypeRequest.mixDatabaseName = "post_type"; - $scope.postTypeRequest.orderBy = "Priority"; - $scope.postTypeRequest.direction = "Asc"; - - $scope.initList = async function () { - if ($routeParams.template) { - $scope.createUrl = `${$scope.createUrl}?template=${$routeParams.template}`; - } - $scope.pageName = "postList"; - $scope.loadPostTypes(); - $scope.getList(); - }; - $scope.loadPostTypes = async function () { - let getTypes = await dataService.getList($scope.postTypeRequest); - if (getTypes.isSucceed) { - $scope.postTypes = $scope.postTypes.concat( - getTypes.data.items.map((m) => m.obj) - ); - $scope.postType = $rootScope.findObjectByKey( - $scope.postTypes, - "attribute_set_name", - $scope.request.type - ); - $scope.request.type = $routeParams.type || ""; - $scope.$apply(); - } - }; - $scope.getDefault = async function (type = null) { - $rootScope.isBusy = true; - type = type || $routeParams.type; - var resp = await service.getDefault({ - type: type || "", - template: $routeParams.template || "", - }); - if (resp.isSucceed) { - $scope.viewModel = resp.data; - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.onSelectType = function () { - $scope.viewModel.type = $scope.postType.attribute_set_name; - $scope.createUrl = `/portal/post/create?type=${$scope.request.type}`; - if ($routeParams.template) { - $scope.createUrl += `&template=${$routeParams.template}`; - } - if (!$scope.viewModel || !$scope.viewModel.id) { - $scope.getDefault($scope.request.type); - } - if ($scope.pageName == "postList") { - $scope.getList(); - } - }; - - $scope.getListRelated = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - var resp = await service.getList($scope.request); - if (resp && resp.isSucceed) { - $scope.viewModel.postNavs = $rootScope.filterArray( - $scope.viewModel.postNavs, - ["isActived"], - [true] - ); - angular.forEach(resp.data.items, (element) => { - var obj = { - description: element.title, - destinationId: element.id, - image: element.image, - isActived: false, - sourceId: $scope.viewModel.id, - specificulture: $scope.viewModel.specificulture, - status: "Published", - }; - $scope.viewModel.postNavs.push(obj); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(getData.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveFailCallback = function () { - angular.forEach($scope.viewModel.mixDatabaseNavs, function (nav) { - if (nav.isActived) { - $rootScope.decryptMixDatabase( - nav.mixDatabase.attributes, - nav.mixDatabase.postData.items - ); - } - }); - }; - $scope.saveSuccessCallback = async function () { - if ($scope.additionalData) { - $scope.additionalData.parentId = $scope.viewModel.id; - $scope.additionalData.parentType = "Post"; - var saveData = await dataService.save($scope.additionalData); - if (saveData.isSucceed) { - if ($location.path() == "/portal/post/create") { - $scope.goToDetail($scope.viewModel.id, "post"); - } else { - $scope.additionalData = saveData.data; - } - } - } - $rootScope.isBusy = false; - $scope.$apply(); - }; - $scope.getSingleSuccessCallback = async function () { - $scope.imgW = ngAppSettings.settings.post_image_width; - $scope.imgH = ngAppSettings.settings.post_image_height; - $scope.request.type = $scope.viewModel.type; - var moduleIds = $routeParams.module_ids; - var pageIds = $routeParams.page_ids; - await $scope.loadPostTypes(); - $scope.loadAdditionalData(); - if (moduleIds) { - for (var moduleId of moduleIds.split(",")) { - var moduleNav = $rootScope.findObjectByKey( - $scope.viewModel.modules, - "moduleId", - moduleId - ); - if (moduleNav) { - moduleNav.isActived = true; - } - } - } - if (pageIds) { - for (var pageId of pageIds.split(",")) { - var pageNav = $rootScope.findObjectByKey( - $scope.viewModel.categories, - "pageId", - pageId - ); - if (pageNav) { - pageNav.isActived = true; - } - } - } - if ($scope.viewModel.sysCategories) { - angular.forEach($scope.viewModel.sysCategories, function (e) { - e.attributeData.obj.isActived = true; - $scope.selectedCategories.push(e.attributeData.obj); - }); - } - - if ($scope.viewModel.sysTags) { - angular.forEach($scope.viewModel.sysTags, function (e) { - e.attributeData.obj.isActived = true; - $scope.selectedCategories.push(e.attributeData.obj); - }); - } - if ($routeParams.template) { - $scope.viewModel.view = $rootScope.findObjectByKey( - $scope.viewModel.templates, - "fileName", - $routeParams.template - ); - } - $scope.viewModel.publishedDateTime = $filter("utcToLocalTime")( - $scope.viewModel.publishedDateTime - ); - }; - - $scope.loadAdditionalData = async function () { - const obj = { - parentType: "Post", - parentId: $scope.viewModel.id, - databaseName: $scope.viewModel.type, - }; - const getData = await dataService.getAdditionalData(obj); - if (getData.isSucceed) { - $scope.additionalData = getData.data; - $scope.$apply(); - } - }; - $scope.generateSeo = function () { - if ($scope.viewModel) { - if ( - $scope.viewModel.seoName === null || - $scope.viewModel.seoName === "" - ) { - $scope.viewModel.seoName = $rootScope.generateKeyword( - $scope.viewModel.title, - "-" - ); - } - if ( - $scope.viewModel.seoTitle === null || - $scope.viewModel.seoTitle === "" - ) { - $scope.viewModel.seoTitle = $scope.viewModel.title; - } - if ( - $scope.viewModel.seoDescription === null || - $scope.viewModel.seoDescription === "" - ) { - $scope.viewModel.seoDescription = $scope.viewModel.excerpt; - } - if ( - $scope.viewModel.seoKeywords === null || - $scope.viewModel.seoKeywords === "" - ) { - $scope.viewModel.seoKeywords = $scope.viewModel.title; - } - } - }; - $scope.addAlias = async function () { - var getAlias = await urlAliasService.getSingle(); - if (getAlias.isSucceed) { - $scope.viewModel.urlAliases.push(getAlias.data); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(getAlias.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeAliasCallback = async function (index) { - $scope.viewModel.urlAliases.splice(index, 1); - $scope.$apply(); - }; - - $scope.updateSysCategories = function (data) { - // Loop selected categories - angular.forEach($scope.selectedCategories, function (e) { - // add if not exist in sysCategories - var current = $rootScope.findObjectByKey( - $scope.viewModel.sysCategories, - "id", - e.id - ); - if (!current) { - $scope.viewModel.sysCategories.push({ - id: e.id, - parentId: $scope.viewModel.id, - mixDatabaseName: "sys_category", - }); - } - }); - }; - $scope.updateSysTags = function (data) { - // Loop selected categories - angular.forEach($scope.selectedTags, function (e) { - // add if not exist in sysCategories - var current = $rootScope.findObjectByKey( - $scope.viewModel.sysTags, - "id", - e.id - ); - if (!current) { - $scope.viewModel.sysCategories.push({ - id: e.id, - parentId: $scope.viewModel.id, - mixDatabaseName: "sys_tag", - }); - } - }); - }; - $scope.validate = function () { - angular.forEach($scope.viewModel.mixDatabaseNavs, function (nav) { - if (nav.isActived) { - $rootScope.encryptMixDatabase( - nav.mixDatabase.attributes, - nav.mixDatabase.postData.items - ); - } - }); - return true; - }; - }, -]); - -'use strict'; -app.factory('PostRestService', ['BaseRestService', - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('post/portal'); - // Define more service methods here - return serviceFactory; - }]); - -'use strict'; -app.controller('RoleController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', 'RoleService', - function ($scope, $rootScope, ngAppSettings, $routeParams, service) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.role = { name: '' }; - $scope.createRole = async function () { - $rootScope.isBusy = true; - var result = await service.createRole($scope.role.name); - if (result.isSucceed) { - $scope.role.name = ''; - $scope.getList(); - } - else { - $rootScope.showMessage(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - }]); - -'use strict'; -app.factory('RoleService', ['BaseService', 'CommonService', function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('role', true); - - var _getPermissions = async function () { - var req = { - method: 'GET', - url: this.prefixUrl + '/permissions' - }; - return await commonService.getApiResult(req); - }; - - var _updatePermission = async function (permission) { - var req = { - method: 'POST', - url: this.prefixUrl + '/update-permission', - data: JSON.stringify(permission) - }; - return await commonService.getApiResult(req); - }; - var _createRole = function (name) { - var req = { - method: 'POST', - url: this.prefixUrl + '/create', - data: JSON.stringify(name) - }; - - return commonService.getApiResult(req); - }; - serviceFactory.createRole = _createRole; - serviceFactory.getPermissions = _getPermissions; - serviceFactory.updatePermission = _updatePermission; - return serviceFactory; - -}]); - -"use strict"; -app.controller("ServiceController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "RestMixDatabasePortalService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - commonService - ) { - BaseODataCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.defaultId = "default"; - $scope.parentId = null; - $scope.parentType = null; - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.init = async function () { - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.dataId = $routeParams.dataId; - }; - $scope.saveSuccessCallback = function () { - $rootScope.isBusy = false; - $scope.$apply(); - // if($scope.parentId){ - // $location.url('/portal/mix-database-data/details?dataId='+ $scope.parentId); - // } - // else{ - // $location.url('/portal/mix-database-data/list?mixDatabaseId='+ $scope.viewModel.mixDatabaseId); - // } - }; - $scope.getList = async function () { - $rootScope.isBusy = true; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - var type = $routeParams.type; - var parentId = $routeParams.parentId; - var response = await service.getList( - "read", - $scope.request, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - type, - parentId - ); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - if (response) { - $scope.data = response; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors("Failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id || $scope.defaultId; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - var resp = await service.getSingle("portal", [ - id, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - ]); - if (resp) { - $scope.viewModel = resp; - $scope.viewModel.parentType = $scope.parentType; - $scope.viewModel.parentId = $scope.parentId; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.edit = function (data) { - $scope.goToPath( - "/portal/mix-database-data/details?dataId=" + - data.id + - "&mixDatabaseId=" + - $scope.mixDatabaseId - ); - }; - $scope.remove = function (data) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (dataId) { - $rootScope.isBusy = true; - var result = await service.delete([dataId]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.controller('SocialFeedController', - ['$rootScope', '$scope', '$http', 'PostRestService', - function ($rootScope, $scope, $http, postService) { - $scope.types = [ - 'Facebook', - 'Instagram' - ]; - $scope.isInit = false; - $scope.defaultPost = null; - $scope.defaultProperty = { - name: null, - dataType: 7, - value: "" - } - $scope.data = []; - $scope.errors = []; - $scope.socialSettings = { - app_id: null, - page_id: null, - app_secret: null, - access_token: '', - page: [], - data: [], - posts: [], - show_login: true, - errors: [] - }; - $scope.init = async function () { - - window.fbAsyncInit = function () { - FB.init({ - appId: $rootScope.getConfiguration('FacebookAppId'), - autoLogAppEvents: true, - xfbml: true, - version: 'v3.2' - }); - }; - $scope.socialSettings = { - app_id: $rootScope.settings.data.FacebookAppId, - page_id: $rootScope.settings.data.Facebook_Page_Id, - app_secret: $rootScope.settings.data.FacebookAppSecret, - access_token: $rootScope.settings.data.FacebookAccessToken, - show_login: true, - errors: [] - }; - if ($scope.socialSettings.access_token) { - $scope.socialSettings.show_login = false; - $scope.loadPages(); - - } - postService.getSingle(['portal']).then((resp) => { - $scope.defaultPost = resp.data; - }); - }; - - // This function is called when someone finishes with the Login - // Button. See the onlogin handler attached to it in the sample - // code below. - $scope.login = function () { - FB.login(function (response) { - // handle the response - $scope.statusChangeCallback(response); - - }, { - scope: 'email, manage_pages', - return_scopes: true - }); - } - - $scope.statusChangeCallback = function (response) { - // The response object is returned with a status field that lets the - // app know the current login status of the person. - // Full docs on the response object can be found in the documentation - // for FB.getLoginStatus(). - if (response.status === 'connected') { - // Logged into your app and Facebook. - $scope.exchangeToken(response); - $scope.loadPages(); - //window.location = '/bo/feed?code=' + response.authResponse.accessToken; - } else { - $scope.socialSettings.show_login = true; - $scope.$apply(); - // The person is not logged into your app or we are unable to tell. - } - } - - $scope.exchangeToken = function (response) { - var url = '/oauth/access_token?grant_type=fb_exchange_token&client_id=' + $scope.socialSettings.app_id + '&client_secret=' + $scope.socialSettings.app_secret + '&fb_exchange_token=' + response.authResponse.accessToken; - FB.api(url, function (response) { - if (response.access_token) { - $scope.socialSettings.access_token = response.access_token; - } - else { - $scope.show_login = true; - $scope.socialSettings.errors = response; - $scope.$apply(); - } - }); - } - $scope.loadFeeds = function (url) { - $scope.socialSettings.errors = ''; - $scope.socialSettings.posts = []; - url = url || '/' + $scope.socialSettings.page_id + '/posts?access_token=' + $scope.socialSettings.access_token + '&fields=type,name,story,full_picture,created_time,permalink_url,message,description,caption,attachments{media,type,target,subattachments},shares.summary(true).limit(0),likes.summary(true).limit(0),comments.summary(true).limit(0)&limit=10'; - $rootScope.isBusy = true; - FB.api(url, function (response) { - if (response.data) { - $scope.socialSettings.data = response.data; - angular.forEach(response.data, function (e, i) { - var post = $scope.parsePost(e); - $scope.socialSettings.posts.push(post); - }); - if (response.paging) { - $scope.socialSettings.nextUrl = response.paging.next; - $scope.socialSettings.prevUrl = response.paging.previous; - } - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $scope.socialSettings.show_login = true; - $rootScope.isBusy = false; - $scope.socialSettings.errors = response; - $scope.$apply(); - } - }); - } - $scope.loadPages = function () { - $scope.socialSettings.errors = ''; - var url = '/me/accounts?access_token=' + $scope.socialSettings.access_token + '&fields=id,name'; - FB.api(url, function (response) { - if (response.data) { - $scope.socialSettings.pages = response.data; - $scope.$apply(); - } - else { - $scope.socialSettings.show_login = true; - $scope.socialSettings.errors = response; - } - }); - } - $scope.setAttr = function (e, attrName, attVal) { - $(e).attr(attrName, attVal); - }; - $scope.parsePost = function (post) { - var post = angular.copy($scope.defaultPost); - var prop = angular.copy($scope.defaultProperty); - post.title = "Facebook Id"; - post.name = "facebook_id"; - post.value = post.id; - post.properties.push(prop); - - post.title = post.name || post.id; - post.excerpt = post.message; - post.content = post.description; - post.source = 'Facebook'; - post.image = post.full_picture; - post.detailsUrl = post.permalink_url - var attachments = post.attachments.data[0]; - - if (attachments.media) { - var media = $scope.parseMedia(attachments.media, attachments.type); - if (media) { - post.mediaNavs.push({ - media: media, - specificulture: $rootScope.settings.lang, - image: media.fullPath - }); - } - } - - if (attachments.subattachments) { - var medias = $scope.parseMedias(attachments.subattachments.data); - angular.forEach(medias, function (e, i) { - post.mediaNavs.push({ - media: e, - specificulture: $rootScope.settings.lang, - image: e.fullPath - }) - }) - } - return post; - } - $scope.parseMedias = function (data) { - var result = []; - if (data) { - angular.forEach(data, function (e, i) { - var media = $scope.parseMedia(e.media, e.type); - if (media) { - result.push(media); - } - }) - } - return result; - } - $scope.parseMedia = function (media, type) { - if (media) { - var src = ''; - switch (type) { - case 'video_autoplay': - src = media.source; - break; - case 'profile_media': - case 'photo': - default: - src = media.image.src; - break; - } - try { - if (src) { - var index = src.lastIndexOf('/'); - var ext = src.match(/.(?:jpg|gif|png|gif|jpeg|mp4)/)[0]; - // if valid file - if (ext) { - var eIndex = src.indexOf(ext); - var filename = src.substring(index + 1, eIndex); - var media = { - fileName: filename, - fileFolder: 'Facebook', - extension: ext, - targetUrl: src, - fullPath: src, - fileType: type, - source: 'Facebook' - } - - return media; - } - else { - return null; - } - } else { - return null; - } - } - catch (err) { - console.log('Cannot parse media', media); - return null; - } - } - } - $scope.syncPosts = async function () { - $rootScope.isBusy = true; - var resp = await postService.saveList($scope.socialSettings.posts); - if (resp && resp.isSucceed) { - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); -'use strict'; -app.controller('StoreController', - ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', 'StoreService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, service) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.key = 'service.store'; - $scope.cates = ngAppSettings.enums.configuration_cates; - $scope.settings = $rootScope.globalSettings; - }]); - -'use strict'; -app.factory('StoreService', ['BaseRestService', function (baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('post/portal', null, false, 'https://store.mixcore.org'); - // Define more service methods here - - return serviceFactory; - -}]); - -"use strict"; -app.controller("TemplateController", [ - "$scope", - "$rootScope", - "$routeParams", - "$location", - "ngAppSettings", - "TemplateService", - function ( - $scope, - $rootScope, - $routeParams, - $location, - ngAppSettings, - service - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.folderTypes = [ - "Masters", - "Layouts", - "Pages", - "Modules", - "Forms", - "Edms", - "Products", - "Posts", - "Widgets", - ]; - - $scope.activedPane = null; - $scope.canRename = true; - $scope.selectPane = function (pane) { - $scope.activedPane = pane; - }; - $scope.loadFolder = function (d) { - $location.url( - "/portal/template/list/" + - $routeParams.themeId + - "?folderType=" + - encodeURIComponent(d) - ); - }; - $scope.loadParams = async function () { - $rootScope.isBusy = true; - $scope.folderType = $routeParams.folderType; // ? $routeParams.folderType : 'Masters'; - $scope.themeId = $routeParams.themeId; - }; - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.folderType = $routeParams.folderType; // ? $routeParams.folderType : 'Masters'; - var themeId = $routeParams.themeId; - $scope.listUrl = - "/portal/template/list/" + - themeId + - "?folderType=" + - encodeURIComponent($scope.folderType); - if (id) { - var resp = await service.getSingle([id], { - folderType: $scope.folderType, - themeId: themeId, - }); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $scope.canRename = - $scope.viewModel.id === 0 || - $scope.viewModel.fileName.indexOf("Copy") === 0; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - var resp = await service.getDefault(); - if (resp && resp.isSucceed) { - resp.data.themeId = themeId; - resp.data.folderType = $scope.folderType; - $scope.viewModel = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.copy = async function (id) { - $rootScope.isBusy = true; - $scope.folderType = $routeParams.folderType; // ? $routeParams.folderType : 'Masters'; - var themeId = $routeParams.themeId; - $scope.listUrl = - "/portal/template/list/" + - themeId + - "?folderType=" + - encodeURIComponent($scope.folderType); - var resp = await service.copy(id); - if (resp && resp.isSucceed) { - $location.url( - `/portal/template/details/${themeId}/${$scope.folderType}/${resp.data.id}` - ); - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.getList = async function (pageIndex, themeId) { - $scope.request.themeId = themeId || $routeParams.themeId; - $scope.request.folderType = $routeParams.folderType; - $scope.request.status = null; - $scope.folderType = $routeParams.folderType; - if ($scope.folderType) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var df = new Date($scope.request.fromDate); - $scope.request.fromDate = df.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var resp = await service.getList($scope.request, [$scope.themeId]); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - $rootScope.isBusy = false; - } - }; - - $scope.updateTemplateContent = function (content) { - $scope.viewModel.content = content; - }; - $scope.updateStyleContent = function (content) { - $scope.viewModel.scripts = content; - }; - $scope.updateScriptContent = function (content) { - $scope.viewModel.styles = content; - }; - }, -]); - -"use strict"; -app.controller("ThemeController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ThemeService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - commonService - ) { - BaseCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.exportData = null; - $scope.selectedExport = { - pages: [], - modules: [], - mixDatabases: [], - }; - - $scope.getSingleSuccessCallback = function () { - $scope.assets = null; - $scope.theme = null; - }; - $scope.save = async function (viewModel) { - var form = document.getElementById("form-portal"); - var frm = new FormData(); - var url = service.prefixUrl + "/save"; - - $rootScope.isBusy = true; - // Looping over all files and add it to FormData object - frm.append("assets", form["assets"].files[0]); - frm.append("theme", form["theme"].files[0]); - // Adding one more key to FormData object - frm.append("model", angular.toJson(viewModel || $scope.viewModel)); - - var response = await service.ajaxSubmitForm(frm, url); - if (response.isSucceed) { - $scope.viewModel = response.data; - $rootScope.isBusy = false; - $location.url($scope.referrerUrl); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.syncTemplates = async function (id) { - $rootScope.isBusy = true; - var response = await service.syncTemplates(id); - if (response.isSucceed) { - $scope.viewModel = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.export = async function () { - var id = $routeParams.id; - $rootScope.isBusy = true; - var response = await service.export(id, $scope.selectedExport); - if (response.isSucceed) { - $rootScope.isBusy = false; - window.open(response.data, "_blank"); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = function () { - commonService.initAllSettings().then(function () { - $location.path("/portal/theme/list"); - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - $scope.removeCallback = function () { - commonService.initAllSettings().then(function () { - $location.path("/portal/theme/list"); - }); - }; - - $scope.getExportData = async function () { - var id = $routeParams.id; - var resp = await service.getExportData(id); - if (resp && resp.isSucceed) { - $scope.exportData = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.generateSEO = function () { - $scope.viewModel.name = $rootScope.generateKeyword( - $scope.viewModel.title, - "-" - ); - }; - }, -]); - -'use strict'; -app.factory('ThemeService', ['CommonService', 'BaseService', - function (commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('theme'); - - var _syncTemplates = async function (id) { - var url = this.prefixUrl + '/sync/' + id; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req, ''); - }; - var _export = async function (id, objData) { - var url = this.prefixUrl + '/export/' + id; - var req = { - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - var _getExportData = async function (id) { - var url = (this.prefixUrl || '/' + this.lang + '/' + this.modelName) + '/export/' + id; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - }; - serviceFactory.export = _export; - serviceFactory.syncTemplates = _syncTemplates; - serviceFactory.getExportData = _getExportData; - return serviceFactory; - - }]); - -'use strict'; -app.controller('UrlAliasController', - [ - '$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$location', - 'UrlAliasService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $location, - service, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.cates = ['Site', 'System']; - $scope.others = []; - $scope.settings = $rootScope.globalSettings; - $scope.pageId = $routeParams.id; - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = '&page_id=' + id; - var response = await service.getList($scope.request); - $scope.canDrag = $scope.request.orderBy !== 'Priority' || $scope.request.direction !== '0'; - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (id) { - $rootScope.showConfirm($scope, 'removeConfirmed', [id], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete(id); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }]); - -'use strict'; -app.factory('UrlAliasService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('url-alias'); - - var _updateInfos = async function (pages) { - - var req = { - method: 'POST', - url: this.prefixUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - - }]); - -"use strict"; -app.controller("UserController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$timeout", - "$location", - "AuthService", - "UserServices", - "RestMixDatabaseDataPortalService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $timeout, - $location, - authService, - userServices, - dataService - ) { - $scope.request = { - pageSize: "10", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - }; - - $scope.mediaFile = { - file: null, - fullPath: "", - folder: "User", - title: "", - description: "", - }; - $scope.activedUser = null; - $scope.relatedUsers = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - }; - $scope.errors = []; - - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - - $scope.loadUser = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var response = await userServices.getUser(id, "portal"); - if (response.isSucceed) { - $scope.activedUser = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.loadMyProfile = async function () { - $rootScope.isBusy = true; - var response = await userServices.getMyProfile(); - if (response.isSucceed) { - $scope.activedUser = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.loadUsers = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - $rootScope.isBusy = true; - var resp = await userServices.getUsers($scope.request); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $.each($scope.data.items, function (i, user) { - $.each($scope.data, function (i, e) { - if (e.userId === user.id) { - user.isHidden = true; - } - }); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeUser = function (id) { - $rootScope.showConfirm( - $scope, - "removeUserConfirmed", - [id], - null, - "Remove User", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeUserConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await userServices.removeUser(id); - if (result.isSucceed) { - $scope.loadUsers(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.save = async function () { - //if (user.avatar !== user.avatarUrl) { - // user.avatar = user.avatarUrl; - //} - $rootScope.isBusy = true; - var resp = await userServices.saveUser($scope.activedUser); - if (resp && resp.isSucceed) { - $rootScope.showMessage("Update successfully!", "success"); - if ($scope.activedUser.id == authService.authentication.id) { - authService - .refreshToken(authService.authentication.refresh_token) - .then(() => { - window.location = window.location; - }); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveUserData = async function () { - if ($scope.activedUser.userData) { - $scope.activedUser.userData.parentId = $scope.activedUser.id; - $scope.activedUser.userData.parentType = "User"; - await dataService.save($scope.activedUser.userData); - } - }; - - $scope.register = async function (user) { - $rootScope.isBusy = true; - var resp = await userServices.register(user); - if (resp && resp.isSucceed) { - $scope.activedUser = resp.data; - $rootScope.showMessage("Update successfully!", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.updateRoleStatus = async function (nav) { - var userRole = { - userId: nav.userId, - roleId: nav.roleId, - roleName: nav.description, - isUserInRole: nav.isActived, - }; - $rootScope.isBusy = true; - var resp = await userServices.updateRoleStatus(userRole); - if (resp && resp.isSucceed) { - $rootScope.showMessage("Update successfully!", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -'use strict'; -app.factory('UserServices', ['$http', 'CommonService', 'ngAppSettings' - , function ($http, commonService, ngAuthSettings) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var usersServiceFactory = {}; - var apiUrl = '/account/'; - - var serviceBase = ngAuthSettings.serviceBase; - - var _getUserDemographicInfo = function () { - var url = '/GetUserDemographicInfo'; - var req = { - method: 'GET', - url: serviceBase + url - }; - - return commonService.getApiResult(req); - }; - - - - var _importUsers = function (strBase64) { - var url = 'import-users'; - var req = { - method: 'POST', - url: apiUrl + url, - data: JSON.stringify({ strBase64: strBase64 }) - }; - - return commonService.getApiResult(req); - }; - - var _getUsers = function (request) { - - var req = { - method: 'POST', - url: apiUrl + 'list', - data: request - }; - - return commonService.getApiResult(req); - }; - - var _getUser = async function (id, viewType) { - var apiUrl = '/account/'; - var url = apiUrl + 'details/' + viewType; - if (id) { - url += '/' + id; - } - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _getMyProfile = async function () { - var apiUrl = '/account/'; - var url = apiUrl + 'my-profile'; - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - var _updateRoleStatus = function (userInRole) { - - var req = { - method: 'POST', - url: serviceBase + '/account/user-in-role', - data: JSON.stringify(userInRole) - - }; - - return commonService.getApiResult(req); - }; - - var _saveUser = async function (user) { - var apiUrl = '/account/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(user) - }; - return await commonService.getApiResult(req) - }; - - var _register = async function (user) { - var apiUrl = '/account/'; - var req = { - method: 'POST', - url: apiUrl + 'register', - data: JSON.stringify(user) - }; - return await commonService.getApiResult(req) - }; - - var _removeUser = function (userId) { - var req = { - method: 'GET', - url: apiUrl + 'remove-user/' + userId - }; - - return commonService.getApiResult(req); - }; - - usersServiceFactory.importUsers = _importUsers; - usersServiceFactory.getUsers = _getUsers; - usersServiceFactory.getUser = _getUser; - usersServiceFactory.getMyProfile = _getMyProfile; - usersServiceFactory.saveUser = _saveUser; - usersServiceFactory.register = _register; - usersServiceFactory.removeUser = _removeUser; - usersServiceFactory.updateRoleStatus = _updateRoleStatus; - usersServiceFactory.getUserDemographicInfo = _getUserDemographicInfo; - return usersServiceFactory; - - }]); - -'use strict'; -function PageDetailsController($scope, $element, $attrs) { - var ctrl = this; - ctrl.activedPage = null; - ctrl.relatedPages = []; - ctrl.data = []; - ctrl.errors = []; - ctrl.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - ctrl.loadPage = function (pageId) { - ctrl.isBusy = true; - var url = '/' + ctrl.currentLanguage + '/page/details/be/' + pageId;//byPage/' + pageId; - ctrl.settings.method = "GET"; - ctrl.settings.url = url;// + '/true'; - ctrl.settings.data = ctrl.request; - $.ajax(ctrl.settings).done(function (response) { - if (response.isSucceed) { - ctrl.activedPage = response.data; - ctrl.initEditor(); - } - ctrl.isBusy = false; - ctrl.$apply(); - }); - }; - ctrl.loadPages = function (pageIndex) { - ctrl.isBusy = true; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - ctrl.request.fromDate = ctrl.request.fromDate.toISOString(); - } - if (ctrl.request.toDate !== null) { - ctrl.request.toDate = ctrl.request.toDate.toISOString(); - } - var url = '/' + ctrl.currentLanguage + '/page/list';//byPage/' + pageId; - ctrl.settings.method = "POST"; - ctrl.settings.url = url;// + '/true'; - ctrl.settings.data = ctrl.request; - $.ajax(ctrl.settings).done(function (response) { - (ctrl.data = response.data); - - $.each(ctrl.data.items, function (i, page) { - $.each(ctrl.activedPages, function (i, e) { - if (e.pageId === page.id) { - page.isHidden = true; - } - }) - }) - ctrl.isBusy = false; - setTimeout(function () { - $('[data-bs-toggle="popover"]').popover({ - html: true, - content: function () { - var content = $(this).next('.popover-body'); - return $(content).html(); - }, - title: function () { - var title = $(this).attr("data-popover-content"); - return $(title).children(".popover-heading").html(); - } - }); - }, 200); - ctrl.$apply(); - }); - }; - - ctrl.removePage = function (pageId) { - if (confirm("Are you sure!")) { - var url = '/' + ctrl.currentLanguage + '/page/delete/' + pageId; - $.ajax({ - method: 'GET', - url: url, - success: function (data) { - ctrl.loadPages(); - ctrl.$apply(); - }, - error: function (a, b, c) { - } - }); - } - }; - ctrl.savePage = function (page) { - var url = '/' + ctrl.currentLanguage + '/page/save'; - $.ajax({ - method: 'POST', - url: url, - data: page, - success: function (data) { - //ctrl.loadPages(); - if (data.isSucceed) { - alert('success'); - } - else { - alert('failed! ' + data.errors); - } - }, - error: function (a, b, c) { - } - }); - }; - - ctrl.changeMedia = function (media) { - var currentItem = null; - if (ctrl.activedPage.mediaNavs === undefined) { - ctrl.activedPage.mediaNavs = []; - } - $.each(ctrl.activedPage.mediaNavs, function (i, e) { - if (e.mediaId === media.id) { - e.isActived = media.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - description: media.description !== 'undefined' ? media.description : '', - image: media.fullPath, - mediaId: media.id, - page: ctrl.activedPage.id, - specificulture: media.specificulture, - position: 0, - priority: ctrl.activedMedias.length + 1, - isActived: true - }; - media.isHidden = true; - ctrl.activedPage.mediaNavs.push(currentItem); - } - } - - ctrl.changePage = function (page) { - var currentItem = null; - $.each(ctrl.activedPage.pageNavs, function (i, e) { - if (e.relatedPageId === page.id) { - e.isActived = page.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - relatedPageId: page.id, - sourcePageId: $('#page-id').val(), - specificulture: page.specificulture, - priority: ctrl.activedPage.pageNavs.length + 1, - page: page, - isActived: true - }; - page.isHidden = true; - ctrl.activedPage.pageNavs.push(currentItem); - } - } - - - ctrl.addProperty = function (type) { - var i = $(".property").length; - $.ajax({ - method: 'GET', - url: '/' + ctrl.currentLanguage + '/Portal/' + type + '/AddEmptyProperty/' + i, - success: function (data) { - $('#tbl-properties > tbody').append(data); - $(data).find('.prop-data-type').trigger('change'); - }, - error: function (a, b, c) { - } - }); - ctrl.updateHero = function (hero, prop, value) { - hero[prop] = value; - }; - - ctrl.deleteHero = function (hero) { - var idx = ctrl.list.indexOf(hero); - if (idx >= 0) { - ctrl.list.splice(idx, 1); - } - }; - } - - angular.module(appName).component('pageDetails', { - templateUrl: 'pageDetails.html', - controller: PageDetailsController - }); -} - - - - -app.component('appSettingsAuth', { - templateUrl: '/mix-app/views/app-portal/pages/app-settings/components/auth/view.html', - controller: ['ngAppSettings', function (ngAppSettings) { - var ctrl = this; - }], - bindings: { - appSettings: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('appSettingsDefault', { - templateUrl: '/mix-app/views/app-portal/pages/app-settings/components/default/view.html', - controller: ['$rootScope', 'ngAppSettings', function ($rootScope, ngAppSettings) { - var ctrl = this; - ctrl.$onInit = function () { - ctrl.properties = $.parseJSON(ctrl.appSettings.GlobalSettings.DefaultPostAttr); - ctrl.trackedProperties = $.parseJSON(ctrl.appSettings.GlobalSettings.DefaultPostAttr); - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - } - ctrl.addPostProperty = function () { - ctrl.properties.push({ - priority: 0, - name: '', - value: null, - dataType: '7' - }); - - }; - ctrl.$doCheck = function () { - if (ctrl.trackedProperties != ctrl.properties) { - ctrl.trackedProperties = angular.copy(ctrl.properties); - ctrl.appSettings.GlobalSettings.DefaultPostAttr = JSON.stringify(ctrl.properties); - } - }.bind(ctrl); - }], - bindings: { - appSettings: '=', - cultures: '=', - statuses: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -modules.component('portalMenus', { - templateUrl: '/mix-app/views/app-portal/pages/app-settings/components/portal-menus/view.html', - bindings: { - 'data': '=', - 'allowedTypes': '=' - }, - controller: ['$rootScope', '$scope', '$location', 'CommonService', 'ngAppSettings', - function ($rootScope, $scope, $location, commonService, ngAppSettings) { - var ctrl = this; - // ctrl.icons = []; - ctrl.translate = $rootScope.translate; - ctrl.init = function () { - ctrl.icons = ngAppSettings.icons; - }; - - }] -}); - -app.component('appSettingsGeneral', { - templateUrl: '/mix-app/views/app-portal/pages/app-settings/components/general/view.html', - controller: ['ngAppSettings', function (ngAppSettings) { - var ctrl = this; - }], - bindings: { - appSettings: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('appSettingsSmtp', { - templateUrl: '/mix-app/views/app-portal/pages/app-settings/components/smtp/view.html', - controller: ['ngAppSettings', function (ngAppSettings) { - var ctrl = this; - }], - bindings: { - appSettings: '=' - } -}); - -app.component('customerOrders', { - templateUrl: '/mix-app/views/app-portal/pages/customer/components/orders/customer-orders.html', - controller: ['$rootScope', 'OrderServices', function ($rootScope, orderServices) { - var ctrl = this; - ctrl.removeOrder = function (id) { - $rootScope.showConfirm(ctrl, 'removeOrderConfirmed', [id], null, 'Remove Order', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - } - - ctrl.removeOrderConfirmed = async function (id) { - var result = await orderServices.removeOrder(id); - if (result.isSucceed) { - $rootScope.showMessage('success', 'success'); - window.top.location = window.top.location.href; - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }], - bindings: { - customer: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('customerMain', { - templateUrl: '/mix-app/views/app-portal/pages/customer/components/main/customer-main.html', - bindings: { - customer: '=', - onDelete: '&', - onUpdate: '&' - } -}); -app.component("mixDatabaseEdm", { - templateUrl: - "/mix-app/views/app-portal/pages/mix-database/components/edm/view.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - }, - ], - bindings: { - model: "=", - }, -}); - -app.component("mixDatabaseMain", { - templateUrl: - "/mix-app/views/app-portal/pages/mix-database/components/main/view.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - ctrl.gennerateName = function () { - if ( - !ctrl.model.id || - ctrl.model.name === null || - ctrl.model.name === "" - ) { - ctrl.model.name = $rootScope.generateKeyword(ctrl.model.title, "_"); - } - }; - }, - ], - bindings: { - model: "=", - }, -}); - - -app.component('moduleMain', { - templateUrl: '/mix-app/views/app-portal/pages/module/components/main/main.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - ctrl.gennerateName = function () { - if (!ctrl.module.id || ctrl.module.name === null || ctrl.module.name === '') { - ctrl.module.name = $rootScope.generateKeyword(ctrl.module.title, '_'); - } - }; - }], - bindings: { - module: '=', - } -}); - -app.component('moduleContent', { - templateUrl: '/mix-app/views/app-portal/pages/module/components/module-content/view.html', - bindings: { - model: '=', - additionalData: "=", - }, - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - }] -}); -app.component("moduleAdvanced", { - templateUrl: - "/mix-app/views/app-portal/pages/module/components/module-advanced/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - }; - }, - ], -}); - - -app.component('moduleType', { - templateUrl: '/mix-app/views/app-portal/pages/module/components/module-type/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - }], - bindings: { - model: '=', - } -}); - -app.component('pageGeneral', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/general/general.html', - controller: function ($scope) { - var ctrl = this; - ctrl.dataTypes = [ - { - title: 'String', - value: 'text' - }, - { - title: 'Int', - value: 'int' - }, - { - title: 'Image', - value: 'image' - }, - { - title: 'Boolean', - value: 'boolean' - } - ]; - ctrl.configurations = { - core: {}, - plugins: { - btnsDef: { - // Customizables dropdowns - image: { - dropdown: ['insertImage', 'upload', 'base64', 'noembed'], - ico: 'insertImage' - } - }, - btns: [ - ['viewHTML'], - ['undo', 'redo'], - ['formatting'], - ['strong', 'em', 'del', 'underline'], - ['link'], - ['image'], - ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], - ['unorderedList', 'orderedList'], - ['foreColor', 'backColor'], - ['preformatted'], - ['horizontalRule'], - ['fullscreen'] - ], - plugins: { - // Add imagur parameters to upload plugin - upload: { - serverPath: 'https://api.imgur.com/3/image', - fileFieldName: 'image', - headers: { - 'Authorization': 'Client-ID 9e57cb1c4791cea' - }, - urlPropertyName: 'data.link' - } - } - } - }; - ctrl.addProperty = function (type) { - var i = $(".property").length; - ctrl.page.properties.push({ - priority: 0, - name: '', - value: null, - dataType: 0 - }); - }; - ctrl.initEditor = function () { - setTimeout(function () { - // Init Code editor - $.each($('.code-editor'), function (i, e) { - var container = $(this); - var editor = ace.edit(e); - if (container.hasClass('json')) { - editor.session.setMode("ace/mode/json"); - } - else { - editor.session.setMode("ace/mode/razor"); - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - - editor.session.setUseWrapMode(true); - editor.setOptions({ - maxLines: Infinity - }); - editor.getSession().on('change', function (e) { - // e.type, etc - $(container).parent().find('.code-content').val(editor.getValue()); - }); - }) - $.each($('.editor-content'), function (i, e) { - var $demoTextarea = $(e); - $demoTextarea.quill(ctrl.configurations.plugins); - }); - }, 200) - } - }, - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('pageMain', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/main/main.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', function ($rootScope, $scope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - // ctrl.setPageType = function (type) { - // ctrl.page.type = $index; - // } - ctrl.generateSeo = function () { - if (ctrl.page) { - if (ctrl.page.seoName === null || ctrl.page.seoName === '') { - ctrl.page.seoName = $rootScope.generateKeyword(ctrl.page.title, '-'); - } - if (ctrl.page.seoTitle === null || ctrl.page.seoTitle === '') { - ctrl.page.seoTitle = ctrl.page.title - } - if (ctrl.page.seoDescription === null || ctrl.page.seoDescription === '') { - ctrl.page.seoDescription = ctrl.page.excerpt - } - if (ctrl.page.seoKeywords === null || ctrl.page.seoKeywords === '') { - ctrl.page.seoKeywords = ctrl.page.title - } - } - } - }], - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('pageModules', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/modules/modules.html', - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); -app.component("pageContent", { - templateUrl: - "/mix-app/views/app-portal/pages/page/components/page-content/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.generateSeo = function () { - if ($scope.viewModel) { - if (ctrl.model.seoName === null || ctrl.model.seoName === "") { - ctrl.model.seoName = $rootScope.generateKeyword( - ctrl.model.title, - "-" - ); - } - if (ctrl.model.seoTitle === null || ctrl.model.seoTitle === "") { - ctrl.model.seoTitle = ctrl.model.title; - } - if ( - ctrl.model.seoDescription === null || - ctrl.model.seoDescription === "" - ) { - ctrl.model.seoDescription = ctrl.model.excerpt; - } - if ( - ctrl.model.seoKeywords === null || - ctrl.model.seoKeywords === "" - ) { - ctrl.model.seoKeywords = ctrl.model.title; - } - } - }; - }, - ], -}); - -app.component("pageAdvanced", { - templateUrl: "/mix-app/views/app-portal/pages/page/components/page-advanced/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - - ctrl.translate = $rootScope.translate; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - }; - }, - ], -}); - - -app.component('pageType', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/page-type/view.html', - bindings: { - model: '=', - }, - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - - }], -}); - -app.component('pageParents', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/parents/parents.html', - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('pagePlugPlay', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/plug-play/plug-play.html', - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('productRelated', { - templateUrl: '/mix-app/views/app-portal/pages/product/components/related/productRelated.html', - controller: function () { - var ctrl = this; - ctrl.activeProduct = function (pr) { - var currentItem = null; - $.each(ctrl.product.productNavs, function (i, e) { - if (e.relatedProductId === pr.id) { - e.isActived = pr.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - relatedProductId: pr.id, - sourceProductId: ctrl.product.id, - specificulture: ctrl.product.specificulture, - priority: ctrl.product.productNavs.length + 1, - relatedProduct: pr, - isActived: true - }; - pr.isHidden = true; - ctrl.product.productNavs.push(currentItem); - } - } - }, - bindings: { - product: '=', - list: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('pageSeo', { - templateUrl: '/mix-app/views/app-portal/pages/page/components/seo/seo.html', - controller: [ - '$rootScope', - function ($rootScope) { - var ctrl = this; - ctrl.translate = function (keyword) { - return $rootScope.translate(keyword); - }; - } - ], - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('permissionMain', { - templateUrl: '/mix-app/views/app-portal/pages/permission/components/main/main.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', '$routeParams', function ($rootScope, $scope, ngAppSettings, $routeParams) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - ctrl.icons = ngAppSettings.icons; - ctrl.setPageType = function (type) { - ctrl.page.type = $index; - }; - ctrl.generateKeyword = function (text) { - if (!$routeParams.id && text) { - ctrl.page.textKeyword = 'portal_' + text.replace(/[^a-zA-Z0-9]+/g, '_') - .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') - .replace(/([a-z])([A-Z])/g, '$1-$2') - .replace(/([0-9])([^0-9])/g, '$1-$2') - .replace(/([^0-9])([0-9])/g, '$1-$2') - .replace(/-+/g, '_') - .toLowerCase(); - } - }; - }], - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('permissionParents', { - templateUrl: '/mix-app/views/app-portal/pages/permission/components/parents/parents.html', - bindings: { - page: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('postGeneral', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/general/view.html', - controller: ['$rootScope', 'ngAppSettings', function ($rootScope, ngAppSettings) { - var ctrl = this; - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.$onInit = function () { - - }; - ctrl.addProperty = function (type) { - var i = $(".property").length; - ctrl.post.properties.push({ - title: '', - name: '', - value: null, - dataType: 'text' - }); - }; - }], - bindings: { - post: '=', - isAdmin: '=', - onDelete: '&', - onUpdate: '&' - } -}); -app.component('permissionPlugPlay', { - templateUrl: '/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html', - bindings: { - page: '=', - prefixParent: '=', - prefixChild: '=', - searchText: '=', - onDelete: '&', - onUpdate: '&' - }, - controller: ['$rootScope', '$scope', '$location', '$element', 'PermissionService', - function ($rootScope, $scope, $location, $element, service) { - var ctrl = this; - ctrl.type = 'Children'; - ctrl.goToPath = $rootScope.goToPath; - ctrl.request = { - pageSize: '5', - pageIndex: 0, - status: 'Published', - orderBy: 'CreatedDateTime', - direction: 'Desc', - fromDate: null, - toDate: null, - }; - ctrl.pages = []; - ctrl.init = function () { - if (ctrl.page) { - ctrl.request.exceptIds = ctrl.page.parentNavs.map(p => p.pageId).concat(ctrl.page.childNavs.map(p => p.pageId)); - if (ctrl.request.exceptIds.indexOf(ctrl.page.id) === -1) { - ctrl.request.exceptIds.push(ctrl.page.id); - } - ctrl.getList(); - }; - } - ctrl.selectPane = function (pane) { - if (ctrl.page) { - ctrl.type = pane.header;; - ctrl.request.keyword = ''; - ctrl.init(); - } - }; - - ctrl.selectItem = (nav) => { - if (ctrl.type == 'Parents') { - if (!$rootScope.findObjectByKey(ctrl.page.parentNavs, 'pageId', nav.id)) { - ctrl.page.parentNavs.push({ - isActived: true, - pageId: ctrl.page.id, - parentId: nav.id, - description: nav.textDefault, - status: 'Published', - parent: nav - }); - } - } else { - if (!$rootScope.findObjectByKey(ctrl.page.childNavs, 'pageId', nav.id)) { - ctrl.page.childNavs.push({ - isActived: true, - pageId: nav.id, - parentId: ctrl.page.id, - description: nav.textDefault, - status: 'Published', - page: nav - }); - } - } - - } - - ctrl.getList = async function () { - $rootScope.isBusy = true; - var resp = await service.getList(ctrl.request); - if (resp && resp.isSucceed) { - ctrl.pages = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors || ['Failed']); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - } - ] -}); - -app.component('postMedias', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/medias/view.html', - controller: function () { - var ctrl = this; - ctrl.activeMedia = function (media) { - var currentItem = null; - if (ctrl.post.mediaNavs === null) { - ctrl.post.mediaNavs = []; - } - $.each(ctrl.post.mediaNavs, function (i, e) { - if (e.mediaId === media.id) { - e.isActived = media.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - description: media.description !== 'undefined' ? media.description : '', - image: media.filePath, - mediaId: media.id, - post: ctrl.post.id, - specificulture: media.specificulture, - position: 0, - priority: ctrl.post.mediaNavs.length + 1, - isActived: true - }; - media.isHidden = true; - ctrl.post.mediaNavs.push(currentItem); - } - } - }, - bindings: { - post: '=', - medias: '=', - loadMedia: '&', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('postModules', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/modules/view.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', 'SharedModuleDataService', - function ($rootScope, $scope, ngAppSettings, moduleDataService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.translate = function (keyword, wrap, defaultValue) { - return $rootScope.translate(keyword, wrap, defaultValue); - }; - - ctrl.removeData = function (id, moduleId) { - $rootScope.showConfirm(ctrl, 'removeDataConfirmed', [id, moduleId], null, 'Remove Data', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - } - ctrl.removeDataConfirmed = async function (id, moduleId) { - $rootScope.isBusy = true; - var result = await moduleDataService.removeModuleData(id); - if (result.isSucceed) { - ctrl.loadModuleDatas(moduleId); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.saveDataCallback = function (data) { - if (data) { - ctrl.loadModuleDatas(data.moduleId); - } - } - ctrl.loadModuleDatas = async function (id, pageIndex) { - $rootScope.isBusy = true; - $scope.dataColumns = []; - var request = angular.copy(ngAppSettings.request); - request.query = '?module_id=' + id + '&post_id=' + ctrl.post.id; - if (pageIndex) { - request.pageIndex = pageIndex; - } - var response = await moduleDataService.getModuleDatas(request); - if (response.isSucceed) { - var nav = $rootScope.findObjectByKey(ctrl.post.moduleNavs, 'moduleId', id); - if (nav) { - nav.module.data = response.data; - } - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.updateDataInfos = async function (items) { - $rootScope.isBusy = true; - var resp = await moduleDataService.updateInfos(items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }], - bindings: { - post: '=', - onDelete: '&', - onUpdate: '&' - } -}); -app.component("postMain", { - templateUrl: "/mix-app/views/app-portal/pages/post/components/main/view.html", - bindings: { - post: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.generateSeo = function () { - if (ctrl.post) { - if (!ctrl.post.seoName) { - ctrl.post.seoName = $rootScope.generateKeyword( - ctrl.post.title, - "-" - ); - } - if (!ctrl.post.seoTitle) { - ctrl.post.seoTitle = ctrl.post.title; - } - if (!ctrl.post.seoDescription === null) { - ctrl.post.seoDescription = ctrl.post.excerpt; - } - if (!ctrl.post.seoKeywords) { - ctrl.post.seoKeywords = ctrl.post.title; - } - } - }; - }, - ], -}); - - -app.component('postParents', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/parents/view.html', - bindings: { - post: '=', - onDelete: '&', - onUpdate: '&' - } -}); -app.component("postAdvanced", { - templateUrl: "/mix-app/views/app-portal/pages/post/components/post-advanced/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - }; - }, - ], -}); - -app.component("postContent", { - templateUrl: "/mix-app/views/app-portal/pages/post/components/post-content/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "PostRestService", - function ($rootScope, $scope, ngAppSettings, service) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.translate = $rootScope.translate; - ctrl.relatedData = {}; - ctrl.generateSeo = function () { - if (ctrl.model) { - if (ctrl.model.seoName === null || ctrl.model.seoName === "") { - ctrl.model.seoName = $rootScope.generateKeyword( - ctrl.model.title, - "-" - ); - } - if (ctrl.model.seoTitle === null || ctrl.model.seoTitle === "") { - ctrl.model.seoTitle = ctrl.model.title; - } - if ( - ctrl.model.seoDescription === null || - ctrl.model.seoDescription === "" - ) { - ctrl.model.seoDescription = ctrl.model.excerpt; - } - if ( - ctrl.model.seoKeywords === null || - ctrl.model.seoKeywords === "" - ) { - ctrl.model.seoKeywords = ctrl.model.title; - } - } - }; - ctrl.getListRelated = async function (pageIndex) { - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - var resp = await service.getList(ctrl.request); - if (resp && resp.isSucceed) { - ctrl.relatedData = angular.copy(resp.data); - ctrl.relatedData.items = []; - angular.forEach(resp.data.items, (element) => { - var existed = $rootScope.findObjectByKey( - ctrl.model.postNavs, - ["sourceId", "destinationId"], - [ctrl.model.id, element.id] - ); - - var obj = { - description: element.title, - destinationId: element.id, - image: element.image, - isActived: existed !== null, - sourceId: ctrl.model.id, - specificulture: ctrl.model.specificulture, - status: "Published", - }; - - ctrl.relatedData.items.push(obj); - }); - console.log(ctrl.relatedData); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(getData.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, - ], -}); - - -app.component('postRelated', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/related/view.html', - controller: function () { - var ctrl = this; - ctrl.activePost = function (model) { - var currentItem = null; - $.each(ctrl.post.postNavs, function (i, e) { - if (e.relatedPostId === model.id) { - e.isActived = model.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - relatedPostId: model.id, - sourcePostId: ctrl.post.id, - specificulture: ctrl.post.specificulture, - priority: ctrl.post.postNavs.length + 1, - relatedPost: pr, - isActived: true - }; - model.isHidden = true; - ctrl.post.postNavs.push(currentItem); - } - } - }, - bindings: { - post: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('postSeo', { - templateUrl: '/mix-app/views/app-portal/pages/post/components/seo/view.html', - bindings: { - post: '=', - onDelete: '&', - onUpdate: '&' - } -}); - -app.component('serviceMain', { - templateUrl: '/mix-app/views/app-portal/pages/service/components/main/view.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.settings = $rootScope.globalSettings; - ctrl.gennerateName = function () { - if (!ctrl.model.id || ctrl.model.name === null || ctrl.model.name === '') { - ctrl.model.name = $rootScope.generateKeyword(ctrl.model.title, '_'); - } - }; - }], - bindings: { - model: '=', - } -}); - -modules.component('rolePageNav', { - templateUrl: '/mix-app/views/app-portal/pages/role/components/role-page-navigation/role-page-navigations.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', 'RoleService', function ($rootScope, $scope, ngAppSettings, roleServices) { - var ctrl = this; - ctrl.selected = null; - ctrl.updateOrders = function (index) { - ctrl.data.splice(index, 1); - for (var i = 0; i < ctrl.data.length; i++) { - ctrl.data[i].priority = i + 1; - } - }; - //ctrl.change = async function () { - // //var permission = ctrl.page.navPermission; - // //$rootScope.isBusy = true; - // //var resp = await roleServices.updatePermission(permission); - // //if (resp && resp.isSucceed) { - // // $rootScope.showMessage('Update successfully!', 'success'); - // // $rootScope.isBusy = false; - // // $scope.$apply(); - // //} - // //else { - // // if (resp) { $rootScope.showErrors(resp.errors); } - // // $rootScope.isBusy = false; - // // $scope.$apply(); - // //} - //}; - }], - bindings: { - prefix: '=', - page: '=', - callback: '&' - } -}); -app.component("themeExportMixDatabases", { - templateUrl: - "/mix-app/views/app-portal/pages/theme/components/theme-export-mix-databases/view.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.updateMixDatabaseExport = function () { - ctrl.selectedExport.mixDatabases = angular.copy( - $rootScope.filterArray( - ctrl.exportData.mixDatabases, - ["isActived"], - [true] - ) - ); - // angular.forEach(ctrl.selectedExport.mixDatabases,function(e){ - // e.data = angular.copy($rootScope.filterArray(e.data, ['isActived'], [true])); - // }); - }; - ctrl.selectAll = function (arr) { - ctrl.selectedList.data = []; - angular.forEach(arr, function (e) { - e.isActived = ctrl.selectedList.isSelectAll; - e.isExportData = ctrl.selectedList.isExportData; - }); - ctrl.updateMixDatabaseExport(); - }; - }, - ], - bindings: { - exportData: "=", - selectedExport: "=", - }, -}); - - -app.component('themeExportModules', { - templateUrl: '/mix-app/views/app-portal/pages/theme/components/theme-export-modules/view.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', function ($rootScope, $scope) { - var ctrl = this; - ctrl.updateModuleExport = function () { - ctrl.selectedExport.modules = angular.copy($rootScope.filterArray(ctrl.exportData.modules, ['isActived'], [true])); - // angular.forEach(ctrl.selectedExport.modules,function(e){ - // e.data.items = angular.copy($rootScope.filterArray(e.data.items, ['isActived'], [true])); - // }); - - - }; - ctrl.selectAll = function (arr) { - ctrl.selectedList.data = []; - angular.forEach(arr, function (e) { - e.isActived = ctrl.selectedList.isSelectAll; - e.isExportData = ctrl.selectedList.isExportData; - }); - ctrl.updateModuleExport(); - }; - }], - bindings: { - exportData: '=', - selectedExport: '=' - } -}); - -app.component('themeExportPages', { - templateUrl: '/mix-app/views/app-portal/pages/theme/components/theme-export-pages/view.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', function ($rootScope, $scope) { - var ctrl = this; - ctrl.updatePageExport = function () { - // Filter actived page - ctrl.selectedExport.pages = angular.copy($rootScope.filterArray(ctrl.exportData.pages, ['isActived'], [true])); - - // // Loop actived page - // angular.forEach(ctrl.selectedExport.pages, function (e) { - // // filter list actived modules - // e.moduleNavs = angular.copy($rootScope.filterArray(e.moduleNavs, ['isActived'], [true])); - - // // Loop actived modules - // angular.forEach(e.moduleNavs, function (n) { - // // filter list actived data - // n.module.data.items = angular.copy($rootScope.filterArray(n.module.data.items, ['isActived'], [true])); - // $rootScope.removeObjectByKey(ctrl.exportData.modules, 'id', n.moduleId); - // $rootScope.removeObjectByKey(ctrl.selectedExport.modules, 'id', n.moduleId); - // }); - // }); - - - }; - ctrl.selectAll = function (arr) { - ctrl.selectedList.data = []; - angular.forEach(arr, function (e) { - e.isActived = ctrl.selectedList.isSelectAll; - e.isExportData = ctrl.selectedList.isExportData; - }); - ctrl.updatePageExport(); - }; - }], - bindings: { - exportData: '=', - selectedExport: '=' - } -}); -var demo = { - initDashboardPageCharts: function (incomes, services) { - incomes = incomes || [50, 150, 100, 190, 130, 90, 150, 160, 120, 140, 190, 95]; - chartColor = "#eeeeee"; - // General configuration for the charts with Line gradientStroke - gradientChartOptionsConfiguration = { - maintainAspectRatio: false, - legend: { - display: false - }, - tooltips: { - bodySpacing: 4, - mode: "nearest", - intersect: 0, - position: "nearest", - xPadding: 10, - yPadding: 10, - caretPadding: 10 - }, - responsive: 1, - scales: { - yAxes: [{ - display: 0, - - ticks: { - display: false - }, - gridLines: { - zeroLineColor: "transparent", - drawTicks: false, - display: false, - drawBorder: false - } - }], - xAxes: [{ - display: 0, - - ticks: { - display: false - }, - gridLines: { - zeroLineColor: "transparent", - drawTicks: false, - display: false, - drawBorder: false - } - }] - }, - layout: { - padding: { left: 0, right: 0, top: 15, bottom: 15 } - } - }; - - gradientChartOptionsConfigurationWithNumbersAndGrid = { - maintainAspectRatio: false, - legend: { - display: false - }, - tooltips: { - bodySpacing: 4, - mode: "nearest", - intersect: 0, - position: "nearest", - xPadding: 10, - yPadding: 10, - caretPadding: 10 - }, - responsive: true, - scales: { - yAxes: [{ - - gridLines: { - zeroLineColor: "transparent", - drawBorder: false - } - }], - xAxes: [{ - display: 0, - - ticks: { - display: false - }, - gridLines: { - zeroLineColor: "transparent", - drawTicks: false, - display: false, - drawBorder: false - } - }] - }, - layout: { - padding: { left: 0, right: 0, top: 15, bottom: 15 } - } - }; - - var ctx = document.getElementById('bigDashboardChart').getContext("2d"); - - var gradientStroke = ctx.createLinearGradient(500, 0, 100, 0); - gradientStroke.addColorStop(0, '#80b6f4'); - gradientStroke.addColorStop(1, chartColor); - - var gradientFill = ctx.createLinearGradient(0, 200, 0, 50); - gradientFill.addColorStop(0, "rgba(128, 182, 244, 0)"); - gradientFill.addColorStop(1, "rgba(255, 255, 255, 0.24)"); - - var myChart = new Chart(ctx, { - type: 'bar', - data: { - labels: ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"], - datasets: [ - { - type: 'line', - label: "Incomes", - borderColor: chartColor, - pointBorderColor: chartColor, - pointBackgroundColor: "red", - pointHoverBackgroundColor: "#1e3d60", - pointHoverBorderColor: chartColor, - pointBorderWidth: 1, - pointHoverRadius: 7, - pointHoverBorderWidth: 2, - pointRadius: 5, - fill: true, - backgroundColor: gradientFill, - borderWidth: 2, - data: incomes - }, - { - label: "Services", - //borderColor: chartColor, - //pointBorderColor: chartColor, - //pointBackgroundColor: "#1e3d60", - //pointHoverBackgroundColor: "#1e3d60", - //pointHoverBorderColor: chartColor, - //pointBorderWidth: 1, - //pointHoverRadius: 7, - //pointHoverBorderWidth: 2, - //pointRadius: 5, - //fill: true, - backgroundColor: 'yellow', - //borderWidth: 2, - data: services - } - ] - }, - options: { - layout: { - padding: { - left: 20, - right: 20, - top: 0, - bottom: 0 - } - }, - maintainAspectRatio: false, - tooltips: { - backgroundColor: '#fff', - titleFontColor: '#333', - bodyFontColor: '#666', - bodySpacing: 4, - xPadding: 12, - mode: "nearest", - intersect: 0, - position: "nearest" - }, - legend: { - position: "bottom", - fillStyle: "#FFF", - display: false - }, - scales: { - yAxes: [{ - ticks: { - fontColor: "rgba(255,255,255,0.4)", - fontStyle: "bold", - beginAtZero: true, - maxTicksLimit: 5, - padding: 10 - }, - gridLines: { - drawTicks: true, - drawBorder: false, - display: true, - color: "rgba(255,255,255,0.1)", - zeroLineColor: "transparent" - } - - }], - xAxes: [{ - gridLines: { - zeroLineColor: "transparent", - display: false, - - }, - ticks: { - padding: 10, - fontColor: "rgba(255,255,255,0.4)", - fontStyle: "bold" - } - }] - } - } - }); - }, -}; - -modules.component('aceEditor', { - templateUrl: '/mix-app/views/app-portal/components/ace-editor/ace-editor.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', - function ($rootScope, $scope, ngAppSettings) { - var ctrl = this; - ctrl.previousId = null; - ctrl.editor = null; - ctrl.id = Math.floor(Math.random() * 100) + 1; - ctrl.$onChanges = (changes) => { - if (changes.content) { - ctrl.updateEditors(); - } - }; - - this.$doCheck = function () { - if (ctrl.previousId != null && ctrl.previousId !== ctrl.contentId) { - ctrl.previousId = ctrl.contentId; - ctrl.updateEditors(); - } - }.bind(this); - ctrl.initAce = function () { - setTimeout(() => { - ctrl.previousId = ctrl.contentId; - ctrl.updateEditors(); - $scope.$apply(); - }, 200); - - }; - ctrl.updateContent = function (content) { - ctrl.editor.setValue(content); - }; - ctrl.updateEditors = function () { - $.each($('#code-editor-' + ctrl.id), function (i, e) { - //var container = $(this); - ace.require("ace/ext/language_tools"); - if (e) { - var editor = ace.edit(e); - switch (ctrl.ext) { - case '.json': - editor.session.setMode("ace/mode/json"); - break; - case '.js': - editor.session.setMode("ace/mode/javascript"); - break; - case '.css': - editor.session.setMode("ace/mode/css"); - break; - case '.cshtml': - editor.session.setMode("ace/mode/razor"); - break; - case '.cs': - editor.session.setMode("ace/mode/csharp"); - break; - default: - editor.session.setMode("ace/mode/razor"); - break; - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - if (ctrl.content) { - editor.setValue(ctrl.content); - } - editor.$blockScrolling = Infinity; - editor.session.setUseWrapMode(true); - editor.setOptions({ - enableBasicAutocompletion: true, - enableSnippets: true, - enableLiveAutocompletion: false, - maxLines: 50, - fontSize: 11 - }); - editor.getSession().on('change', function (e) { - // e.type, etc - ctrl.content = editor.getValue(); - }); - editor.getSession().on('paste', function (e) { - // e.type, etc - ctrl.content = editor.getValue(); - }); - editor.commands.addCommand({ - name: 'saveFile', - bindKey: { - win: 'Ctrl-S', - mac: 'Command-S', - sender: 'editor|cli' - }, - exec: function (env, args, request) { - - var btn = document.getElementById('btnToSubmit'); - btn.click(); - } - }); - ctrl.editor = editor; - } - }); - }; - } - ], - bindings: { - content: '=', - contentId: '=', - ext: '=' - } -}); -modules.component("actions", { - templateUrl: "/mix-app/views/app-portal/components/actions/actions.html", - controller: [ - "$rootScope", - "$scope", - "$location", - function ($rootScope, $scope, $location) { - var ctrl = this; - ctrl.visible = $rootScope.visible; - ctrl.back = function () { - ctrl.backUrl = ctrl.backUrl || "/admin"; - $location.url(ctrl.backUrl); - }; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - }; - ctrl.clearCache = function () { - ctrl.onClearCache(); - }; - }, - ], - bindings: { - previewUrl: "=", - backUrl: "=", - contentUrl: "=", - onClearCache: "&?", - }, -}); - -modules.component("additionalField", { - templateUrl: "/mix-app/views/app-portal/components/additional-field/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - function ($rootScope, $scope, fieldService) { - var ctrl = this; - ctrl.value = {}; - ctrl.field = { - dataType: "Text", - mixDatabaseName: "sys_additional_field", - mixDatabaseId: 6, - }; - ctrl.selectedCol = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { }; - ctrl.addAttr = async function () { - if (ctrl.field.name) { - var current = $rootScope.findObjectByKey( - ctrl.additionalData.fields, - "name", - ctrl.field.name - ); - if (current) { - $rootScope.showErrors(["Field " + ctrl.field.name + " existed!"]); - } else { - ctrl.field.priority = ctrl.additionalData.fields.length + 1; - $rootScope.isBusy = true; - var saveField = await fieldService.create(ctrl.field); - $rootScope.isBusy = false; - if (saveField.isSucceed) { - ctrl.additionalData.fields.push(saveField.data); - - //reset field option - ctrl.field.title = ""; - ctrl.field.name = ""; - ctrl.field.dataType = "Text"; - $scope.$apply(); - } - } - } else { - $rootScope.showErrors(["Please add column Name"]); - } - }; - - ctrl.generateName = function (col) { - col.name = $rootScope.generateKeyword(col.title, "_"); - }; - ctrl.showReferences = function (col) { - ctrl.colRef = col; - $("#modal-navs").modal("show"); - }; - ctrl.referenceCallback = function (selected) { - if (selected && selected.length) { - ctrl.colRef.reference = selected; - ctrl.colRef.referenceId = selected[0].id; - } - $("#modal-navs").modal("hide"); - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.fields.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.fields.splice(ctrl.dragStartIndex + 1, 1); - } - angular.forEach(ctrl.fields, function (e, i) { - e.priority = i; - }); - }; - - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - }; - - ctrl.removeAttribute = function (val, index) { - $rootScope.showConfirm( - ctrl, - "removeAttributeConfirmed", - [val, index], - null, - "Remove Field", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeAttributeConfirmed = async function (val, index) { - if (val.id) { - $rootScope.isBusy = true; - var result = await fieldService.delete([val.id]); - if (result.isSucceed) { - ctrl.additionalData.fields.splice(index, 1); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - ctrl.additionalData.fields.splice(index, 1); - } - }; - }, - ], - }); - -modules.component("additionalValue", { - templateUrl: - "/mix-app/views/app-portal/components/additional-value/view.html", - bindings: { - additionalData: "=?", - additionalDataId: "=?", - parentType: "=?", - parentId: "=?", - databaseName: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseDataValuePortalService", - function ($rootScope, $scope, dataService, valueService) { - var ctrl = this; - ctrl.value = {}; - ctrl.field = { dataType: "Text" }; - ctrl.selectedCol = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - if (!ctrl.additionalData) { - if (!ctrl.additionalDataId) { - const obj = { - parentType: ctrl.parentType, - parentId: ctrl.parentId, - databaseName: ctrl.databaseName, - }; - const getData = await dataService.getAdditionalData(obj); - if (getData.isSucceed) { - ctrl.additionalData = getData.data; - ctrl.additionalData.mixDatabaseName = ctrl.databaseName; - ctrl.additionalData.parentType = ctrl.parentType; - ctrl.additionalData.parentId = ctrl.parentId; - $scope.$apply(); - } else { - $rootScope.showErrors(getData.errors); - } - } else { - var getData = await dataService.getSingle([ctrl.additionalDataId]); - ctrl.additionalData = getData.data; - $scope.$apply(); - } - } - }; - }, - ], -}); - -modules.component("customImage", { - templateUrl: "/mix-app/views/app-portal/components/custom-image/custom-image.html", - bindings: { - header: "=?", - description: "=?", - src: "=", - srcUrl: "=", - w: "=?", - h: "=?", - rto: "=?", - postedFile: "=?", - type: "=?", - folder: "=?", - auto: "=", - onDelete: "&?", - onUpdate: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "$uibModal", - "ngAppSettings", - "MediaService", - function ($rootScope, $scope, $uibModal, ngAppSettings, mediaService) { - var ctrl = this; - ctrl.isAdmin = $rootScope.isAdmin; - var image_placeholder = "/mix-app/assets/img/image_placeholder.jpg"; - ctrl.isImage = false; - ctrl.croppedStream = null; - ctrl.mediaNavs = []; - ctrl.options = {}; - ctrl.$onInit = function () { - ctrl.srcUrl = ctrl.srcUrl || image_placeholder; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - ctrl.id = Math.floor(Math.random() * 100); - }; - ctrl.calImageSize = function () { - if (ctrl.w) { - ctrl.h = ctrl.h || ctrl.w / ctrl.rto; - ctrl.rto = ctrl.rto || ctrl.w / ctrl.h; - } - if (ctrl.h) { - ctrl.w = ctrl.w || ctrl.h * ctrl.rto; - ctrl.rto = ctrl.rto || ctrl.w / ctrl.h; - } - - ctrl.maxHeight = ctrl.maxHeight || "200px"; - ctrl.options = { - boundary: { width: 150 * ctrl.rto, height: 150 }, - render: { width: 1000 * ctrl.rto, height: 1000 }, - output: { width: ctrl.w, height: ctrl.h }, - }; - }; - ctrl.openCroppie = function (file) { - const w = parseInt(ctrl.w); - const h = parseInt(ctrl.h); - const rto = ctrl.w / ctrl.h; - - var modalInstance = $uibModal.open({ - animation: true, - windowClass: "show", - templateUrl: "/mix-app/views/app-shared/components/modal-croppie/croppie.html", - controller: "ModalCroppieController", - controllerAs: "$ctrl", - size: "lg", - resolve: { - mediaService: mediaService, - file: function () { - return file; - }, - w, - h, - rto, - }, - }); - - modalInstance.result.then( - function (result) { - ctrl.srcUrl = result.fullPath; - }, - function () { } - ); - }; - - ctrl.mediaFile = { - file: null, - fullPath: "", - folder: ctrl.folder, - title: ctrl.title, - description: ctrl.description, - }; - ctrl.media = {}; - ctrl.$doCheck = function () { - if (ctrl.src !== ctrl.srcUrl && ctrl.srcUrl != image_placeholder) { - ctrl.src = ctrl.srcUrl; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - } - }.bind(ctrl); - - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.mediaFile.folder = ctrl.folder ? ctrl.folder : "Media"; - ctrl.mediaFile.title = ctrl.title ? ctrl.title : ""; - ctrl.mediaFile.description = ctrl.description ? ctrl.description : ""; - ctrl.mediaFile.file = file; - if (ctrl.w || ctrl.h || ctrl.rto) { - ctrl.openCroppie(file); - } else { - if (ctrl.auto == "true") { - ctrl.uploadFile(file); - } else { - ctrl.getBase64(file); - } - } - } - }; - - ctrl.uploadFile = async function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = async function () { - var getMedia = await mediaService.getSingle(["portal"]); - if (getMedia.isSucceed) { - ctrl.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.mediaFile.fileStream = reader.result; - var media = getMedia.data; - media.title = ctrl.title; - media.description = ctrl.description; - media.mediaFile = ctrl.mediaFile; - var resp = await mediaService.save(media); - if (resp && resp.isSucceed) { - ctrl.src = resp.data.fullPath; - ctrl.srcUrl = resp.data.fullPath; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - reader.onerror = function (error) { }; - } else { - return null; - } - }; - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - var index = reader.result.indexOf(",") + 1; - var base64 = reader.result.substring(index); - if (ctrl.postedFile) { - ctrl.postedFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.postedFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.postedFile.fileStream = reader.result; - } - ctrl.srcUrl = reader.result; - ctrl.isImage = - ctrl.srcUrl.indexOf("data:image/") >= 0 || - ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - ctrl.src = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - }, - ], -}); - -modules.component('confirm', { - templateUrl: '/mix-app/views/app-portal/components/confirm/confirm.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', function ($rootScope, $scope) { - var ctrl = this; - ctrl.executeFunctionByName = async function (functionName, args, context) { - var result = await $rootScope.executeFunctionByName(functionName, args, context); - if (result) { - $scope.$apply(); - } - } - }], - bindings: { - message: '=' - } -}); - -modules.component('filterList', { - templateUrl: '/mix-app/views/app-portal/components/filter-list/filter-list.html', - controller: ['$scope', '$rootScope', 'ngAppSettings', function ($scope, $rootScope, ngAppSettings) { - var ctrl = this; - ctrl.dateRange = { - fromDate: null, - toDate: null - }; - ctrl.init = function () { - if (!ctrl.orders) { - ctrl.orders = ngAppSettings.orders; - } - ctrl.directions = ngAppSettings.directions; - ctrl.pageSizes = ngAppSettings.pageSizes; - ctrl.statuses = []; - var statuses = ngAppSettings.contentStatuses; - if (ctrl.request && ctrl.request.contentStatuses) { - statuses = ctrl.request.contentStatuses; - } - angular.forEach(statuses, function (val, i) { - ctrl.statuses.push({ - value: val, - title: val - }); - }); - - }; - ctrl.updateDate = function () { - if (Date.parse(ctrl.dateRange.fromDate)) { - ctrl.request.fromDate = new Date(ctrl.dateRange.fromDate).toISOString(); - } - else { - $scope.request.fromDate = null; - } - if (Date.parse(ctrl.dateRange.toDate)) { - ctrl.request.toDate = new Date(ctrl.dateRange.toDate).toISOString(); - } - else { - ctrl.request.toDate = null; - } - ctrl.callback({ pageIndex: 0 }); - }; - }], - bindings: { - request: '=', - orders: '=?', - createUrl: '=', - createText: '=', - callback: '&' - } -}); -modules.component('funding', { - templateUrl: '/mix-app/views/app-portal/components/funding/view.html', - controller: [ - '$rootScope', '$http', - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = [ - { - "title": "opencollective.com/mixcore", - "href": "https://opencollective.com/mixcore", - "logo": "https://github.githubassets.com/images/modules/site/icons/funding_platforms/open_collective.svg" - }, - { - "title": "funding.communitybridge.org/projects/mixcore", - "href": "https://crowdfunding.lfx.linuxfoundation.org/projects/mixcore", - "logo": "https://github.githubassets.com/images/modules/site/icons/funding_platforms/community_bridge.svg" - }, - { - "title": "patreon.com/mixcore", - "href": "https://www.patreon.com/mixcore/creators", - "logo": "https://github.githubassets.com/images/modules/site/icons/funding_platforms/patreon.svg" - }, - { - "title": "paypalme/mixcore", - "href": "https://www.paypal.me/mixcore", - "logo": "/mix-app/assets/img/svg/heart.svg" - }, - { - "title": "buymeacoffee.com/mixcore", - "href": "https://www.buymeacoffee.com/mixcore", - "logo": "/mix-app/assets/img/svg/heart.svg" - }, - ]; - ctrl.init = function () { - }; - - } - ], - bindings: { - } -}); -modules.component('githubContributers', { - templateUrl: '/mix-app/views/app-portal/components/github-contributers/view.html', - controller: [ - '$rootScope', '$http', - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var req = { - method: 'GET', - url: 'https://api.github.com/repos/mixcore/mix.core/contributors' - }; - ctrl.getGithubApiResult(req); - }; - - ctrl.getGithubApiResult = async function (req) { - return $http(req).then(function (resp) { - if (resp.status == '200') { - ctrl.items = resp.data; - } - else { - - } - }, - function (error) { - return { isSucceed: false, errors: [error.statusText || error.status] }; - }); - }; - } - ], - bindings: { - } -}); -modules.component('githubReleases', { - templateUrl: '/mix-app/views/app-portal/components/github-releases/view.html', - controller: [ - '$rootScope', '$http', - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var req = { - method: 'GET', - url: 'https://api.github.com/repos/mixcore/mix.core/releases' - }; - ctrl.getGithubApiResult(req); - }; - - ctrl.getGithubApiResult = async function (req) { - return $http(req).then(function (resp) { - if (resp.status == '200') { - ctrl.items = resp.data; - } - else { - } - }, - function (error) { - return { isSucceed: false, errors: [error.statusText || error.status] }; - }); - }; - } - ], - bindings: { - } -}); -modules.component("googleAnalytic", { - templateUrl: "/mix-app/views/app-portal/components/google-analytic/view.html", - bindings: { - }, - controller: [ - "$rootScope", - "CommonService", - function ($rootScope, commonService) { - var ctrl = this; - ctrl.init = function () { - if (gapi) { - gapi.analytics.ready(function () { - if ($rootScope.settings.data.Google_Client_Id) { - /** - * Authorize the user immediately if the user has already granted access. - * If no access has been created, render an authorize button inside the - * element with the ID "embed-api-auth-container". - */ - gapi.analytics.auth.authorize({ - container: "embed-api-auth-container", - //REPLACE WITH YOUR CLIENT ID - clientid: $rootScope.settings.data.Google_Client_Id, - }); - - /** - * Create a ViewSelector for the first view to be rendered inside of an - * element with the id "view-selector-1-container". - */ - var viewSelector1 = new gapi.analytics.ViewSelector({ - container: "view-selector-1-container", - }); - - /** - * Create a ViewSelector for the second view to be rendered inside of an - * element with the id "view-selector-2-container". - */ - var viewSelector2 = new gapi.analytics.ViewSelector({ - container: "view-selector-2-container", - }); - - /** - * Create a new ActiveUsers instance to be rendered inside of an - * element with the id "active-users-container" and poll for changes every - * five seconds. - */ - var activeUsers = new gapi.analytics.ext.ActiveUsers({ - container: "active-users-container", - pollingInterval: 5, - }); - /** - * Add CSS animation to visually show the when users come and go. - */ - activeUsers.once("success", function () { - var element = this.container.firstChild; - var timeout; - - this.on("change", function (data) { - var element = this.container.firstChild; - var animationClass = - data.delta > 0 ? "is-increasing" : "is-decreasing"; - element.className += " " + animationClass; - - clearTimeout(timeout); - timeout = setTimeout(function () { - element.className = element.className.replace( - / is-(increasing|decreasing)/g, - "" - ); - }, 3000); - }); - }); - - /** - * Create a ViewSelector for the second view to be rendered inside of an - * element with the id "view-selector-2-container". - */ - var viewSelector2 = new gapi.analytics.ViewSelector({ - container: "view-selector-2-container", - }); - - // Render both view selectors to the page. - // viewSelector1.execute(); - // viewSelector2.execute(); - - /** - * Create the first DataChart for top countries over the past 30 days. - * It will be rendered inside an element with the id "chart-1-container". - */ - var dataChart1 = new gapi.analytics.googleCharts.DataChart({ - query: { - // ids: $rootScope.settings.data.Google_Analytic_Ids, - metrics: "ga:sessions", - dimensions: "ga:date", - "start-date": "30daysAgo", - "end-date": "yesterday", - }, - chart: { - container: "chart-1-container", - type: "LINE", - options: { - width: "95%", - legendTextStyle: { color: "#333" }, - titleTextStyle: { color: "#333" }, - backgroundColor: { fill: "transparent" }, - hAxis: { - textStyle: { color: "#333" }, - }, - vAxis: { - textStyle: { color: "#333" }, - }, - series: { - 0: { - color: - $rootScope.globalSettings.portalThemeSettings - .primaryColor, - }, - 1: { color: "#e7711b" }, - 2: { color: "#f1ca3a" }, - 3: { color: "#6f9654" }, - 4: { color: "#1c91c0" }, - 5: { color: "#43459d" }, - }, - }, - }, - }); - - /** - * Create the second DataChart for top countries over the past 30 days. - * It will be rendered inside an element with the id "chart-2-container". - */ - var dataChart2 = new gapi.analytics.googleCharts.DataChart({ - query: { - // ids: $rootScope.settings.data.Google_Analytic_Ids, - metrics: "ga:sessions", - dimensions: "ga:country", - "start-date": "90daysAgo", - "end-date": "yesterday", - "max-results": 6, - sort: "-ga:sessions", - }, - chart: { - container: "chart-2-container", - type: "GEO", - options: { - width: "95%", - pieHole: 4 / 9, - }, - }, - }); - - dataChart1 - .set({ - query: { ids: $rootScope.settings.data.Google_Analytic_Ids }, - }) - .execute(); - dataChart2 - .set({ - query: { ids: $rootScope.settings.data.Google_Analytic_Ids }, - }) - .execute(); - activeUsers - .set({ ids: $rootScope.settings.data.Google_Analytic_Ids }) - .execute(); - - // /** - // * Update the first dataChart when the first view selecter is changed. - // */ - // viewSelector1.on('change', function (ids) { - // dataChart1.set({ query: { ids: ids } }).execute(); - // // Start tracking active users for this view. - // activeUsers.set({ ids: ids }).execute(); - // }); - - // /** - // * Update the first dataChart when the first view selecter is changed. - // */ - // viewSelector2.on('change', function (ids) { - // dataChart2.set({ query: { ids: ids } }).execute(); - // // Start tracking active users for this view. - // activeUsers.set({ ids: ids }).execute(); - // }); - - // /** - // * Update the second dataChart when the second view selecter is changed. - // */ - // viewSelector2.on('change', function (ids) { - // dataChart2.set({ query: { ids: ids } }).execute(); - // }); - } - }); - } - }; - }, - ] -}); - -(function (angular) { - app.component("headerNav", { - templateUrl: "/mix-app/views/app-portal/components/header-nav/headerNav.html", - controller: [ - "$rootScope", - "$location", - "CommonService", - "AuthService", - "TranslatorService", - "GlobalSettingsService", - function ( - $rootScope, - $location, - commonService, - authService, - translatorService, - globalSettingsService - ) { - var ctrl = this; - ctrl.globalSettings = $rootScope.globalSettings; - if (authService.authentication) { - ctrl.avatar = authService.authentication.avatar; - } - this.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - ctrl.settings = $rootScope.settings; - ctrl.settings.cultures = $rootScope.globalSettings.cultures; - }; - ctrl.translate = $rootScope.translate; - ctrl.getConfiguration = function (keyword, isWrap, defaultText) { - return $rootScope.getConfiguration(keyword, isWrap, defaultText); - }; - ctrl.changeLang = function (lang, langIcon) { - ctrl.settings.lang = lang; - ctrl.settings.langIcon = langIcon; - commonService.fillAllSettings(lang).then(function () { - window.top.location = location.href; - }); - }; - ctrl.logOut = function () { - $rootScope.logOut(); - window.top.location = "/security/login"; - }; - ctrl.addPermission = function () { - $("#dlg-permission").modal("show"); - }; - ctrl.addBookmark = function () { - $("#dlg-bookmark").modal("show"); - }; - ctrl.toggleSidebar = function () { - $(".main-sidebar").toggle(); - $(".sub-sidebar").toggle(); - // $('.navbar-brand').toggle(); - }; - ctrl.showHelper = function (url) { - $rootScope.helperUrl = url; - $("#dev-helper-modal").modal("show"); - }; - ctrl.generateSitemap = async function () { - $rootScope.isBusy = true; - var resp = await commonService.genrateSitemap(); - if (resp) { - window.top.location.href = - "/portal/file/details?folder=" + - resp.fileFolder + - "&filename=" + - resp.fileName + - resp.extension; - } else { - $rootScope.isBusy = false; - $rootScope.showErrors(["Server error"]); - } - }; - }, - ], - bindings: { - breadCrumbs: "=", - settings: "=", - }, - }); -})(window.angular); - - -modules.component('hubMessages', { - templateUrl: '/mix-app/views/app-portal/components/hub-messages/hub-messages.html', - controller: 'HubMessagesController', - bindings: { - - } -}); -app.controller('HubMessagesController', ['$scope', function ($scope) { - BaseHub.call(this, $scope); - $scope.init = function () { - // $scope.startConnection('portalhub'); - }; -}]); - - -modules.component('jsonBuilder', { - templateUrl: '/mix-app/views/app-portal/components/json-builder/view.html', - bindings: { - 'data': '=?', // json obj (ex: { field1: 'some val' }) - 'folder': '=?', // filepath (ex: 'data/jsonfile.json') - 'filename': '=?', // filepath (ex: 'data/jsonfile.json') - 'allowedTypes': '=?', // string array ( ex: [ 'type1', 'type2' ] ) - 'backUrl': '=?', // string array ( ex: [ 'type1', 'type2' ] ) - 'save': '&', - 'onUpdate': '&' - }, - controller: ['$rootScope', '$scope', '$location', 'FileServices', 'ngAppSettings', - function ($rootScope, $scope, $location, fileService, ngAppSettings) { - var ctrl = this; - ctrl.file = null; - ctrl.translate = $rootScope.translate; - ctrl.settings = $rootScope.globalSettings; - ctrl.timestamp = Math.random(); - ctrl.templates = [ - { type: 'item', name: 'i1', dataType: 7, value: '' }, - { type: 'object', name: 'o1', columns: [{ allowedTypes: ['array', 'object', 'item'], items: [] }] }, - { type: 'array', name: 'a1', columns: [{ allowedTypes: ['object'], items: [] }] } - ]; - ctrl.draft = []; - ctrl.model = {}; - ctrl.dropzones = { - 'root': [] - }; - ctrl.selected = null; - ctrl.selectedModel = {}; - ctrl.strModel = null; - ctrl.init = async function () { - var arr = []; - if (!ctrl.data && ctrl.filename) { - await ctrl.loadFile(); - ctrl.parseObjToList(ctrl.data, arr); - ctrl.dropzones.root = arr; - } else { - ctrl.parseObjToList(ctrl.data, arr); - ctrl.dropzones.root = arr; - } - - }; - ctrl.loadFile = async function () { - $rootScope.isBusy = true; - $scope.listUrl = '/portal/json-data/list?folder=' + ctrl.folder; - - var response = await fileService.getFile(ctrl.folder, ctrl.filename); - if (response.isSucceed) { - ctrl.file = response.data; - ctrl.data = $.parseJSON(response.data.content); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.saveFile = async function () { - $rootScope.isBusy = true; - ctrl.model = {}; - ctrl.update(); - if (ctrl.save) { - ctrl.save({ data: ctrl.model }); - } - else { - // ctrl.parseObj(ctrl.dropzones.root, ctrl.model); - ctrl.file.content = JSON.stringify(ctrl.model); - var resp = await fileService.saveFile(ctrl.file); - if (resp && resp.isSucceed) { - $scope.activedFile = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.select(ctrl.selected); - - }; - ctrl.update = function () { - ctrl.model = {}; - var obj = { - type: 'object', - name: 'data', - columns: [ - { - items: ctrl.dropzones.root - } - ] - }; - ctrl.parseObj(obj, ctrl.model); - ctrl.onUpdate({ data: ctrl.model }); - }; - ctrl.parseObjToList = function (item, items) { - // key: the name of the object key - // index: the ordinal position of the key within the object - Object.keys(item).forEach(function (key, index) { - var obj = {}; - var objType = typeof (item[key]); - switch (objType) { - case 'object': - if (Array.isArray(item[key])) { - obj = angular.copy(ctrl.templates[2]); - obj.name = key; - ctrl.parseObjToList(item[key], obj.columns[0].items); - items.push(obj); - } else { - obj = angular.copy(ctrl.templates[1]); - obj.name = key; - ctrl.parseObjToList(item[key], obj.columns[0].items); - items.push(obj); - } - break; - default: - obj = angular.copy(ctrl.templates[0]); - obj.name = key; - obj.value = item[key]; - items.push(obj); - break; - } - - }); - }; - ctrl.parseObj = function (item, obj, name) { - switch (item.type) { - case 'array': - obj[item.name] = []; - angular.forEach(item.columns[0].items, sub => { - var o = {}; - ctrl.parseObj(sub, o); - obj[item.name].push(o); - }); - break; - case 'object': - angular.forEach(item.columns[0].items, sub => { - if (sub.type == 'object') { - var o = {}; - ctrl.parseObj(sub, o); - obj[item.name] = (o); - } - else { - ctrl.parseObj(sub, obj, item.name); - } - }); - break; - case 'item': - obj[item.name] = item.value; - break; - } - }; - ctrl.select = function (item) { - if (ctrl.selected == item) { - ctrl.parseObj(item, ctrl.selectedModel); - } - else { - ctrl.selected = item; - ctrl.selectedModel = {}; - ctrl.parseObj(item, ctrl.selectedModel); - } - ctrl.timestamp = Math.random(); - }; - ctrl.addField = function (item) { - var field = angular.copy(ctrl.templates[0]); - field.name = 'f' + (item.columns[0].items.length + 1); - item.columns[0].items.push(field); - item.showMenu = false; - }; - ctrl.addObj = function (item) { - var obj = angular.copy(ctrl.templates[1]); - obj.name = 'o' + (item.columns[0].items.length + 1); - item.columns[0].items.push(obj); - item.showMenu = false; - ctrl.update(); - }; - ctrl.addArray = function (item) { - var obj = angular.copy(ctrl.templates[2]); - obj.name = 'a' + (item.columns[0].items.length + 1); - item.columns[0].items.push(obj); - item.showMenu = false; - ctrl.update(); - }; - ctrl.clone = function (item, list) { - var obj = angular.copy(item); - obj.name = item.name + '_copy'; - item.showMenu = false; - obj.showMenu = false; - list.items.push(obj); - ctrl.update(); - }; - - ctrl.remove = function (index, list) { - if (confirm('Remove this')) { - list.items.splice(index, 1); - ctrl.update(); - } - }; - - }] -}); - -modules.component('jumbotrons', { - templateUrl: '/mix-app/views/app-portal/components/jumbotrons/jumbotrons.html', - controller: ['$rootScope', '$scope', '$location', function ($rootScope, $scope, $location) { - var ctrl = this; - ctrl.translate = function (keyword) { - return $rootScope.translate(keyword); - }; - // ctrl.back = function () { - // ctrl.backUrl = ctrl.backUrl || '/admin'; - // $location.path(ctrl.backUrl); - // }; - }], - bindings: { - tagName: '=', - tagType: '=', - } -}); -modules.component("listMixColumn", { - templateUrl: "/mix-app/views/app-portal/components/list-mix-column/view.html", - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - function ($rootScope, $scope, service) { - var ctrl = this; - ctrl.selectedCol = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - var getDefaultAttr = await service.getDefault(); - if (getDefaultAttr.isSucceed) { - ctrl.defaultAttr = getDefaultAttr.data; - ctrl.defaultAttr.options = []; - } - }; - ctrl.addAttr = function () { - if (ctrl.fields) { - var t = angular.copy(ctrl.defaultAttr); - t.priority = ctrl.fields.length + 1; - ctrl.fields.push(t); - } - }; - ctrl.removeAttribute = async function (attr, index) { - if (confirm("Remove this field ?")) { - if (attr.id) { - $rootScope.isBusy = true; - var remove = await service.delete([attr.id]); - if (remove.isSucceed) { - ctrl.fields.splice(index, 1); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - ctrl.fields.splice(index, 1); - } - } - }; - ctrl.addOption = function (col, index) { - var val = $("#option_" + index).val(); - col.options = col.options || []; - var opt = { - value: val, - dataType: 7, - }; - col.options.push(opt); - $("#option_" + index).val(""); - }; - ctrl.generateForm = function () { - var formHtml = document.createElement("module-form"); - formHtml.setAttribute("class", "row"); - angular.forEach(ctrl.viewModel.attributes, function (e, i) { - var el; - var label = document.createElement("label"); - label.setAttribute("class", "form-label"); - label.setAttribute("ng-bind", "{{data.title}}"); - - switch (e.dataType) { - case "datetime": - el = document.createElement("input"); - el.setAttribute("type", "datetime-local"); - break; - - case "date": - el = document.createElement("input"); - el.setAttribute("type", "date"); - break; - - case "time": - el = document.createElement("input"); - el.setAttribute("type", "time"); - break; - - case "phonenumber": - el = document.createElement("input"); - el.setAttribute("type", "tel"); - break; - - case "number": - el = document.createElement("input"); - el.setAttribute("type", "number"); - break; - - case "html": - el = document.createElement("trumbowyg"); - el.setAttribute("options", "{}"); - el.setAttribute("type", "number"); - break; - - case "textarea": - el = document.createElement("textarea"); - break; - - default: - el = document.createElement("input"); - el.setAttribute("type", "text"); - formHtml.appendChild(el); - break; - } - el.setAttribute("ng-model", "data.jItem[" + e.name + "].value"); - el.setAttribute("placeholder", "{{$ctrl.title}}"); - formHtml.appendChild(label); - formHtml.appendChild(el); - }); - ctrl.viewModel.formView.content = formHtml.innerHTML; - }; - - ctrl.generateName = function (col) { - col.name = $rootScope.generateKeyword(col.title, "_"); - }; - ctrl.removeAttr = function (index) { - if (ctrl.fields) { - ctrl.fields.splice(index, 1); - } - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.fields.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.fields.splice(ctrl.dragStartIndex + 1, 1); - } - angular.forEach(ctrl.fields, function (e, i) { - e.priority = i; - }); - }; - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - }; - ctrl.showReferences = function (col) { - ctrl.colRef = col; - $("#modal-navs").modal("show"); - }; - ctrl.referenceCallback = function (selected) { - if (selected && selected.length) { - ctrl.colRef.reference = selected; - ctrl.colRef.referenceId = selected[0].id; - } - $("#modal-navs").modal("hide"); - }; - }, - ], - bindings: { - header: "=", - fields: "=", - removeAttributes: "=", - }, -}); - -modules.component('mainSideBar', { - templateUrl: '/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', 'TranslatorService', 'CommonService', - function ($rootScope, $scope, ngAppSettings, translatorService, commonService) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var routes = $.parseJSON($('#portal-menus').val()); - ctrl.items = routes.data; - }; - }], - bindings: { - } -}); - -modules.component("mainSideBarDynamic", { - templateUrl: - "/mix-app/views/app-portal/components/main-side-bar-dynamic/main-side-bar-dynamic.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RoleService", - "TranslatorService", - "AuthService", - function ( - $rootScope, - $scope, - ngAppSettings, - roleServices, - translatorService, - authService - ) { - var ctrl = this; - ctrl.init = function () { - roleServices.getPermissions().then(function (response) { - if (response && response.isSucceed) { - ctrl.isInit = true; - ctrl.roles = response.data; - if (ctrl.roles) { - ctrl.role = ctrl.roles[0]; - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - }; - }, - ], - bindings: { - roles: "=", - activedRole: "=", - translate: "&", - }, -}); - - -modules.component('mainSideBarItem', { - templateUrl: '/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.addClass = function (obj) { - obj.currentTarget.classList.add('btn-group-lg'); - //alert(obj); - } - ctrl.removeClass = function (obj) { - obj.currentTarget.classList.remove('btn-group-lg'); - //alert(obj); - } - }], - bindings: { - item: '=', - } -}); - -modules.component('mainSideBarItemDynamic', { - templateUrl: '/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - }], - bindings: { - iconSize: '=', - linkStyle: '=', - itemStyle: '=', - item: '=' - } -}); -modules.component("mediaFileUpload", { - templateUrl: "/mix-app/views/app-portal/components/media-file-upload/view.html", - bindings: { - header: "=?", - description: "=?", - src: "=", - srcUrl: "=", - mediaFile: "=", - formFile: "=", - type: "=?", - folder: "=?", - auto: "=", - acceptTypes: "=?", - onDelete: "&?", - onUpdate: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "MediaService", - function ($rootScope, $scope, ngAppSettings, mediaService) { - var ctrl = this; - ctrl.isAdmin = $rootScope.isAdmin; - var image_placeholder = "/mix-app/assets/img/image_placeholder.jpg"; - ctrl.isImage = false; - ctrl.mediaNavs = []; - ctrl.$onInit = function () { - ctrl.srcUrl = ctrl.srcUrl || image_placeholder; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - ctrl.maxHeight = ctrl.maxHeight || "200px"; - ctrl.id = Math.floor(Math.random() * 100); - }; - ctrl.$doCheck = function () { - if (ctrl.src !== ctrl.srcUrl && ctrl.srcUrl != image_placeholder) { - ctrl.src = ctrl.srcUrl; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - } - }.bind(ctrl); - - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.mediaFile.folder = ctrl.folder ? ctrl.folder : "Media"; - ctrl.mediaFile.title = ctrl.title ? ctrl.title : ""; - ctrl.mediaFile.description = ctrl.description ? ctrl.description : ""; - ctrl.mediaFile.file = file; - ctrl.formFile = file; - if (ctrl.auto == "true") { - ctrl.uploadFile(file); - } else { - ctrl.srcUrl = null; - ctrl.src = null; - ctrl.isImage = file.name.match( - /([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g - ); - if (ctrl.isImage) { - ctrl.getBase64(file); - } - } - } - }; - - ctrl.uploadFile = async function (file) { - if (file !== null) { - $rootScope.isBusy = true; - if (ctrl.mediaFile) { - var response = await mediaService.uploadMedia(ctrl.mediaFile, file); - if (response.isSucceed) { - ctrl.media = response.data; - $rootScope.isBusy = false; - ctrl.srcUrl = response.data.filePath; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } else { - return null; - } - }; - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - if (ctrl.mediaFile) { - ctrl.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.mediaFile.fileStream = reader.result; - } - ctrl.srcUrl = reader.result; - ctrl.isImage = - ctrl.srcUrl.indexOf("data:image/") >= 0 || - ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - ctrl.src = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - }, - ], -}); - - -modules.component('mediaUpload', { - templateUrl: '/mix-app/views/app-portal/components/media-upload/media-upload.html', - controller: ['$scope', '$rootScope', 'MediaService', 'CommonService', - function ($scope, $rootScope, service, commonService) { - var ctrl = this; - ctrl.viewModel = { - title: '', - description: '', - status: 'Published', - mediaFile: { - file: null, - fullPath: '', - folderName: 'Media', - fileFolder: '', - fileName: '', - extension: '', - content: '', - fileStream: '' - } - }; - ctrl.save = async function (data) { - $rootScope.isBusy = true; - var resp = await service.save(data); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - if (ctrl.onUpdate) { - ctrl.onUpdate(); - } - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }], - bindings: { - 'onUpdate': '&' - } -}); -modules.component('mediumNews', { - templateUrl: '/mix-app/views/app-portal/components/medium-news/view.html', - controller: [ - '$rootScope', '$http', - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var req = { - method: 'GET', - url: 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/mixcore?t=' + Math.floor(Date.now() / 1000) - }; - ctrl.getMediumApiResult(req); - }; - - ctrl.getMediumApiResult = async function (req) { - return $http(req).then(function (resp) { - if (resp.status == '200') { - ctrl.items = resp.data.items; - } - else { - console.log(resp); - - } - }, - function (error) { - return { isSucceed: false, errors: [error.statusText || error.status] }; - }); - }; - } - ], - bindings: { - } -}); -modules.component("mixDatabaseColumn", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-column/view.html", - bindings: { - column: "=" - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - function ($rootScope, $scope, fieldService) { - var ctrl = this; - ctrl.value = {}; - ctrl.field = { - dataType: "Text", - mixDatabaseName: "sys_additional_field", - mixDatabaseId: 6, - }; - ctrl.selectedCol = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () {}; - ctrl.addAttr = async function () { - if (ctrl.field.name) { - var current = $rootScope.findObjectByKey( - ctrl.additionalData.fields, - "name", - ctrl.field.name - ); - if (current) { - $rootScope.showErrors(["Field " + ctrl.field.name + " existed!"]); - } else { - ctrl.field.priority = ctrl.additionalData.fields.length + 1; - $rootScope.isBusy = true; - var saveField = await fieldService.create(ctrl.field); - $rootScope.isBusy = false; - if (saveField.isSucceed) { - ctrl.additionalData.fields.push(saveField.data); - - //reset field option - ctrl.field.title = ""; - ctrl.field.name = ""; - ctrl.field.dataType = "Text"; - $scope.$apply(); - } - } - } else { - $rootScope.showErrors(["Please add column Name"]); - } - }; - - ctrl.generateName = function (col) { - col.name = $rootScope.generateKeyword(col.title, "_"); - }; - ctrl.showReferences = function (col) { - ctrl.colRef = col; - $("#modal-navs").modal("show"); - }; - ctrl.referenceCallback = function (selected) { - if (selected && selected.length) { - ctrl.colRef.reference = selected; - ctrl.colRef.referenceId = selected[0].id; - } - $("#modal-navs").modal("hide"); - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.fields.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.fields.splice(ctrl.dragStartIndex + 1, 1); - } - angular.forEach(ctrl.fields, function (e, i) { - e.priority = i; - }); - }; - - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - }; - - ctrl.removeAttribute = function (val, index) { - $rootScope.showConfirm( - ctrl, - "removeAttributeConfirmed", - [val, index], - null, - "Remove Field", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeAttributeConfirmed = async function (val, index) { - if (val.id) { - $rootScope.isBusy = true; - var result = await fieldService.delete([val.id]); - if (result.isSucceed) { - ctrl.additionalData.fields.splice(index, 1); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - ctrl.additionalData.fields.splice(index, 1); - } - }; - }, - ], -}); - -modules.component("mixDatabaseDataFilter", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-data-filter/view.html", - bindings: { - query: "=", - mixDatabaseName: "=?", - mixDatabaseId: "=?", - selectedList: "=", - initData: "=?", - fields: "=?", - selected: "=", - callback: "&?", - save: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, dataService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.types = ["Page", "Post"]; - ctrl.type = "Page"; - ctrl.navs = []; - ctrl.data = { items: [] }; - ctrl.goToPath = $rootScope.goToPath; - ctrl.$onInit = function () { - if (ctrl.initData) { - ctrl.data = ctrl.initData; - } else { - ctrl.loadData(); - } - }; - ctrl.loadData = async function (pageIndex) { - ctrl.isBusy = true; - - // ctrl.request.query = ctrl.query + ctrl.srcId; - ctrl.navs = []; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var df = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = df.toISOString(); - } - if (ctrl.request.toDate !== null) { - var dt = new Date(ctrl.request.toDate); - ctrl.request.toDate = dt.toISOString(); - } - if (ctrl.mixDatabaseId) { - ctrl.request.mixDatabaseId = ctrl.mixDatabaseId; - } - ctrl.request.mixDatabaseName = ctrl.mixDatabaseName; - if (ctrl.filterType) { - ctrl.request.filterType = ctrl.filterType; - } - - var response = await dataService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - ctrl.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - ctrl.isBusy = false; - $scope.$apply(); - } - }; - ctrl.edit = function (nav) { - switch (ctrl.type) { - case "Page": - ctrl.goToPath(`/portal/page/details/${nav.id}`); - break; - case "Post": - ctrl.goToPath(`/portal/post/details/${nav.id}`); - break; - case "Module": - ctrl.goToPath(`/portal/module/details/${nav.id}`); - break; - } - }; - ctrl.onClose = function () { - ctrl.callback(); - }; - ctrl.select = function (nav) { - var current = $rootScope.findObjectByKey(ctrl.data.items, "id", nav.id); - if (!nav.isActive && ctrl.callback) { - ctrl.callback({ nav: nav }); - } - if (ctrl.isMultiple) { - current.isActive = !current.isActive; - } else { - if (!nav.isActive) { - angular.forEach(ctrl.data.items, (element) => { - element.isActive = false; - }); - } - current.isActive = !nav.isActive; - } - }; - ctrl.saveSelected = function () { - ctrl.selected = $rootScope.filterArray( - ctrl.data, - ["isActived"], - [true] - ); - setTimeout(() => { - ctrl.save().then(() => { - ctrl.loadPosts(); - }); - }, 500); - }; - ctrl.limString = function (str, max) { - if (str) { - return str.length > max ? str.substring(0, max) + " ..." : str; - } - }; - }, - ], -}); - -modules.component("mixDatabaseDataValueEditor", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-data-value-editor/view.html", - bindings: { - mixDatabaseDataValue: "=?", - parentType: "=?", - parentId: "=?", - isShowTitle: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "$location", - "RestRelatedMixDatabasePortalService", - "RestMixDatabaseDataPortalService", - function ( - $rootScope, - $scope, - ngAppSettings, - $location, - navService, - dataService - ) { - var ctrl = this; - ctrl.goToPath = $rootScope.goToPath; - ctrl.icons = ngAppSettings.icons; - ctrl.refData = null; - ctrl.defaultDataModel = null; - ctrl.refDataModel = { - id: null, - data: null, - }; - ctrl.refRequest = angular.copy(ngAppSettings.request); - ctrl.refRequest.pageSize = 100; - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.previousId = null; - ctrl.$doCheck = function () { - if (ctrl.mixDatabaseDataValue && ctrl.previousId !== ctrl.mixDatabaseDataValue.id) { - ctrl.previousId = ctrl.mixDatabaseDataValue.id; - ctrl.initData(); - } - }.bind(ctrl); - ctrl.$onInit = function () { - ctrl.initData(); - }; - ctrl.initData = async function () { - setTimeout(() => { - if (!ctrl.mixDatabaseDataValue.id) { - ctrl.initDefaultValue(); - } - switch (ctrl.mixDatabaseDataValue.dataType.toLowerCase()) { - case "datetime": - case "date": - case "time": - if (ctrl.mixDatabaseDataValue.dateTimeValue) { - ctrl.mixDatabaseDataValue.dateObj = new Date( - ctrl.mixDatabaseDataValue.dateTimeValue - ); - $scope.$apply(); - } - break; - case "reference": // reference - if (ctrl.mixDatabaseDataValue.field.referenceId && ctrl.parentId) { - ctrl.mixDatabaseDataValue.integerValue = - ctrl.mixDatabaseDataValue.field.referenceId; - // navService.getSingle(["default"]).then((resp) => { - // ctrl.defaultDataModel = resp; - // ctrl.defaultDataModel.mixDatabaseId = - // ctrl.mixDatabaseDataValue.field.referenceId; - // ctrl.refDataModel = angular.copy(ctrl.defaultDataModel); - // }); - // ctrl.loadRefData(); - } - break; - default: - if ( - ctrl.mixDatabaseDataValue.field && - ctrl.mixDatabaseDataValue.field.isEncrypt && - ctrl.mixDatabaseDataValue.encryptValue - ) { - var encryptedData = { - key: ctrl.mixDatabaseDataValue.encryptKey, - data: ctrl.mixDatabaseDataValue.encryptValue, - }; - ctrl.mixDatabaseDataValue.stringValue = $rootScope.decrypt( - encryptedData - ); - } - if ( - ctrl.mixDatabaseDataValue.field && - !ctrl.mixDatabaseDataValue.stringValue - ) { - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.field.defaultValue; - $scope.$apply(); - } - break; - } - }, 200); - }; - ctrl.initDefaultValue = async function () { - switch (ctrl.mixDatabaseDataValue.dataType) { - case "datetime": - case "date": - case "time": - if (ctrl.mixDatabaseDataValue.field.defaultValue) { - ctrl.mixDatabaseDataValue.dateObj = new Date( - ctrl.mixDatabaseDataValue.field.defaultValue - ); - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.field.defaultValue; - } - break; - case "double": - if (ctrl.mixDatabaseDataValue.field.defaultValue) { - ctrl.mixDatabaseDataValue.doubleValue = parseFloat( - ctrl.mixDatabaseDataValue.field.defaultValue - ); - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.field.defaultValue; - } - break; - case "boolean": - if (ctrl.mixDatabaseDataValue.field.defaultValue) { - ctrl.mixDatabaseDataValue.booleanValue = - ctrl.mixDatabaseDataValue.field.defaultValue == "true"; - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.field.defaultValue; - } - break; - - default: - if (ctrl.mixDatabaseDataValue.field.defaultValue) { - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.field.defaultValue; - } - break; - } - }; - ctrl.updateStringValue = async function (dataType) { - switch (dataType.toLowerCase()) { - case "datetime": - case "date": - case "time": - if (ctrl.mixDatabaseDataValue.dateObj) { - ctrl.mixDatabaseDataValue.dateTimeValue = ctrl.mixDatabaseDataValue.dateObj.toISOString(); - ctrl.mixDatabaseDataValue.stringValue = - ctrl.mixDatabaseDataValue.dateTimeValue; - } - break; - case "double": - if (ctrl.mixDatabaseDataValue.doubleValue) { - ctrl.mixDatabaseDataValue.stringValue = ctrl.mixDatabaseDataValue.doubleValue.toString(); - } - break; - case "boolean": - if (ctrl.mixDatabaseDataValue.booleanValue != null) { - ctrl.mixDatabaseDataValue.stringValue = ctrl.mixDatabaseDataValue.booleanValue.toString(); - } - break; - - default: - break; - } - }; - - ctrl.updateRefData = function (nav) { - ctrl.goToPath(`/portal/mix-database-data/details?dataId=${nav.data.id} - &mixDatabaseId=${nav.data.mixDatabaseId} - &parentId=${ctrl.parentId} - &parentType=${ctrl.parentType}`); - // ctrl.refDataModel = nav; - // var e = $(".pane-form-" + ctrl.mixDatabaseDataValue.field.referenceId)[0]; - // angular.element(e).triggerHandler('click'); - // $location.url('/portal/mix-database-data/details?dataId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); - }; - - ctrl.removeRefData = async function (nav) { - $rootScope.showConfirm( - ctrl, - "removeRefDataConfirmed", - [nav], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeRefDataConfirmed = async function (nav) { - $rootScope.isBusy = true; - var result = await navService.delete([ - nav.parentId, - nav.parentType, - nav.id, - ]); - if (result.isSucceed) { - $rootScope.removeObjectByKey(ctrl.refData, "id", nav.id); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, - ], -}); - -modules.component("mixDatabaseDataValues", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-data-values/view.html", - bindings: { - header: "=", - data: "=", - canDrag: "=", - mixDatabaseName: "=?", - mixDatabaseId: "=?", - queries: "=?", - filterType: "=?", - selectedList: "=", - selectSingle: "=?", - fields: "=?", - onFilterList: "&?", - onApplyList: "&?", - onSendMail: "&?", - onUpdate: "&?", - onDuplicate: "&?", - onDelete: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, fieldService, dataService) { - var ctrl = this; - ctrl.actions = ["Delete", "SendMail"]; - ctrl.filterTypes = ["contain", "equal"]; - ctrl.selectedProp = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - if (!ctrl.selectedList) { - ctrl.selectedList = { - action: "Delete", - data: [], - }; - } - if (!ctrl.fields) { - var getFields = await fieldService.initData( - ctrl.mixDatabaseName || ctrl.mixDatabaseId - ); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - $scope.$apply(); - } - } - }; - ctrl.select = function (item) { - if (item.isSelected) { - if (ctrl.selectSingle == "true") { - ctrl.selectedList.data = []; - ctrl.selectedList.data.push(item); - } else { - var current = $rootScope.findObjectByKey( - ctrl.selectedList, - "id", - item.id - ); - if (!current) { - ctrl.selectedList.data.push(item); - } - } - } else { - $rootScope.removeObject(ctrl.selectedList, item.id); - } - }; - ctrl.selectAll = function (isSelected) { - ctrl.selectedList.data = []; - angular.forEach(ctrl.data, function (e) { - e.isSelected = isSelected; - if (isSelected) { - ctrl.selectedList.data.push(e.id); - } - }); - }; - ctrl.filter = function () {}; - ctrl.sendMail = async function (data) { - ctrl.onSendMail({ data: data }); - }; - ctrl.apply = async function () { - ctrl.onApplyList(); - }; - - ctrl.duplicate = function (data) { - ctrl.onDuplicate({ data: data }); - }; - - ctrl.update = function (data) { - ctrl.onUpdate({ data: data }); - }; - - ctrl.delete = function (data) { - ctrl.onDelete({ data: data }); - }; - - ctrl.filterData = function (item, attributeName) { - return $rootScope.findObjectByKey( - item.data, - "attributeName", - attributeName - ); - }; - - ctrl.dragStart = function (index) { - ctrl.min = ctrl.data[0].priority; - ctrl.dragStartIndex = index; - }; - ctrl.updateOrders = function (index, items) { - for (var i = 0; i < items.length; i++) { - items[i].priority = ctrl.min + i + 1; - } - items.splice(ctrl.dragStartIndex, 1); - ctrl.updateDataInfos(items); - }; - ctrl.updateDataInfos = async function (items) { - angular.forEach(items, async function (e) { - var resp = await dataService.saveFields(e.id, { - priority: e.priority, - }); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - } - }); - }; - // ctrl.updateOrders = function (index) { - // if (index > ctrl.dragStartIndex) { - // ctrl.data.splice(ctrl.dragStartIndex, 1); - // } else { - // ctrl.data.splice(ctrl.dragStartIndex + 1, 1); - // } - // // angular.forEach(ctrl.data, async function (e, i) { - // // e.priority = ctrl.min + i; - // // var resp = await dataService.saveFields(e.id, { - // // priority: e.priority, - // // }); - // // if (resp && resp.isSucceed) { - // // $scope.activedPage = resp.data; - // // $scope.$apply(); - // // } else { - // // if (resp) { - // // $rootScope.showErrors(resp.errors); - // // } - // // } - // // }); - // }; - - ctrl.view = function (item) { - var obj = { - fields: ctrl.fields, - item: item, - }; - $rootScope.preview("mix-database-data", obj, null, "modal-lg"); - }; - }, - ], -}); - -modules.component("mixDatabaseForm", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-form/view.html", - bindings: { - mixDatabaseId: "=", - mixDatabaseName: "=", - fields: "=?", - attrDataId: "=?", - attrData: "=?", - parentType: "=?", // attribute set = 1 | post = 2 | page = 3 | module = 4 - parentId: "=?", - defaultId: "=", - backUrl: "=?", - level: "=?", - hideAction: "=?", - saveData: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "$location", - "$routeParams", - "RestMixDatabaseDataPortalService", - function ( - $rootScope, - $scope, - $location, - $routeParams, - service - ) { - var ctrl = this; - ctrl.isBusy = false; - ctrl.attributes = []; - - ctrl.defaultData = null; - ctrl.selectedProp = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - ctrl.level = ctrl.level || 0; - ctrl.loadData(); - }; - ctrl.loadData = async function () { - /* - If input is data id => load ctrl.attrData from service and handle it independently - */ - ctrl.isBusy = true; - - if (ctrl.attrDataId) { - var getData = await service.getSingle([ctrl.attrDataId]); - ctrl.attrData = getData.data; - if (ctrl.attrData) { - ctrl.attrData.parentId = ctrl.parentId; - ctrl.attrData.parentType = ctrl.parentType; - ctrl.mixDatabaseId = ctrl.attrData.mixDatabaseId; - ctrl.mixDatabaseName = ctrl.attrData.mixDatabaseName; - ctrl.mixDatabaseTitle = $routeParams.mixDatabaseTitle; - ctrl.backUrl = `/portal/mix-database-data/list?mixDatabaseId=${ctrl.attrData.mixDatabaseId}&mixDatabaseName=${ctrl.attrData.mixDatabaseName}&mixDatabaseTitle=test`; - await ctrl.loadDefaultModel(); - ctrl.isBusy = false; - $scope.$apply(); - } else { - if (getData) { - $rootScope.showErrors(getData.errors); - } - ctrl.isBusy = false; - $scope.$apply(); - } - } - if ((ctrl.mixDatabaseName || ctrl.mixDatabaseId) && !ctrl.defaultData) { - await ctrl.loadDefaultModel(); - ctrl.isBusy = false; - $scope.$apply(); - } - }; - ctrl.loadDefaultModel = async function () { - if ($routeParams.parentId) { - ctrl.parentId = $routeParams.parentId; - } - if ($routeParams.parentType) { - ctrl.parentType = $routeParams.parentType; - } - if (!ctrl.backUrl) { - if (ctrl.parentType) { - switch (ctrl.parentType) { - case "Post": - case "Page": - case "Module": - ctrl.backUrl = `/portal/${ctrl.parentType.toLowerCase()}/details/${ - ctrl.parentId - }`; - break; - - default: - ctrl.backUrl = `/portal/mix-database-data/details?dataId=${ctrl.parentId}&mixDatabaseId=${ctrl.mixDatabaseId}&mixDatabaseName=${ctrl.mixDatabaseName}&mixDatabaseTitle=${$routeParams.mixDatabaseTitle}`; - break; - } - } - } - var getDefault = await service.initData( - ctrl.mixDatabaseName || ctrl.mixDatabaseId - ); - ctrl.defaultData = getDefault.data; - if (ctrl.defaultData) { - ctrl.defaultData.mixDatabaseId = ctrl.mixDatabaseId || 0; - ctrl.defaultData.mixDatabaseName = ctrl.mixDatabaseName; - ctrl.defaultData.parentId = ctrl.parentId; - ctrl.defaultData.parentType = ctrl.parentType; - - ctrl.fields = ctrl.fields || ctrl.defaultData.fields; - } - - if (!ctrl.attrData) { - ctrl.attrData = angular.copy(ctrl.defaultData); - } - }; - - ctrl.reload = async function () { - ctrl.attrData = angular.copy(ctrl.defaultData); - }; - ctrl.loadSelected = function () { - if (ctrl.selectedList.data.length) { - ctrl.attrData = ctrl.selectedList.data[0]; - ctrl.attrData.mixDatabaseId = ctrl.mixDatabaseId; - ctrl.attrData.mixDatabaseName = ctrl.mixDatabaseName; - ctrl.attrData.parentId = ctrl.parentId; - ctrl.attrData.parentType = ctrl.parentType; - } - }; - ctrl.submit = async function () { - if (ctrl.validate()) { - if (ctrl.saveData) { - ctrl.isBusy = true; - var result = await ctrl.saveData({ data: ctrl.attrData }); - if (result && result.isSucceed) { - ctrl.isBusy = false; - ctrl.attrData = result.data; - $scope.$apply(); - } else { - ctrl.isBusy = false; - // ctrl.attrData = await service.getSingle('portal', [ctrl.defaultId, ctrl.mixDatabaseId, ctrl.mixDatabaseName]); - $scope.$apply(); - } - } else { - ctrl.isBusy = true; - - var saveResult = await service.save(ctrl.attrData); - if (saveResult.isSucceed) { - ctrl.attrData.id = saveResult.data.id; - ctrl.isBusy = false; - $rootScope.showMessage("success"); - if ($location.path() == "/portal/mix-database-data/create") { - const url = - ctrl.backUrl || - `/portal/mix-database-data/details?dataId=${ctrl.attrData.id}&mixDatabaseId=${ctrl.mixDatabaseId}&mixDatabaseName=${ctrl.mixDatabaseName}&mixDatabaseTitle=${$routeParams.mixDatabaseTitle}`; - $location.url(url); - } - $scope.$apply(); - } else { - ctrl.isBusy = false; - if (saveResult) { - $rootScope.showErrors(saveResult.errors); - } - $scope.$apply(); - } - } - } - }; - ctrl.validate = function () { - var isValid = true; - ctrl.errors = []; - angular.forEach(ctrl.fields, function (field) { - if (field.regex) { - var regex = RegExp(field.regex, "g"); - isValid = regex.test(ctrl.attrData.obj[field.name]); - if (!isValid) { - ctrl.errors.push(`${field.name} is not match Regex`); - } - } - if (!isValid) { - $rootScope.showErrors(ctrl.errors); - } - if (isValid && field.isEncrypt) { - ctrl.attrData.obj[field.name] = $rootScope.encrypt( - ctrl.attrData.obj[field.name] - ); - } - }); - return isValid; - }; - ctrl.showContentFilter = function ($event) { - $rootScope.showContentFilter(ctrl.loadSelectedLink); - }; - ctrl.loadSelectedLink = function (data, type) { - if (data) { - ctrl.attrData.obj.target_id = data.id; - ctrl.attrData.obj.title = data.title; - ctrl.attrData.obj.type = type; - ctrl.attrData.obj.uri = data.detailsUrl; - } - }; - ctrl.filterData = function (attributeName) { - if (ctrl.attrData) { - var attr = $rootScope.findObjectByKey( - ctrl.attrData.obj, - "mixDatabaseColumnName", - attributeName - ); - if (!attr) { - attr = angular.copy( - $rootScope.findObjectByKey( - ctrl.defaultData.data, - "mixDatabaseColumnName", - attributeName - ) - ); - mixDatabaseColumn; - ctrl.attrData.obj.push(attr); - } - return attr; - } - }; - }, - ], -}); - -modules.component("mixDatabaseNavData", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-nav-data/view.html", - bindings: { - nav: "=", - parentId: "=", - parentType: "=", - onUpdate: "&?", - onDelete: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestRelatedAttributeDataPortalService", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, navService, dataService) { - var ctrl = this; - ctrl.data = null; - ctrl.selected = null; - ctrl.navRequest = angular.copy(ngAppSettings.request); - ctrl.setRequest = angular.copy(ngAppSettings.request); - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = function () { - navService - .getDefault([ctrl.parentId, ctrl.parentType, "default"]) - .then((resp) => { - ctrl.defaultData = resp.data; - ctrl.defaultData.parentId = ctrl.parentId; - ctrl.defaultData.parentType = ctrl.parentType; - ctrl.selected = angular.copy(ctrl.defaultData); - ctrl.loadData(); - }); - ctrl.navRequest.parentType = ctrl.parentType; - ctrl.navRequest.parentId = ctrl.parentId; - }; - ctrl.selectPane = function (pane) {}; - ctrl.loadData = function () { - navService.getList(ctrl.navRequest).then((resp) => { - if (resp) { - ctrl.data = resp.data; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $scope.$apply(); - } - }); - }; - ctrl.updateData = function (nav) { - ctrl.selected = nav; - var e = $(".pane-form-" + ctrl.nav.data.id)[0]; - angular.element(e).triggerHandler("click"); - // $location.url('/portal/mix-database-data/details?dataId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); - }; - ctrl.saveData = function (data) { - $rootScope.isBusy = true; - ctrl.selected.data = data; - dataService.save(data).then((resp) => { - if (resp.isSucceed) { - ctrl.selected.dataId = resp.data.id; - ctrl.selected.mixDatabaseId = resp.data.mixDatabaseId; - ctrl.selected.mixDatabaseName = resp.data.mixDatabaseName; - ctrl.selected.attributeData = resp.data; - navService.save(ctrl.selected).then((resp) => { - if (resp.isSucceed) { - var tmp = $rootScope.findObjectByKey( - ctrl.data, - ["parentId", "parentType", "id"], - [resp.data.parentId, resp.data.parentType, resp.data.id] - ); - if (!tmp) { - ctrl.data.items.push(resp.data); - var e = $(".pane-data-" + ctrl.nav.data.id)[0]; - angular.element(e).triggerHandler("click"); - } - ctrl.selected = angular.copy(ctrl.defautData); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - }; - ctrl.removeData = async function (nav) { - $rootScope.showConfirm( - ctrl, - "removeDataConfirmed", - [nav], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeDataConfirmed = async function (nav) { - $rootScope.isBusy = true; - var result = await navService.delete([nav.id]); - if (result.isSucceed) { - $rootScope.removeObjectByKey(ctrl.data, "id", nav.id); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.data[0].priority; - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.data.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.data.splice(ctrl.dragStartIndex + 1, 1); - } - var arrNavs = []; - angular.forEach(ctrl.data, function (e, i) { - e.priority = ctrl.minPriority + i; - var keys = { - parentId: e.parentId, - parentType: e.parentType, - id: e.id, - }; - var properties = { - priority: e.priority, - }; - arrNavs.push({ - keys: keys, - properties: properties, - }); - }); - navService.saveProperties("portal", arrNavs).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - }, - ], -}); - -modules.component("mixDatabaseNavValues", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-nav-values/view.html", - bindings: { - mixDatabaseId: "=", - mixDatabaseName: "=", - parentId: "=", - parentType: "=", - fields: "=?", - header: "=", - data: "=?", - maxCol: "=?", - createUrl: "=?", - updateUrl: "=?", - onUpdate: "&?", - onDelete: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestRelatedAttributeDataPortalService", - "RestMixDatabaseColumnPortalService", - function ($rootScope, $scope, ngAppSettings, navService, fieldService) { - var ctrl = this; - ctrl.selectedProp = null; - ctrl.request = angular.copy(ngAppSettings.restRequest); - ctrl.request.orderBy = "priority"; - ctrl.request.query = "{}"; - - ctrl.request.direction = 0; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - ctrl.maxCol = ctrl.maxCol || 3; - if (!ctrl.createUrl) { - ctrl.createUrl = "/portal/mix-database-data/create"; - } - if (!ctrl.updateUrl) { - ctrl.updateUrl = "/portal/mix-database-data/details"; - } - if (!ctrl.fields) { - var getFields = await fieldService.initData( - ctrl.mixDatabaseName || ctrl.mixDatabaseId - ); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - $scope.$apply(); - } - } - if (!ctrl.data) { - ctrl.loadData(); - } - }; - - ctrl.update = function (data) { - ctrl.onUpdate({ data: data }); - }; - - ctrl.delete = function (data) { - ctrl.onDelete({ data: data }); - }; - - ctrl.filterData = function (item, attributeName) { - return $rootScope.findObjectByKey( - item.data, - "attributeName", - attributeName - ); - }; - - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.data.items[0].priority; - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.data.items.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.data.items.splice(ctrl.dragStartIndex + 1, 1); - } - angular.forEach(ctrl.data.items, function (e, i) { - e.priority = ctrl.minPriority + i; - navService.saveFields(e.id, { priority: e.priority }).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); - }); - }; - - ctrl.loadData = function () { - ctrl.request.mixDatabaseId = ctrl.mixDatabaseId || 0; - ctrl.request.mixDatabaseName = ctrl.mixDatabaseName || null; - ctrl.request.parentId = ctrl.parentId; - ctrl.request.parentType = ctrl.parentType; - navService.getList(ctrl.request).then((resp) => { - if (resp) { - ctrl.data = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - ctrl.refData = []; - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - }; - ctrl.updateData = function (nav) { - $rootScope.goToPath( - `${ctrl.updateUrl}?dataId=${nav.dataId}&mixDatabaseId=${nav.mixDatabaseId}&parentId=${ctrl.parentId}&parentType=${ctrl.parentType}` - ); - // ctrl.refDataModel = nav; - // var e = $(".pane-form-" + ctrl.mixDatabaseDataValue.field.referenceId)[0]; - // angular.element(e).triggerHandler('click'); - // $location.url('/portal/mix-database-data/details?dataId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); - }; - ctrl.saveData = function (data) { - $rootScope.isBusy = true; - ctrl.refDataModel.data = data; - dataService.save("portal", data).then((resp) => { - if (resp.isSucceed) { - ctrl.refDataModel.id = resp.data.id; - ctrl.refDataModel.data = resp.data; - navService.save("portal", ctrl.refDataModel).then((resp) => { - if (resp.isSucceed) { - var tmp = $rootScope.findObjectByKey( - ctrl.refData, - ["parentId", "parentType", "id"], - [resp.data.parentId, resp.data.parentType, resp.data.id] - ); - if (!tmp) { - ctrl.refData.push(resp.data); - } - ctrl.refDataModel = angular.copy(ctrl.defaultDataModel); - var e = $( - ".pane-data-" + ctrl.mixDatabaseDataValue.field.referenceId - )[0]; - angular.element(e).triggerHandler("click"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - }; - ctrl.removeData = async function (nav) { - $rootScope.showConfirm( - ctrl, - "removeDataConfirmed", - [nav], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeDataConfirmed = async function (nav) { - $rootScope.isBusy = true; - var result = await navService.delete([nav.id]); - if (result.isSucceed) { - $rootScope.removeObjectByKey(ctrl.data.items, "id", nav.id); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.view = function (item) { - var obj = { - fields: ctrl.fields, - item: item, - }; - $rootScope.preview("mix-database-data", obj, null, "modal-lg"); - }; - }, - ], -}); - -modules.component("mixDatabaseNavs", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-navs/view.html", - bindings: { - parentId: "=", - parentType: "=", - mixDatabaseNavs: "=?", - onUpdate: "&?", - onDelete: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestRelatedMixDatabasePortalService", - "RestMixDatabasePortalService", - function ($rootScope, $scope, ngAppSettings, navService, setService) { - var ctrl = this; - ctrl.mixDatabaseNavs = ctrl.mixDatabaseNavs || []; - ctrl.selected = {}; - ctrl.defaultData = null; - ctrl.navRequest = angular.copy(ngAppSettings.request); - ctrl.setRequest = angular.copy(ngAppSettings.request); - - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = function () { - // ctrl.setRequest.type = ctrl.parentType; - navService.getDefault().then((resp) => { - resp.parentId = ctrl.parentId; - resp.parentType = ctrl.parentType; - ctrl.defaultData = resp; - ctrl.loadData(); - }); - }; - ctrl.goToPath = $rootScope.goToPath; - ctrl.selectPane = function (pane) {}; - ctrl.loadData = async function () { - // Load attr set navs if not in input - if (!ctrl.mixDatabaseNavs) { - ctrl.navRequest.parentType = ctrl.parentType; - ctrl.navRequest.parentId = ctrl.parentId; - var resp = await navService.getList(ctrl.navRequest); - if (resp) { - angular.forEach(resp.data.items, (e) => { - e.isActived = true; - ctrl.mixDatabaseNavs.push(e); - }); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - } - } else { - angular.forEach(ctrl.mixDatabaseNavs, (e) => { - e.isActived = true; - }); - } - - var setResult = await setService.getList(ctrl.setRequest); - if (setResult) { - angular.forEach(setResult.data.items, (element) => { - var e = $rootScope.findObjectByKey( - ctrl.mixDatabaseNavs, - "mixDatabaseId", - element.id - ); - if (!e) { - e = angular.copy(ctrl.defaultData); - e.status = "Published"; - e.mixDatabaseId = element.id; - e.specificulture = navService.lang; - e.data = element; - e.isActived = false; - ctrl.mixDatabaseNavs.push(e); - } - }); - } else { - if (setResult) { - $rootScope.showErrors("Others Failed"); - } - } - $scope.$apply(); - }; - ctrl.change = async function (nav) { - $rootScope.isBusy = true; - var result; - if (nav.isActived) { - ctrl.active(nav); - } else { - ctrl.deactive(nav); - } - }; - - ctrl.deactive = async function (nav) { - let result = null; - if (nav.id) { - result = await navService.delete([nav.id]); - $(".pane-container-" + nav.data.id) - .parent() - .remove(); - } - if (result && result.isSucceed) { - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - } - }; - - ctrl.active = async function (nav) { - $rootScope.isBusy = true; - var result; - result = await navService.save(nav); - if (result && result.isSucceed) { - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.update = function (data) { - ctrl.onUpdate({ - data: data, - }); - }; - - ctrl.delete = function (data) { - ctrl.onDelete({ - data: data, - }); - }; - - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.mixDatabaseNavs[0].priority; - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex + 1, 1); - } - var arrNavs = []; - angular.forEach(ctrl.mixDatabaseNavs, function (e, i) { - e.priority = ctrl.minPriority + i; - var keys = { - parentId: e.parentId, - parentType: e.parentType, - id: e.id, - }; - var properties = { - priority: e.priority, - }; - arrNavs.push({ - keys: keys, - properties: properties, - }); - }); - navService.saveProperties("portal", arrNavs).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - }, - ], -}); - -modules.component("mixFileUpload", { - templateUrl: "/mix-app/views/app-portal/components/mix-file-upload/view.html", - bindings: { - w: "=?", - h: "=?", - rto: "=?", - folder: "=?", - accept: "=?", - onFail: "&?", - onSuccess: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "FileServices", - function ($rootScope, $scope, ngAppSettings, fileService) { - var ctrl = this; - ctrl.isAdmin = $rootScope.isAdmin; - ctrl.mediaNavs = []; - ctrl.$onInit = function () { - ctrl.id = Math.floor(Math.random() * 100); - }; - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.mediaFile.folder = ctrl.folder ? ctrl.folder : "Media"; - ctrl.mediaFile.title = ctrl.title ? ctrl.title : ""; - ctrl.mediaFile.description = ctrl.description ? ctrl.description : ""; - ctrl.mediaFile.file = file; - if (ctrl.w || ctrl.h || ctrl.rto) { - ctrl.openCroppie(file); - } else { - if (ctrl.auto == "true") { - ctrl.uploadFile(file); - } else { - ctrl.getBase64(file); - } - } - } - }; - - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - // ctrl.cropped.source = null; - reader.onload = function () { - if (ctrl.media.mediaFile) { - ctrl.media.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.media.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - // ctrl.postedFile.fileStream = reader.result; - } - var image = new Image(); - image.src = reader.result; - - image.onload = function () { - // access image size here - ctrl.w = ctrl.w || this.width; - ctrl.h = ctrl.h || this.height; - ctrl.loadImageSize(this.width, this.height); - ctrl.cropped.source = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - - ctrl.uploadFile = async function () { - if (ctrl.file) { - $rootScope.isBusy = true; - var response = await fileService.uploadFile(ctrl.file, ctrl.folder); - if (response.isSucceed) { - if (ctrl.onSuccess) { - ctrl.onSuccess(); - } - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - $rootScope.showErrors(["Please choose file"]); - } - }; - - ctrl.openCroppie = function (file) { - const w = parseInt(ctrl.w); - const h = parseInt(ctrl.h); - const rto = ctrl.w / ctrl.h; - - var modalInstance = $uibModal.open({ - animation: true, - windowClass: "show", - templateUrl: "/mix-app/views/app-shared/components/modal-croppie/croppie.html", - controller: "ModalCroppieController", - controllerAs: "$ctrl", - size: "lg", - resolve: { - mediaService: mediaService, - file: function () { - return file; - }, - w, - h, - rto, - }, - }); - - modalInstance.result.then( - function (result) { - ctrl.srcUrl = result.fullPath; - }, - function () { } - ); - }; - - ctrl.isImage = function (filename) { - filename - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - } - }, - ], -}); - -'use strict'; -app.controller('MixNavigationController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', 'MediaService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, service, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - - $scope.viewModel = { - title: '', - description: '', - status: 'Published', - mediaFile: { - file: null, - fullPath: '', - folderName: 'Media', - fileFolder: '', - fileName: '', - extension: '', - content: '', - fileStream: '' - } - }; - $scope.relatedMedias = []; - $scope.uploadMedia = async function () { - $rootScope.isBusy = true; - var resp = await service.uploadMedia($scope.mediaFile); - if (resp && resp.isSucceed) { - $scope.activedMedia = resp.data; - $scope.getList(); - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.selectFile = function (file, errFiles) { - if (file !== undefined && file !== null) { - $scope.mediaFile.folder = 'Media'; - $scope.mediaFile.file = file; - $scope.getBase64(file); - } - }; - $scope.getBase64 = function (file) { - if (file !== null && $scope.postedFile) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - var index = reader.result.indexOf(',') + 1; - var base64 = reader.result.substring(index); - $scope.activedMedia.mediaFile.fileName = $rootScope.generateKeyword(file.name.substring(0, file.name.lastIndexOf('.')), '-'); - $scope.activedMedia.mediaFile.extension = file.name.substring(file.name.lastIndexOf('.')); - $scope.activedMedia.mediaFile.fileStream = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.showErrors([error]); - $rootScope.isBusy = false; - }; - } - else { - return null; - } - }; - $scope.togglePreview = function (item) { - item.isPreview = item.isPreview === undefined ? true : !item.isPreview; - }; - $scope.clone = async function (id) { - $rootScope.isBusy = true; - var resp = await service.cloneMedia(id); - if (resp && resp.isSucceed) { - $scope.activedMedia = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/portal/media/details/' + resp.data.id); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = function () { - $scope.getList(); - } - $scope.removeCallback = function () { - $scope.getList(); - } - }]); - -modules.component('mixSelectIcons', { - templateUrl: '/mix-app/views/app-portal/components/mix-select-icons/mix-select-icons.html', - controller: ['$rootScope', '$scope', '$location', '$element', - function ($rootScope, $scope, $location, $element) { - var ctrl = this; - ctrl.limitTo = 20; - ctrl.container = $element[0].querySelector('.list-icon'); - ctrl.translate = function (keyword) { - return $rootScope.translate(keyword); - }; - ctrl.showMore = () => { - if (ctrl.container.scrollTop >= ctrl.container.scrollHeight - 200 && - ctrl.limitTo < ctrl.options.length) { - ctrl.limitTo *= 2; - } - } - ctrl.select = function (ico) { - ctrl.data = ico.class; - } - } - ], - bindings: { - data: '=', - prefix: '=', - options: '=', - } -}); -modules.component('mixTemplateEditor', { - templateUrl: '/mix-app/views/app-portal/components/mix-template-editor/view.html', - bindings: { - template: '=', - folderType: '=', - isReadonly: '=?', - lineCount: '=?', - hideJs: '=?', - hideCss: '=?' - }, - controller: ['$scope', '$rootScope', '$routeParams', 'ngAppSettings', 'GlobalSettingsService', 'TemplateService', - function ($scope, $rootScope, $routeParams, ngAppSettings, globalSettingsService, service) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - var ctrl = this; - ctrl.isNull = false; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.selectPane = function (pane) { - ctrl.activedPane = pane; - }; - ctrl.selectTemplate = function (template) { - ctrl.template = template; - $scope.$broadcast('updateContentCodeEditors', []); - }; - ctrl.new = function () { - ctrl.template.id = 0; - }; - ctrl.init = async function () { - if (ctrl.folderType) { - var themeId = $rootScope.settings.data.ThemeId; - ctrl.request.key = ctrl.folderType; - var resp = await service.getList(ctrl.request, [themeId]); - - if (resp && resp.isSucceed) { - ctrl.templates = resp.data.items; - if (!ctrl.template) { - ctrl.template = ctrl.templates[0]; - } - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); $rootScope.isBusy = false; $scope.$apply(); } - } - - } - } - ctrl.updateTemplateContent = function (content) { - ctrl.template.content = content; - } - ctrl.updateStyleContent = function (content) { - ctrl.template.scripts = content; - } - ctrl.updateScriptContent = function (content) { - ctrl.template.styles = content; - } - }] -}); - -modules.component("mixValueEditor", { - templateUrl: - "/mix-app/views/app-portal/components/mix-value-editor/view.html", - bindings: { - title: "=?", - isSelect: "=?", - stringValue: "=", - type: "=", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "$location", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, $location, dataService) { - var ctrl = this; - ctrl.icons = ngAppSettings.icons; - ctrl.refData = []; - ctrl.refRequest = angular.copy(ngAppSettings.request); - ctrl.refRequest.pageSize = 100; - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.previousId = null; - ctrl.initData = async function () { - setTimeout(() => { - switch (ctrl.type) { - case "datetime": - case "date": - case "time": - if (ctrl.stringValue) { - ctrl.dateObj = new Date(ctrl.stringValue); - $scope.$apply(); - } - break; - case "boolean": - if (ctrl.stringValue) { - ctrl.booleanValue = ctrl.stringValue == "true"; - } - break; - - case "reference": // reference - if (ctrl.referenceId) { - ctrl.refRequest.mixDatabaseId = ctrl.referenceId; - ctrl.refRequest.parentType = ctrl.parentType; - ctrl.refRequest.parentId = ctrl.parentId; - - dataService.getList(ctrl.refRequest).then((resp) => { - if (resp) { - ctrl.refData = resp; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } - break; - default: - if (ctrl.isEncrypt && ctrl.encryptValue) { - var encryptedData = { - key: ctrl.encryptKey, - data: ctrl.encryptValue, - }; - ctrl.stringValue = $rootScope.decrypt(encryptedData); - } - break; - } - }, 200); - }; - ctrl.updateStringValue = async function (dataType) { - switch (dataType) { - case "datetime": - case "date": - case "time": - if (ctrl.dateObj != null) { - ctrl.stringValue = ctrl.dateObj.toISOString(); - } else { - ctrl.stringValue = null; - } - break; - case "double": - // ctrl.stringValue = ctrl.doubleValue; - break; - case "boolean": - // ctrl.stringValue = ctrl.booleanValue; - break; - - default: - ctrl.stringValue = ctrl.doubleValue; - break; - } - }; - ctrl.updateRefData = function (item) { - $location.url( - "/portal/mix-database-data/details?dataId=" + - item.id + - "&mixDatabaseId=" + - item.mixDatabaseId + - "&parentType=" + - item.parentType + - "&parentId=" + - item.parentId - ); - }; - ctrl.removeRefData = async function (data) { - $rootScope.showConfirm( - ctrl, - "removeRefDataConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeRefDataConfirmed = async function (dataId) { - $rootScope.isBusy = true; - var result = await dataService.delete(dataId); - if (result.isSucceed) { - $rootScope.removeObjectByKey(ctrl.refData, "id", dataId); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, - ], -}); - -modules.component("modalBookmark", { - templateUrl: "/mix-app/views/app-portal/components/modal-bookmark/modal-bookmark.html", - controller: [ - "$rootScope", - "$scope", - "localStorageService", - "$routeParams", - "$location", - function ( - $rootScope, - $scope, - localStorageService, - $routeParams, - $location - ) { - var ctrl = this; - ctrl.searchText = ""; - ctrl.defaultModel = { - url: "", - title: "", - }; - ctrl.bookmarks = []; - ctrl.model = null; - ctrl.$onInit = function () { - ctrl.model = angular.copy(ctrl.defaultModel); - ctrl.getCurrentUrl(); - ctrl.bookmarks = localStorageService.get("bookmarks") || []; - }; - ctrl.goToPath = function (url) { - $rootScope.goToPath(url); - $("#dlg-bookmark").modal("hide"); - }; - ctrl.getCurrentUrl = function (url) { - url = url || $location.url(); - ctrl.model.url = url; - ctrl.model.title = url; - }; - ctrl.removeBookmark = function (url) { - $rootScope.removeObjectByKey(ctrl.bookmarks, "url", url); - localStorageService.set("bookmarks", ctrl.bookmarks); - }; - ctrl.addBookmark = function () { - var current = $rootScope.findObjectByKey( - ctrl.bookmarks, - "url", - ctrl.model.url - ); - if (current) { - current.title = ctrl.model.title; - } else { - ctrl.bookmarks.push(ctrl.model); - } - localStorageService.set("bookmarks", ctrl.bookmarks); - ctrl.model = angular.copy(ctrl.defaultModel); - }; - }, - ], -}); - -modules.component('modalContentFilter', { - templateUrl: '/mix-app/views/app-portal/components/modal-content-filter/modal-content-filter.html', - bindings: { - query: '=', - initData: '=?', - selected: '=', - callback: '&?', - save: '&?' - }, - controller: ['$rootScope', '$scope', 'ngAppSettings', - 'PostRestService', 'PageRestService', 'ModuleRestService', - function ($rootScope, $scope, ngAppSettings, postService, pageService, moduleService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.types = ['Page', 'Post', 'Module']; - ctrl.moduleId = null; - ctrl.type = 'Page'; - ctrl.navs = []; - ctrl.data = { - items: [] - }; - // ctrl.goToPath = $rootScope.goToPath; - ctrl.$onInit = function () { - $('#modal-content-filter').on('shown.bs.modal', function () { - if (ctrl.initData) { - ctrl.data = ctrl.initData; - } else { - if (!ctrl.data.items.length) { - ctrl.loadData(); - } - } - }); - }; - ctrl.closeDialog = function () { - $('#modal-content-filter').modal('hide'); - }; - ctrl.loadData = async function (pageIndex) { - - ctrl.request.query = ctrl.query + ctrl.srcId; - ctrl.navs = []; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - - switch (ctrl.type) { - case 'Page': - ctrl.loadPages(); - break; - case 'Post': - ctrl.loadPosts(); - break; - case 'Module': - ctrl.loadModules(); - break; - } - }; - ctrl.edit = function (nav) { - switch (ctrl.type) { - case 'Page': - ctrl.goToPath(`/portal/page/details/${nav.id}`); - break; - case 'Post': - ctrl.goToPath(`/portal/post/details/${nav.id}`); - break; - case 'Module': - ctrl.goToPath(`/portal/module/details/${nav.id}`); - break; - } - } - ctrl.loadModules = async function () { - $rootScope.isBusy = true; - var response = await moduleService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.loadPosts = async function () { - $rootScope.isBusy = true; - var response = await postService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.loadPages = async function () { - $rootScope.isBusy = true; - var response = await pageService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.select = function (nav) { - var current = $rootScope.findObjectByKey(ctrl.data.items, 'id', nav.id); - if (!nav.isActive && ctrl.callback) { - ctrl.callback({ - nav: nav, - type: ctrl.type - }); - } - if (ctrl.isMultiple) { - current.isActive = !current.isActive; - } else { - if (!nav.isActive) { - angular.forEach(ctrl.data.items, element => { - element.isActive = false; - }); - } - current.isActive = !nav.isActive; - } - }; - ctrl.saveSelected = function () { - ctrl.selected = $rootScope.filterArray(ctrl.data, ['isActived'], [true]); - setTimeout(() => { - ctrl.save().then(() => { - ctrl.loadPosts(); - }); - - }, 500); - - }; - ctrl.limString = function (str, max) { - if (str) { - return (str.length > max) ? str.substring(0, max) + ' ...' : str; - } - }; - } - ] -}); -app.component("modalCroppie", { - templateUrl: "/mix-app/views/app-portal/components/modal-croppie/view.html", - bidings: { - resolve: "<", - close: "&", - dismiss: "&", - }, - controller: function () { - var $ctrl = this; - $ctrl.fileUrl = "test"; - $ctrl.$onInit = function () { - $ctrl.file = $ctrl.resolve.file; - }; - - $ctrl.ok = function () { - $ctrl.close({ $value: $ctrl.fileUrl }); - }; - - $ctrl.cancel = function () { - $ctrl.dismiss({ $value: "cancel" }); - }; - }, -}); - -modules.component("modalHelper", { - templateUrl: - "/mix-app/views/app-portal/components/modal-helper/modal-helper.html", - bindings: { - url: "=?", - title: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "localStorageService", - "$routeParams", - "$location", - "$sce", - function ( - $rootScope, - $scope, - localStorageService, - $routeParams, - $location, - $sce - ) { - var ctrl = this; - ctrl.$onInit = function () { - $("#dev-helper-modal").on("shown.bs.modal", function () { - if ($rootScope.helperUrl) { - ctrl.trustedUrl = $sce.trustAsResourceUrl($rootScope.helperUrl); - ctrl.title = "Developer Document"; - } else { - ctrl.loadHelperUrl(); - ctrl.title = "Developer Document"; - } - $rootScope.helperUrl = null; - $scope.$apply(); - }); - }; - ctrl.loadHelperUrl = function () { - var portalUrl = $location.url(); - // var portalabsUrl = $location.absUrl(); - var defaultUrl = "//docs.mixcore.org"; - ctrl.trustedUrl = $sce.trustAsResourceUrl(defaultUrl); - - if (portalUrl.startsWith("/portal")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-administration-screens" - ); - } - if ( - portalUrl.startsWith("/portal/mix-database-data/list?mixDatabaseId=2") - ) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-navigation" - ); - } - if (portalUrl.startsWith("/portal/post")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-writing-posts" - ); - } - if (portalUrl.startsWith("/portal/page")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-page" - ); - } - if (portalUrl.startsWith("/portal/module")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-module" - ); - } - if (portalUrl.startsWith("/portal/mix-database")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-database" - ); - } - if ( - portalUrl.startsWith("/portal/mix-database-data/list?mixDatabaseId=7") - ) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-category" - ); - } - if ( - portalUrl.startsWith("/portal/mix-database-data/list?mixDatabaseId=8") - ) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-tag" - ); - } - if (portalUrl.startsWith("/portal/media")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-media" - ); - } - if (portalUrl.startsWith("/portal/file")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-file" - ); - } - if (portalUrl.startsWith("/portal/user")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-user" - ); - } - if (portalUrl.startsWith("/portal/theme")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-theme" - ); - } - if (portalUrl.startsWith("/portal/app-settings")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-app-settings" - ); - } - if (portalUrl.startsWith("/portal/configuration")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-configuration" - ); - } - if (portalUrl.startsWith("/portal/my-profile")) { - ctrl.trustedUrl = $sce.trustAsResourceUrl( - defaultUrl + "/basic-usage-users-profile" - ); - } - - // switch (portalUrl) { - // case '/portal': - // default: - // ctrl.trustedUrl = $sce.trustAsResourceUrl(defaultUrl); - // break; - // } - }; - }, - ], -}); - -modules.component("modalNavDatas", { - templateUrl: "/mix-app/views/app-portal/components/modal-nav-datas/view.html", - bindings: { - mixDatabaseId: "=?", - mixDatabaseName: "=?", - parentId: "=?", - parentType: "=?", - type: "=?", - fieldDisplay: "=?", - selectedList: "=?", - selectCallback: "&", - save: "&", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestMixDatabaseDataPortalService", - "RestRelatedMixDatabasePortalService", - function ($rootScope, $scope, ngAppSettings, service, navService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.request.key = "readData"; - ctrl.navs = []; - - ctrl.queries = {}; - ctrl.data = { items: [] }; - ctrl.$onInit = function () { - if (!ctrl.selectedList) { - ctrl.selectedList = []; - } - if (ctrl.mixDatabaseId) { - ctrl.request.query = "mixDatabaseId=" + ctrl.mixDatabaseId; - } - if (ctrl.mixDatabaseName) { - ctrl.request.query += "&mixDatabaseName=" + ctrl.mixDatabaseName; - } - }; - ctrl.loadData = async function (pageIndex) { - ctrl.request.query = ""; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - if (ctrl.mixDatabaseId) { - ctrl.request.query = "mixDatabaseId=" + ctrl.mixDatabaseId; - } - if (ctrl.mixDatabaseName) { - ctrl.request.query += "&mixDatabaseName=" + ctrl.mixDatabaseName; - } - Object.keys(ctrl.queries).forEach((e) => { - if (ctrl.queries[e]) { - ctrl.request.query += "&" + e + "=" + ctrl.queries[e]; - } - }); - var response = await service.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - ctrl.navs = []; - angular.forEach(response.data.items, function (e) { - e.disabled = - $rootScope.findObjectByKey(ctrl.selectedList, "id", e.id) != null; - // var item = { - // priority: e.priority, - // description: e.data.title, - // postId: e.id, - // image: e.thumbnailUrl, - // specificulture: e.specificulture, - // status: 'Published', - // isActived: false - // }; - // item[ctrl.srcField] = ctrl.srcId; - // ctrl.navs.push(item); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.select = function (data) { - if (data.isActived) { - if (ctrl.parentId) { - var nav = { - specificulture: data.specificulture, - mixDatabaseName: ctrl.mixDatabaseName, - parentId: ctrl.parentId, - parentType: ctrl.parentType, - id: data.id, - }; - navService.save(nav).then((resp) => { - if (resp.isSucceed) { - var current = $rootScope.findObjectByKey( - ctrl.selectedList, - "id", - data.id - ); - if (!current) { - data.disabled = true; - ctrl.selectedList.push(data); - } - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } else { - var current = $rootScope.findObjectByKey( - ctrl.selectedList, - "id", - data.id - ); - if (!current) { - data.disabled = true; - ctrl.selectedList.push(data); - } - } - } else { - if (ctrl.parentId) { - navService - .delete([ctrl.parentId, ctrl.parentType, data.id]) - .then((resp) => { - if (resp.isSucceed) { - data.disabled = false; - var tmp = $rootScope.findObjectByKey( - ctrl.data.items, - "id", - data.id - ); - if (tmp) { - tmp.disabled = false; - } - $rootScope.removeObjectByKey( - ctrl.selectedList, - "id", - data.id - ); - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } else { - data.disabled = false; - var tmp = $rootScope.findObjectByKey( - ctrl.data.items, - "id", - data.id - ); - if (tmp) { - tmp.disabled = false; - } - $rootScope.removeObjectByKey(ctrl.selectedList, "id", data.id); - } - } - if (ctrl.selectCallback) { - ctrl.selectCallback({ data: data }); - } - }; - ctrl.createData = function () { - var data = { - title: ctrl.newTitle, - slug: $rootScope.generateKeyword(ctrl.newTitle, "-"), - type: ctrl.type, - }; - service.saveByName(ctrl.mixDatabaseName, data).then((resp) => { - if (resp.isSucceed) { - ctrl.data.items.push(resp.data); - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - }; - }, - ], -}); - -modules.component("modalNavMetas", { - templateUrl: "/mix-app/views/app-portal/components/modal-nav-metas/view.html", - bindings: { - header: "=", - mixDatabaseId: "=?", - mixDatabaseName: "=?", - parentId: "=?", - parentType: "=?", - type: "=?", - fieldDisplay: "=?", - isOpen: "=?", - selectedList: "=?", - selectCallback: "&", - save: "&", - }, - controller: [ - "$rootScope", - "$scope", - "$routeParams", - "ngAppSettings", - "RestMixDatabaseDataPortalService", - "RestRelatedAttributeDataPortalService", - "RestMixDatabaseColumnPortalService", - function ( - $rootScope, - $scope, - $routeParams, - ngAppSettings, - dataService, - navService, - fieldService - ) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.request.key = "readData"; - ctrl.navs = []; - - ctrl.queries = {}; - ctrl.data = { items: [] }; - ctrl.$onInit = function () { - if (!ctrl.selectedList) { - ctrl.selectedList = []; - } - angular.forEach(ctrl.selectedList, function (e) { - e.isActived = true; - }); - if (ctrl.mixDatabaseId) { - ctrl.request.mixDatabaseId = ctrl.mixDatabaseId; - } - if (ctrl.mixDatabaseName) { - ctrl.request.mixDatabaseName = ctrl.mixDatabaseName; - } - ctrl.loadDefaultModel(); - }; - ctrl.loadDefaultModel = async function () { - ctrl.defaultNav = { - id: null, - specificulture: navService.lang, - dataId: null, - parentId: ctrl.parentId, - parentType: ctrl.parentType, - mixDatabaseId: ctrl.mixDatabaseId, - mixDatabaseName: ctrl.mixDatabaseName, - status: "Published", - attributeData: null, - }; - if ($routeParams.parentId) { - ctrl.parentId = $routeParams.parentId; - } - if ($routeParams.parentType) { - ctrl.parentType = $routeParams.parentType; - } - if (!ctrl.fields) { - var getFields = await fieldService.initData( - ctrl.mixDatabaseName || ctrl.mixDatabaseId - ); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - $scope.$apply(); - } - } - var getDefault = await dataService.initData( - ctrl.mixDatabaseName || ctrl.mixDatabaseId - ); - ctrl.defaultData = getDefault.data; - if (ctrl.defaultData) { - ctrl.defaultData.mixDatabaseId = ctrl.mixDatabaseId || 0; - ctrl.defaultData.mixDatabaseName = ctrl.mixDatabaseName; - // ctrl.defaultData.parentId = ctrl.parentId; - // ctrl.defaultData.parentType = ctrl.parentType; - } - - if (!ctrl.attrData) { - ctrl.attrData = angular.copy(ctrl.defaultData); - } - }; - ctrl.reload = async function () { - ctrl.newTitle = ""; - ctrl.attrData = angular.copy(ctrl.defaultData); - }; - ctrl.loadData = async function (pageIndex) { - ctrl.request.query = "{}"; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - if (ctrl.mixDatabaseId) { - ctrl.request.mixDatabaseId = ctrl.mixDatabaseId; - } - if (ctrl.mixDatabaseName) { - ctrl.request.mixDatabaseName = ctrl.mixDatabaseName; - } - if (ctrl.type) { - ctrl.request.type = ctrl.type; - } - Object.keys(ctrl.queries).forEach((e) => { - if (ctrl.queries[e]) { - ctrl.request[e] = ctrl.queries[e]; - } - }); - ctrl.request.key = "data"; - var response = await dataService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data.items = []; - ctrl.navs = []; - angular.forEach(response.data.items, function (e) { - // Not show data if there's in selected list - ctrl.data.items.push({ - specificulture: e.specificulture, - mixDatabaseName: ctrl.mixDatabaseName, - parentId: ctrl.parentId, - parentType: ctrl.parentType, - dataId: e.id, - attributeData: e, - }); - }); - ctrl.filterData(); - ctrl.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - ctrl.isBusy = false; - $scope.$apply(); - } - }; - ctrl.filterData = function () { - angular.forEach(ctrl.data.items, function (e) { - // Not show data if there's in selected list - e.disabled = - $rootScope.findObjectByKey(ctrl.selectedList, "dataId", e.dataId) != - null; - e.attributeData.disabled = e.disabled; - }); - }; - ctrl.select = function (nav) { - if (nav.isActived) { - if (!nav.id && ctrl.parentId) { - navService.save(nav).then((resp) => { - if (resp.isSucceed) { - nav.id = resp.data.id; - var current = $rootScope.findObjectByKey( - ctrl.selectedList, - "dataId", - resp.data.dataId - ); - - if (!current) { - nav.disabled = true; - ctrl.selectedList.push(nav); - } - $rootScope.showMessage("success", "success"); - ctrl.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - ctrl.isBusy = false; - $scope.$apply(); - } - }); - } else { - var current = $rootScope.findObjectByKey( - ctrl.data.items, - "id", - nav.id - ); - if (!current) { - current.disabled = true; - } - var selected = $rootScope.findObjectByKey( - ctrl.data.items, - "id", - nav.id - ); - if (!selected) { - ctrl.selectedList.push(nav); - } - } - } else { - if (ctrl.parentId) { - navService.delete([nav.id]).then((resp) => { - if (resp.isSucceed) { - nav.disabled = false; - nav.id = null; - var tmp = $rootScope.findObjectByKey( - ctrl.data.items, - "id", - nav.id - ); - if (tmp) { - tmp.disabled = false; - } - $rootScope.removeObjectByKey(ctrl.selectedList, "id", nav.id); - $rootScope.showMessage("success", "success"); - ctrl.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - ctrl.isBusy = false; - $scope.$apply(); - } - }); - } else { - data.disabled = false; - var tmp = $rootScope.findObjectByKey(ctrl.data.items, "id", nav.id); - if (tmp) { - tmp.disabled = false; - } - $rootScope.removeObjectByKey(ctrl.selectedList, "id", nav.id); - } - } - ctrl.filterData(); - if (ctrl.selectCallback) { - ctrl.selectCallback({ data: nav }); - } - }; - ctrl.createData = function () { - var tmp = $rootScope.findObjectByKey( - ctrl.data.items, - "title", - ctrl.newTitle - ); - if (!tmp) { - ctrl.isBusy = true; - ctrl.attrData.parentId = 0; - ctrl.attrData.parentType = "Set"; - ctrl.attrData.obj.title = ctrl.newTitle; - ctrl.attrData.obj.slug = $rootScope.generateKeyword( - ctrl.newTitle, - "-" - ); - ctrl.attrData.obj.type = ctrl.type; - var nav = angular.copy(ctrl.defaultNav); - nav.attributeData = ctrl.attrData; - navService.save(nav).then((resp) => { - if (resp.isSucceed) { - ctrl.data.items.push(resp.data); - ctrl.reload(); - resp.data.isActived = true; - ctrl.select(resp.data); - ctrl.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(resp.errors); - ctrl.isBusy = false; - $scope.$apply(); - } - }); - } else { - tmp.isActived = true; - ctrl.select(tmp); - } - }; - }, - ], -}); - -modules.component('modalNavPages', { - templateUrl: '/mix-app/views/app-portal/components/modal-nav-pages/view.html', - bindings: { - srcField: '=', - srcId: '=', - query: '=', - selected: '=', - save: '&' - }, - controller: ['$rootScope', '$scope', 'ngAppSettings', 'PageRestService', - function ($rootScope, $scope, ngAppSettings, pageService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.navs = []; - ctrl.data = { items: [] } - ctrl.loadData = async function (pageIndex) { - ctrl.request.query = ctrl.query + ctrl.srcId; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - var response = await pageService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - ctrl.navs = []; - angular.forEach(response.data.items, function (e) { - var item = { - priority: e.priority, - description: e.title, - pageId: e.id, - image: e.thumbnailUrl, - specificulture: e.specificulture, - status: 'Published', - isActived: false - }; - item[ctrl.srcField] = ctrl.srcId; - ctrl.navs.push(item); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.saveSelected = function () { - ctrl.selected = $rootScope.filterArray(ctrl.navs, ['isActived'], [true]); - setTimeout(() => { - ctrl.save().then(() => { - ctrl.loadPages(); - }); - - }, 500); - - } - } - - ], - -}); -modules.component('modalNavPosts', { - templateUrl: '/mix-app/views/app-portal/components/modal-nav-posts/modal-nav-posts.html', - bindings: { - srcField: '=', - srcId: '=', - query: '=', - selected: '=', - save: '&' - }, - controller: ['$rootScope', '$scope', 'ngAppSettings', 'PostRestService', - function ($rootScope, $scope, ngAppSettings, postService) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.navs = []; - ctrl.data = { items: [] } - ctrl.loadPosts = async function (pageIndex) { - ctrl.request.query = ctrl.query + ctrl.srcId; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - var response = await postService.getList(ctrl.request); - if (response.isSucceed) { - ctrl.data = response.data; - ctrl.navs = []; - angular.forEach(response.data.items, function (e) { - var item = { - priority: e.priority, - description: e.title, - postId: e.id, - image: e.thumbnailUrl, - specificulture: e.specificulture, - post: e, - status: 'Published', - isActived: false - }; - item[ctrl.srcField] = ctrl.srcId; - ctrl.navs.push(item); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - ctrl.saveSelected = function () { - ctrl.selected = $rootScope.filterArray(ctrl.navs, ['isActived'], [true]); - console.log(ctrl.selected); - setTimeout(() => { - ctrl.save().then(() => { - ctrl.loadPosts(); - }); - - }, 500); - - } - } - - ] -}); -modules.component('modalNavs', { - templateUrl: '/mix-app/views/app-portal/components/modal-navs/view.html', - bindings: { - modelName: '=', - viewType: '=', - selects: '=', - isSingle: '=?', - isGlobal: '=?', - save: '&' - }, - controller: ['$rootScope', '$scope', '$routeParams', 'ngAppSettings', - function ($rootScope, $scope, $routeParams, ngAppSettings) { - var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.contentStatuses = angular.copy(ngAppSettings.contentStatuses); - ctrl.viewModel = null; - ctrl.data = null; - ctrl.isInit = false; - ctrl.isValid = true; - ctrl.errors = []; - ctrl.selected = []; - - ctrl.init = function () { - ctrl.service = $rootScope.getRestService(ctrl.modelName + '/portal', ctrl.isGlobal); - ctrl.prefix = 'modal_navs_' + ctrl.modelName; - ctrl.cols = ctrl.selects.split(','); - ctrl.getList(); - }; - - ctrl.getList = async function (pageIndex) { - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - var resp = await ctrl.service.getList(ctrl.request); - if (resp.isSucceed) { - ctrl.data = resp.data; - $.each(ctrl.data.items, function (i, data) { - $.each(ctrl.viewModels, function (i, e) { - if (e.dataId === data.id) { - data.isHidden = true; - } - }); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - // ctrl.loadData = async function (pageIndex) { - // ctrl.request.query = ctrl.query + ctrl.srcId; - // if (pageIndex !== undefined) { - // ctrl.request.pageIndex = pageIndex; - // } - // if (ctrl.request.fromDate !== null) { - // var d = new Date(ctrl.request.fromDate); - // ctrl.request.fromDate = d.toISOString(); - // } - // if (ctrl.request.toDate !== null) { - // var d = new Date(ctrl.request.toDate); - // ctrl.request.toDate = d.toISOString(); - // } - // var response = await pageService.getList(ctrl.request); - // if (response.isSucceed) { - // ctrl.data = response.data; - // ctrl.navs = []; - // angular.forEach(response.data.items, function (e) { - // var item = { - // priority: e.priority, - // description: e.title, - // pageId: e.id, - // image: e.thumbnailUrl, - // specificulture: e.specificulture, - // status: 'Published', - // isActived: false - // }; - // item[ctrl.srcField] = ctrl.srcId; - // ctrl.navs.push(item); - // }); - // $rootScope.isBusy = false; - // $scope.$apply(); - // } - // else { - // $rootScope.showErrors(response.errors); - // $rootScope.isBusy = false; - // $scope.$apply(); - // } - // } - ctrl.selectAll = function (isSelectAll) { - angular.forEach(ctrl.data.items, element => { - element.isActived = isSelectAll; - }); - }; - ctrl.selectChange = function (item) { - if (ctrl.isSingle == 'true' && item.isActived) { - angular.forEach(ctrl.data.items, element => { - element.isActived = false; - }); - item.isActived = true; - } - }; - ctrl.saveSelected = function () { - ctrl.selected = $rootScope.filterArray(ctrl.data.items, ['isActived'], [true]); - if (ctrl.save) { - ctrl.save({ selected: ctrl.selected }); - } - }; - } - - ], - -}); -modules.component("modalPermission", { - templateUrl: - "/mix-app/views/app-portal/components/modal-permission/modal-permission.html", - controller: "PermissionController", - bindings: { - message: "=", - }, -}); - -modules.component("monacoEditor", { - templateUrl: "/mix-app/views/app-portal/components/monaco-editor/view.html", - bindings: { - editor: "=?", - content: "=", - defaultContent: "=?", - contentId: "=", - isVisible: "=", - isReadonly: "=?", - lineCount: "=?", - ext: "=", - updateContent: "&", - }, - controller: [ - "$rootScope", - "$scope", - "$element", - function ($rootScope, $scope, $element) { - var ctrl = this; - ctrl.previousId = null; - ctrl.minHeight = 400; - ctrl.isFull = false; - ctrl.id = Math.floor(Math.random() * 100) + 1; - ctrl.$onChanges = (changes) => { - if (changes.content) { - ctrl.updateContent(changes.content); - } - if (changes.isVisible) { - ctrl.updateEditors(); - } - }; - - ctrl.showHelper = function (url) { - $rootScope.showHelper(url); - }; - - this.$doCheck = function () { - if (ctrl.previousId != null && ctrl.previousId !== ctrl.contentId) { - ctrl.previousId = ctrl.contentId; - ctrl.updateContent(ctrl.content); - } - if (ctrl.isVisible && ctrl.editor) { - setTimeout(() => { - var h = ctrl.editor.getModel().getLineCount() * 18; - $($element).height(h); - ctrl.editor.layout(); - }, 200); - } - }.bind(this); - - ctrl.initEditor = function () { - // ctrl.lineCount = parseInt(ctrl.lineCount) || 100; - setTimeout(() => { - ctrl.previousId = ctrl.contentId; - ctrl.updateEditors(); - $scope.$apply(); - }, 300); - }; - - ctrl.updateContent = function (content) { - ctrl.editor.setValue(content); - // lineCount = ctrl.editor.getModel().getLineCount(); - - // var h = ctrl.editor.getModel().getLineCount() * 18; - var h = ctrl.lineCount * 18; - $($element).height(h); - ctrl.editor.layout(); - }; - ctrl.updateEditors = function () { - $.each($($element).find(".code-editor"), function (i, e) { - //var container = $(this); - if (e) { - var model = { - value: ctrl.content || ctrl.defaultContent, - readOnly: ctrl.isReadonly === "true" || false, - - lineNumbers: "on", - roundedSelection: false, - scrollBeyondLastLine: false, - contextmenu: false, - // theme: "vs-dark", - formatOnType: true, - formatOnPaste: true, - // wordWrap: "on", - automaticLayout: true, // the important part - }; - switch (ctrl.ext) { - case ".json": - case ".webmanifest": - model.language = "json"; - break; - case ".js": - model.language = "javascript"; - break; - case ".css": - model.language = "css"; - break; - case ".cshtml": - model.language = "razor"; - break; - case ".cs": - model.language = "csharp"; - break; - default: - model.language = "razor"; - break; - } - ctrl.editor = monaco.editor.create(e, model); - - ctrl.editor.getModel().onDidChangeContent(() => { - ctrl.content = ctrl.editor.getModel().getValue(); - ctrl.updateContent({ content: ctrl.content }); - }); - ctrl.editor.addCommand( - monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, - function () { - var btn = document.getElementById("btnToSubmit"); - btn.click(); - } - ); - - if (ctrl.isFull) { - $(e).height(window.innerHeight); - } else { - $(e).height(ctrl.minHeight); - } - - // setTimeout(() => { - // // var h = ctrl.editor.getModel().getLineCount() * 18; - // // h = h < ctrl.minHeight ? ctrl.minHeight : h; - // var h = ctrl.lineCount * 20; - // $(e).height(h); - // ctrl.editor.layout(); - // }, 200); - } - }); - }; - - ctrl.fullscreen = function (event) { - // const element = $(event.target).parents(".monaco-editor"); - - // event.target.addEventListener('click', () => { - // if (screenfull.isEnabled) { - // screenfull.request(element); - // } - // }); - // $.each($($element).find('.code-editor'), function (i, e) { - // //var container = $(this); - // if (e) {} - // }); - // console.log($(event.target)); - - $(event.target) - .parents(".monaco-editor") - .toggleClass("monaco-editor-full"); - - ctrl.isFull = !ctrl.isFull; - - ctrl.editor.dispose(); - - // var h; - - // ctrl.editor.dispose(); - // if ($(".monaco-editor.container-code-editor.monaco-editor-full")[0]) { - // // Do something if class exists - // h = window.innerHeight; - // $( - // ".monaco-editor.container-code-editor.monaco-editor-full .code-editor" - // ).height(h); - // document.body.style.overflow = "hidden"; - // } else { - // // Do something if class does not exist - // h = ctrl.lineCount * 20; - // $(".monaco-editor .code-editor").height(h); - // document.body.style.overflow = "visible"; - // } - // ctrl.editor.layout(); - - ctrl.updateEditors(); - }; - }, - ], -}); - -modules.component('navs', { - templateUrl: '/mix-app/views/app-portal/components/navigations/navigations.html', - bindings: { - prefix: '=', - detailsUrl: '=', - key: '=', - data: '=', - titleField: '=?', - titleMaxLength: '=?', - callback: '&' - }, - controller: ['$scope', '$location', function ($scope, $location) { - var ctrl = this; - ctrl.selected = null; - ctrl.activedIndex = null; - ctrl.getTitle = (item) => { - if (ctrl.titleField) { - let t = item; - angular.forEach(ctrl.titleField.split('.'), (e) => { - t = t[e]; - }); - return ctrl.limString(t, ctrl.titleMaxLength || 30); - } - else { - return ctrl.limString(item.description, ctrl.titleMaxLength || 30); - } - } - ctrl.updateOrders = function (index) { - ctrl.data.splice(index, 1); - for (var i = 0; i < ctrl.data.length; i++) { - ctrl.data[i].priority = i + 1; - } - }; - ctrl.dropCallback = function (index, item, external, type) { - ctrl.logListEvent('dropped at', index, external, type); - for (var i = 0; i < ctrl.data.length; i++) { - ctrl.data[i].priority = i + 1; - } - // Return false here to cancel drop. Return true if you insert the item yourself. - return item; - }; - ctrl.logListEvent = function (action, index, external, type) { - var message = external ? 'External ' : ''; - message += type + ' element was ' + action + ' position ' + index; - }; - ctrl.goToDetails = async function (nav) { - $location.url(ctrl.detailsUrl + nav[ctrl.key]); - }; - ctrl.limString = function (str, max) { - if (str) { - return (str.length > max) ? str.substring(0, max) + ' ...' : str; - } - }; - }] -}); -modules.component('portalThemeSettings', { - templateUrl: '/mix-app/views/app-portal/components/portal-theme-settings/view.html', - bindings: { - showLink: '=' - }, - controller: ['$rootScope', '$scope', 'AppSettingsServices', - function ($rootScope, $scope, appSettingsServices) { - var ctrl = this; - this.$onInit = function () { - ctrl.portalThemeSettings = $rootScope.globalSettings.portalThemeSettings; - } - ctrl.applyThemeSettings = function () { - $rootScope.globalSettings.portalThemeSettings = ctrl.portalThemeSettings; - } - ctrl.saveThemeSettings = async function () { - var resp = await appSettingsServices.saveGlobalSettings('PortalThemeSettings', ctrl.portalThemeSettings); - if (resp && resp.isSucceed) { - $rootScope.showMessage('success', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $scope.$apply(); - } - } - }] -}); -modules.component('propertiesStructure', { - templateUrl: '/mix-app/views/app-portal/components/properties-structure/view.html', - controller: ['$rootScope', '$scope', - function ($rootScope, $scope) { - var ctrl = this; - ctrl.selectedCol = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.defaultAttr = { - title: '', - name: '', - defaultValue: null, - options: [], - priority: 0, - dataType: 'Text', - isGroupBy: false, - isSelect: false, - isDisplay: true, - width: 3 - }; - - ctrl.addAttr = function () { - if (ctrl.columns) { - var t = angular.copy(ctrl.defaultAttr); - ctrl.columns.push(t); - } - }; - - ctrl.addOption = function (col, index) { - var val = $('#option_' + index).val(); - col.options.push(val); - $('#option_' + index).val(''); - }; - ctrl.generateForm = function () { - var formHtml = document.createElement('module-form'); - formHtml.setAttribute('class', 'row'); - angular.forEach(ctrl.viewModel.columns, function (e, i) { - var el; - var label = document.createElement('label'); - label.setAttribute('class', 'control-label'); - label.setAttribute('ng-bind', '{{data.title}}'); - - switch (e.dataType) { - case 'datetime': - el = document.createElement('input'); - el.setAttribute('type', 'datetime-local'); - break; - - case 'date': - el = document.createElement('input'); - el.setAttribute('type', 'date'); - break; - - case 'time': - el = document.createElement('input'); - el.setAttribute('type', 'time'); - break; - - case 'phonenumber': - el = document.createElement('input'); - el.setAttribute('type', 'tel'); - break; - - case 'integer': - el = document.createElement('input'); - el.setAttribute('type', 'number'); - break; - - case 'html': - el = document.createElement('quill'); - el.setAttribute('options', '{}'); - el.setAttribute('type', 'number'); - break; - - case 'multilinetext': - el = document.createElement('textarea'); - break; - - default: - el = document.createElement('input'); - el.setAttribute('type', 'text'); - formHtml.appendChild(el); - break; - } - el.setAttribute('ng-model', 'data.jItem[' + e.name + '].value'); - el.setAttribute('placeholder', '{{$ctrl.title}}'); - formHtml.appendChild(label); - formHtml.appendChild(el); - - }); - ctrl.viewModel.formView.content = formHtml.innerHTML; - }; - - ctrl.generateName = function (col) { - col.name = $rootScope.generateKeyword(col.title, '_'); - } - ctrl.removeAttr = function (index) { - if (ctrl.columns) { - ctrl.columns.splice(index, 1); - } - } - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.columns.splice(ctrl.dragStartIndex, 1); - } else { - ctrl.columns.splice(ctrl.dragStartIndex + 1, 1); - } - angular.forEach(ctrl.columns, function (e, i) { - e.priority = i; - }); - }; - }], - bindings: { - header: '=', - columns: '=' - } -}); -modules.component('propertiesValue', { - templateUrl: '/mix-app/views/app-portal/components/properties-value/view.html', - bindings: { - title: '=', - columns: '=', - properties: '=' - }, - controller: ['$rootScope', '$scope', - function ($rootScope, $scope) { - var ctrl = this; - ctrl.defaultAttr = { - title: '', - name: '', - default: null, - options: [], - priority: 0, - dataType: 7, - isGroupBy: false, - isSelect: false, - isDisplay: true, - width: 3 - }; - ctrl.selectedProp = null; - ctrl.settings = $rootScope.globalSettings; - - ctrl.$doCheck = function () { - if (angular.toJson(ctrl.columns) != angular.toJson(ctrl.trackedColumns)) { - ctrl.trackedColumns = angular.copy(ctrl.columns); - ctrl.trackedProperties = angular.copy(ctrl.properties); - ctrl.loadEditors(); - } - }.bind(ctrl); - - ctrl.loadEditors = function () { - ctrl.properties = []; - for (let i = 0; i < ctrl.columns.length; i++) { - var col = ctrl.columns[i]; - var oldObj = $rootScope.findObjectByKey(ctrl.trackedProperties, 'name', col.name) || {}; - - ctrl.properties.push({ - title: col.title, - name: col.name, - dataType: col.dataType, - value: oldObj.value || col.defaultValue, - options: col.options - }); - - } - }; - - ctrl.addAttr = function () { - if (ctrl.columns) { - var t = angular.copy(ctrl.defaultAttr); - ctrl.columns.push(t); - } - }; - }] -}); - -modules.component('relatedNavs', { - templateUrl: '/mix-app/views/app-portal/components/related-navigations/view.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', '$q', function ($rootScope, $scope, ngAppSettings, $q) { - var ctrl = this; - ctrl.selected = null; - ctrl.activeItem = function (item) { - var currentItem = $rootScope.findObjectByKey(ctrl.navs, ['sourceId', 'destinationId'] - , [ctrl.sourceId, item.id]); - if (currentItem === null) { - currentItem = item; - currentItem.priority = ctrl.navs.length + 1; - ctrl.navs.push(currentItem); - } - }; - ctrl.updateOrders = function (index) { - ctrl.data.splice(index, 1); - for (var i = 0; i < ctrl.data.length; i++) { - ctrl.data[i].priority = i + 1; - } - }; - ctrl.load = function (pageIndex) { - if (pageIndex) { - ctrl.request.pageIndex = pageIndex; - } - ctrl.loadData({ pageIndex: ctrl.request.pageIndex }); - }; - ctrl.checkActived = function (item) { - if (ctrl.navs) { - return ctrl.navs.find(function (nav) { - return nav.destinationId === item.id; - }); - } - }; - }], - bindings: { - request: '=', - prefix: '=', - sourceId: '=', - culture: '=', - navs: '=', - data: '=', - loadData: '&' - } -}); -modules.component("serviceHubPortal", { - templateUrl: - "/mix-app/views/app-portal/components/service-hub-portal/view.html", - bindings: { - mixDatabaseName: "=", - isSave: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabaseColumnPortalService", - "RestMixDatabaseDataClientService", - "UserServices", - function ($rootScope, $scope, fieldService, service, userServices) { - var ctrl = this; - BaseHub.call(this, ctrl); - ctrl.settings = $rootScope.globalSettings; - ctrl.user = { - loggedIn: false, - connection: {}, - }; - ctrl.attrData = null; - ctrl.isHide = true; - ctrl.hideContact = true; - ctrl.fields = []; - ctrl.members = []; - ctrl.errors = []; - ctrl.messages = { - items: [], - }; - ctrl.message = { connection: {}, content: "" }; - ctrl.request = { - uid: "", - specificulture: "", - action: "", - objectType: null, - data: {}, - room: "", - isMyself: true, - isSave: false, - }; - ctrl.init = function () { - ctrl.mixDatabaseId = ctrl.mixDatabaseId || 0; - ctrl.request.specificulture = service.lang; - ctrl.request.room = ctrl.mixDatabaseName; - ctrl.request.isSave = ctrl.isSave == "true" || false; - ctrl.startConnection("serviceHub", ctrl.checkLoginStatus); - }; - ctrl.loadData = async function () { - /* - If input is data id => load ctrl.attrData from service and handle it independently - Else modify input ctrl.attrData - */ - $rootScope.isBusy = true; - var getDefault = await service.initData(ctrl.mixDatabaseName); - if (getDefault.isSucceed) { - ctrl.defaultData = getDefault.data; - ctrl.defaultData.data.user_name = ctrl.user.connection.name; - ctrl.defaultData.data.user_id = ctrl.user.connection.id; - ctrl.defaultData.data.user_avatar = ctrl.user.connection.avatar; - ctrl.defaultData.data.data_type = 9; - ctrl.attrData = angular.copy(ctrl.defaultData); - $rootScope.isBusy = false; - } - var getFields = await fieldService.initData(ctrl.mixDatabaseName); - if (getFields.isSucceed) { - ctrl.fields = getFields.data; - } - }; - ctrl.submit = async function () { - if (ctrl.validate()) { - ctrl.request.action = "send_group_message"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.attrData.data; - ctrl.request.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - ctrl.attrData = angular.copy(ctrl.defaultData); - } - }; - ctrl.validate = function () { - var isValid = true; - ctrl.errors = []; - angular.forEach(ctrl.fields, function (field) { - if (field.regex) { - var regex = RegExp(field.regex, "g"); - isValid = regex.test(ctrl.attrData.data[field.name]); - if (!isValid) { - ctrl.errors.push(`${field.name} is not match Regex`); - } - } - if (isValid && field.isEncrypt) { - ctrl.attrData.data[field.name] = $rootScope.encrypt( - ctrl.attrData.data[field.name] - ); - } - }); - return isValid; - }; - ctrl.receiveMessage = function (msg) { - switch (msg.responseKey) { - case "NewMember": - ctrl.newMember(msg.data); - // $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - case "NewMessage": - ctrl.newMessage(msg.data); - break; - case "ConnectSuccess": - ctrl.user.loggedIn = true; - ctrl.initListMember(msg.data); - $scope.$apply(); - break; - case "PreviousMessages": - ctrl.messages = msg.data; - $scope.$apply(); - break; - case "MemberOffline": - ctrl.removeMember(msg.data); - break; - case "Error": - console.error(msg.data); - break; - } - }; - ctrl.newMessage = function (msg) { - ctrl.messages.items.push(msg); - $scope.$apply(); - }; - ctrl.newMember = function (member) { - var m = $rootScope.findObjectByKey(ctrl.members, "id", member.id); - if (!m) { - ctrl.members.push(member); - } - $scope.$apply(); - }; - ctrl.join = async function () { - ctrl.request.action = "join_group"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.user.connection; - ctrl.message.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - await ctrl.loadData(); - $scope.$apply(); - }; - ctrl.initListMember = function (data) { - data.forEach((member) => { - var index = ctrl.members.findIndex((x) => x.id === member.id); - if (index < 0) { - ctrl.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - }; - - ctrl.checkLoginStatus = async function () { - var response = await userServices.getMyProfile(); - ctrl.user.connection.name = response.data.username; - ctrl.user.connection.id = response.data.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = response.data.avatar; - ctrl.user.loggedIn = true; - ctrl.join(); - }; - }, - ], -}); - -modules.component('templateEditor', { - templateUrl: '/mix-app/views/app-portal/components/template-editor/templateEditor.html', - bindings: { - template: '=', - templates: '=', - folderType: '=', - isReadonly: '=?', - lineCount: '=?', - hideJs: '=?', - hideCss: '=?', - enableRename: '=?', - }, - controller: ['$scope', '$rootScope', '$routeParams', 'ngAppSettings', 'GlobalSettingsService', 'TemplateService', - function ($scope, $rootScope, $routeParams, ngAppSettings, globalSettingsService, service) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - var ctrl = this; - ctrl.isNull = false; - ctrl.selectPane = function (pane) { - ctrl.activedPane = pane; - }; - ctrl.selectTemplate = function (template) { - ctrl.template = template; - $scope.$broadcast('updateContentCodeEditors', []); - }; - ctrl.new = function () { - ctrl.template.id = 0; - } - ctrl.init = async function () { - if (!ctrl.template && ctrl.templates) { - ctrl.template = ctrl.templates[0]; - } - if (ctrl.folderType && !ctrl.folderType) { - var themeId = globalSettingsService.get('themeId'); - var resp = await service.getSingle(['portal', themeId, ctrl.folderType]); - if (resp && resp.isSucceed) { - resp.data.fileName = 'new'; - ctrl.templates.splice(0, 0, resp.data); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); $rootScope.isBusy = false; $scope.$apply(); } - } - - } - } - }] -}); - -modules.component("toastHelper", { - templateUrl: "/mix-app/views/app-portal/components/toast-helper/toast-helper.html", - bindings: { - url: "=?", - title: "=?", - }, - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.visible = $rootScope.visible; - }, - ], -}); - - -modules.component('urlAlias', { - templateUrl: '/mix-app/views/app-portal/components/url-alias/url-alias.html', - controller: ['$rootScope', '$scope', 'UrlAliasService', - function ($rootScope, $scope, service) { - var ctrl = this; - ctrl.$onInit = function () { - ctrl.updateUrl(); - } - ctrl.updateUrl = function () { - ctrl.url = $rootScope.globalSettings.domain + '/' - + $rootScope.settings.lang + '/' + ctrl.urlAlias.alias; - } - ctrl.remove = function () { - if (ctrl.urlAlias.id > 0) { - $rootScope.showConfirm(ctrl, 'removeConfirmed', [ctrl.urlAlias.id], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - } else { - if (ctrl.removeCallback) { - ctrl.removeCallback({ index: ctrl.index }); - } - } - }; - - ctrl.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete(id); - if (result.isSucceed) { - if (ctrl.removeCallback) { - ctrl.removeCallback({ index: ctrl.index }); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - }], - bindings: { - urlAlias: '=', - index: '=', - callback: '&', - removeCallback: '&', - } -}); -!function (t) { var e = {}; function i(n) { if (e[n]) return e[n].exports; var s = e[n] = { i: n, l: !1, exports: {} }; return t[n].call(s.exports, s, s.exports, i), s.l = !0, s.exports } i.m = t, i.c = e, i.d = function (t, e, n) { i.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }) }, i.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, i.t = function (t, e) { if (1 & e && (t = i(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if (i.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var s in t) i.d(n, s, function (e) { return t[e] }.bind(null, s)); return n }, i.n = function (t) { var e = t && t.__esModule ? function () { return t.default } : function () { return t }; return i.d(e, "a", e), e }, i.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, i.p = "", i(i.s = 40) }({ 40: function (t, e) { gapi.analytics.ready(function () { gapi.analytics.createComponent("ActiveUsers", { initialize: function () { this.activeUsers = 0, gapi.analytics.auth.once("signOut", this.handleSignOut_.bind(this)) }, execute: function () { this.polling_ && this.stop(), this.render_(), gapi.analytics.auth.isAuthorized() ? this.pollActiveUsers_() : gapi.analytics.auth.once("signIn", this.pollActiveUsers_.bind(this)) }, stop: function () { clearTimeout(this.timeout_), this.polling_ = !1, this.emit("stop", { activeUsers: this.activeUsers }) }, render_: function () { var t = this.get(); this.container = "string" == typeof t.container ? document.getElementById(t.container) : t.container, this.container.innerHTML = t.template || this.template, this.container.querySelector("b").innerHTML = this.activeUsers }, pollActiveUsers_: function () { var t = this.get(), e = 1e3 * (t.pollingInterval || 5); if (isNaN(e) || e < 5e3) throw new Error("Frequency must be 5 seconds or more."); this.polling_ = !0, gapi.client.analytics.data.realtime.get({ ids: t.ids, metrics: "rt:activeUsers" }).then(function (t) { var i = t.result, n = i.totalResults ? +i.rows[0][0] : 0, s = this.activeUsers; this.emit("success", { activeUsers: this.activeUsers }), n != s && (this.activeUsers = n, this.onChange_(n - s)), 1 == this.polling_ && (this.timeout_ = setTimeout(this.pollActiveUsers_.bind(this), e)) }.bind(this)) }, onChange_: function (t) { var e = this.container.querySelector("b"); e && (e.innerHTML = this.activeUsers), this.emit("change", { activeUsers: this.activeUsers, delta: t }), t > 0 ? this.emit("increase", { activeUsers: this.activeUsers, delta: t }) : this.emit("decrease", { activeUsers: this.activeUsers, delta: t }) }, handleSignOut_: function () { this.stop(), gapi.analytics.auth.once("signIn", this.handleSignIn_.bind(this)) }, handleSignIn_: function () { this.pollActiveUsers_(), gapi.analytics.auth.once("signOut", this.handleSignOut_.bind(this)) }, template: '
Active Users:
' }) }) } }); -//# sourceMappingURL=active-users.js.map \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-security.min.js b/src/Mix.Cms.Web/wwwroot/mix-app/js/app-security.min.js deleted file mode 100644 index 314205692..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-security.min.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; -var app = angular.module('MixPortal', - ['ngRoute', 'ngFileUpload', 'LocalStorageModule', 'components']); -var modules = angular.module('components', []); -app.config(function ($routeProvider, $locationProvider, $sceProvider) { - $locationProvider.html5Mode(true); - - $routeProvider.when("/security/login", { - controller: "LoginController", - templateUrl: "/mix-app/views/app-security/pages/login/view.html" - }); - - - $routeProvider.when("/security/register", { - controller: "RegisterController", - templateUrl: "/mix-app/views/app-security/pages/register/view.html" - }); - $routeProvider.when("/security/forgot-password", { - controller: "ForgotPasswordController", - templateUrl: "/mix-app/views/app-security/pages/forgot-password/view.html" - }); - $routeProvider.when("/security/reset-password", { - controller: "ResetPasswordController", - templateUrl: "/mix-app/views/app-security/pages/reset-password/view.html" - }); - - $routeProvider.otherwise({ redirectTo: "/security/login" }); -}); - -'use strict'; -app.controller('LoginController', ['$rootScope', '$scope', '$routeParams', '$location', 'AuthService', - function ($rootScope, $scope, $routeParams, $location, authService) { - if (authService.authentication && authService.authentication.isAuth && authService.authentication && authService.authentication.isAdmin) { - authService.referredUrl = $location.path(); - $location.path('/portal'); - } - - $scope.pageClass = 'page-login'; - - $scope.loginData = { - userName: "", - password: "", - rememberMe: false - }; - - $scope.message = ""; - $scope.$on('$viewContentLoaded', function () { - $rootScope.isBusy = false; - }); - $scope.login = async function () { - var result = await authService.login($scope.loginData); - if (result) { - $rootScope.isBusy = false; - $scope.message = result.errors[0]; - $scope.$apply(); - } - - }; - - $scope.authExternalProvider = function (provider) { - - var redirectUri = location.protocol + '//' + location.host + '/authcomplete.html'; - - var externalProviderUrl = ngAuthSettings.apiServiceBaseUri + "api/Account/ExternalLogin?provider=" + provider - + "&response_type=token&client_id=" + ngAuthSettings.clientId - + "&redirect_uri=" + redirectUri; - window.$windowScope = $scope; - - var oauthWindow = window.open(externalProviderUrl, "Authenticate Account", "location=0,status=0,width=600,height=750"); - }; - - $scope.authCompletedCB = function (fragment) { - - $scope.$apply(function () { - - if (fragment.haslocalaccount === 'False') { - - authService.logOut(); - - authService.externalAuthData = { - provider: fragment.provider, - userName: fragment.external_user_name, - externalAccessToken: fragment.external_access_token - }; - - $location.path('/associate'); - - } - else { - //Obtain access token and redirect to orders - var externalData = { provider: fragment.provider, externalAccessToken: fragment.external_access_token }; - authService.obtainAccessToken(externalData).then(function (response) { - - $location.path('/orders'); - - }, - function (err) { - $scope.message = err.error_description; - }); - } - - }); - } - }]); -'use strict'; -app.controller('ForgotPasswordController', ['$rootScope', '$scope', 'ngAppSettings', '$location', 'AuthService', function ($rootScope, $scope, ngAppSettings, $location, authService) { - if (authService.authentication && authService.authentication.isAuth && authService.authentication && authService.authentication.isAdmin) { - authService.referredUrl = $location.path(); - $location.path('/portal'); - } - $scope.pageClass = 'page-forgot-password'; - $scope.isSucceed = false; - $scope.viewModel = { - email: null - }; - - $scope.message = ""; - $scope.$on('$viewContentLoaded', function () { - $rootScope.isBusy = false; - authService.referredUrl = "/security/login"; - }); - $scope.submit = async function () { - - var result = await authService.forgotPassword($scope.viewModel); - if (result.isSucceed) { - $rootScope.isBusy = false; - $scope.isSucceed = true; - $scope.$apply(); - } - else { - $rootScope.isBusy = false; - $rootScope.showErrors(result.errors); - } - }; - - $scope.authExternalProvider = function (provider) { - - var redirectUri = location.protocol + '//' + location.host + '/authcomplete.html'; - - var externalProviderUrl = ngAuthSettings.apiServiceBaseUri + "api/Account/ExternalLogin?provider=" + provider - + "&response_type=token&client_id=" + ngAuthSettings.clientId - + "&redirect_uri=" + redirectUri; - window.$windowScope = $scope; - - var oauthWindow = window.open(externalProviderUrl, "Authenticate Account", "location=0,status=0,width=600,height=750"); - }; - - $scope.authCompletedCB = function (fragment) { - - $scope.$apply(function () { - - if (fragment.haslocalaccount === 'False') { - - authService.logOut(); - - authService.externalAuthData = { - provider: fragment.provider, - userName: fragment.external_user_name, - externalAccessToken: fragment.external_access_token - }; - - $location.path('/associate'); - - } - else { - //Obtain access token and redirect to orders - var externalData = { provider: fragment.provider, externalAccessToken: fragment.external_access_token }; - authService.obtainAccessToken(externalData).then(function (response) { - - $location.path('/orders'); - - }, - function (err) { - $scope.message = err.error_description; - }); - } - - }); - } -}]); -'use strict'; -app.controller('RegisterController', - ['$scope', '$rootScope', 'RegisterServices', - function ($scope, $rootScope, services) { - $scope.user = { - userName: '', - email: '', - password: '', - confirmPassword: '', - isAgreed: false - } - $scope.register = async function () { - if (!$scope.user.isAgreed) { - $rootScope.showMessage('Please agreed with our policy', 'warning'); - } else { - if ($scope.password !== $scope.confirmPassword) { - $rootScope.showErrors(['Confirm Password is not matched']); - } else { - $rootScope.isBusy = true; - var result = await services.register($scope.user); - if (result.isSucceed) { - $rootScope.isBusy = false; - window.location.href = '/security/login'; - } else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } - } - }]); -'use strict'; -app.factory('RegisterServices', ['$http', 'CommonService', function ($http, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var usersServiceFactory = {}; - var apiUrl = '/portal/'; - var _register = async function (user) { - var apiUrl = '/account/register'; - var req = { - method: 'POST', - url: apiUrl, - data: JSON.stringify(user) - }; - - return await commonService.getApiResult(req); - }; - - usersServiceFactory.register = _register; - return usersServiceFactory; - -}]); - -'use strict'; -app.controller('ResetPasswordController', - ['$scope', '$rootScope', 'AuthService', '$routeParams', - function ($scope, $rootScope, service, $routeParams) { - $scope.user = { - email: '', - password: '', - confirmPassword: '', - code: '', - } - $scope.init = function () { - $scope.user.code = $routeParams.token; - }; - $scope.submit = async function () { - - if ($scope.password !== $scope.confirmPassword) { - $rootScope.showErrors(['Confirm Password is not matched']); - } else { - $rootScope.isBusy = true; - var result = await service.resetPassword($scope.user); - if (result.isSucceed) { - $rootScope.isBusy = false; - window.location.href = '/security/login'; - } else { - if (result) { - $rootScope.showErrors(result.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } - }]); -'use strict'; -app.factory('RegisterServices', ['$http', 'CommonService', function ($http, commonService) { - - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var usersServiceFactory = {}; - var apiUrl = '/portal/'; - var _register = async function (user) { - var apiUrl = '/account/register'; - var req = { - method: 'POST', - url: apiUrl, - data: JSON.stringify(user) - }; - - return await commonService.getApiResult(req); - }; - - usersServiceFactory.register = _register; - return usersServiceFactory; - -}]); diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-shared.min.js b/src/Mix.Cms.Web/wwwroot/mix-app/js/app-shared.min.js deleted file mode 100644 index 8ce860546..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/js/app-shared.min.js +++ /dev/null @@ -1,15095 +0,0 @@ -app.constant("AppSettings", { - serviceBase: "", - apiVersion: "v1", -}); -app.constant("ngAppSettings", { - serviceBase: "", - clientId: "ngAuthApp", - facebookAppId: "464285300363325", - request: { - pageSize: "20", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - key: "", - query: "{}", - }, - restRequest: { - pageSize: "20", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - query: "{}", - }, - privacies: ["VND", "USD"], - pageSizes: ["", "5", "10", "15", "20"], - directions: [ - { - value: "Asc", - title: "Asc", - }, - { - value: "Desc", - title: "Desc", - }, - ], - orders: [ - { - value: "CreatedDateTime", - title: "Created Date", - }, - { - value: "Priority", - title: "Priority", - }, - - { - value: "Title", - title: "Title", - }, - ], - contentStatuses: ["Deleted", "Preview", "Published", "Draft", "Schedule"], - dataTypes: [ - { - title: "Custom", - value: "Custom", - }, - { - title: "DateTime", - value: "DateTime", - }, - { - title: "Date", - value: "Date", - }, - { - title: "Time", - value: "Time", - }, - { - title: "Duration", - value: "Duration", - }, - { - title: "Phone Number", - value: "PhoneNumber", - }, - { - title: "Currency", - value: "Currency", - }, - { - title: "Text", - value: "Text", - }, - { - title: "Html", - value: "Html", - }, - { - title: "Multiline Text", - value: "MultilineText", - }, - { - title: "Email Address", - value: "EmailAddress", - }, - { - title: "Password", - value: "Password", - }, - { - title: "Url", - value: "Url", - }, - { - title: "Image Url", - value: "ImageUrl", - }, - { - title: "Credit Card", - value: "CreditCard", - }, - { - title: "PostalCode", - value: "PostalCode", - }, - { - title: "Upload", - value: "Upload", - }, - { - title: "Color", - value: "Color", - }, - { - title: "Boolean", - value: "Boolean", - }, - { - title: "Icon", - value: "Icon", - }, - { - title: "Video Youtube", - value: "VideoYoutube", - }, - { - title: "Tui Editor", - value: "TuiEditor", - }, - { - title: "Integer", - value: "Integer", - }, - { - title: "QR Code", - value: "QRCode", - }, - { - title: "Reference", - value: "Reference", - }, - ], - icons: [], -}); -app.run([ - "$http", - "$rootScope", - "ngAppSettings", - "$location", - "BaseRestService", - "CommonService", - "AuthService", - "TranslatorService", - function ( - $http, - $rootScope, - ngAppSettings, - $location, - baseRestService, - commonService, - authService, - translatorService - ) { - $rootScope.currentContext = $rootScope; - $rootScope.isBusy = false; - $rootScope.translator = translatorService; - $rootScope.errors = []; - $rootScope.breadCrumbs = []; - $rootScope.message = { - title: "", - content: "", - errors: [], - okFuncName: null, - okArgs: [], - cancelFuncName: null, - cancelArgs: [], - lblOK: "OK", - lblCancel: "Cancel", - context: $rootScope, - }; - - $rootScope.isBusy = false; - $rootScope.translator = translatorService; - $rootScope.message = { - title: "test", - content: "", - errors: [], - okFuncName: null, - okArgs: [], - cancelFuncName: null, - cancelArgs: [], - lblOK: "OK", - lblCancel: "Cancel", - context: $rootScope, - }; - $rootScope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - - $rootScope.generateKeyword = function (src, character) { - if (src) { - src = $rootScope.parseUnsignString(src); - return ( - src - .replace(/[^a-zA-Z0-9]+/g, character) - .replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2") - .replace(/([a-z])([A-Z])/g, "$1-$2") - // .replace(/([0-9])([^0-9])/g, "$1-$2") - // .replace(/([^0-9])([0-9])/g, "$1-$2") - .replace(/-+/g, character) - .toLowerCase() - ); - } - }; - - $rootScope.generatePhone = function (src) { - return src.replace(/^([0-9]{3})([0-9]{3})([0-9]{4})$/, "($1) $2-$3"); - }; - $rootScope.parseUnsignString = function (str) { - str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a"); - str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e"); - str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i"); - str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o"); - str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, "u"); - str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, "y"); - str = str.replace(/đ/g, "d"); - str = str.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A"); - str = str.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/g, "E"); - str = str.replace(/Ì|Í|Ị|Ỉ|Ĩ/g, "I"); - str = str.replace(/Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ/g, "O"); - str = str.replace(/Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ/g, "U"); - str = str.replace(/Ỳ|Ý|Ỵ|Ỷ|Ỹ/g, "Y"); - str = str.replace(/Đ/g, "D"); - return str; - }; - $rootScope.logOut = function () { - authService.logOut(); - }; - - $rootScope.updateSettings = function () { - commonService.removeSettings(); - commonService - .fillSettings($rootScope.globalSettings.lang) - .then(function (response) { - $rootScope.globalSettings = response; - }); - $rootScope.isBusy = false; - }; - $rootScope.executeFunctionByName = async function ( - functionName, - args, - context = window - ) { - if (functionName !== null) { - var namespaces = functionName.split("."); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } - functionName = null; - return context[func].apply(this, args); - } - }; - - $rootScope.showConfirm = function ( - context, - okFuncName, - okArgs, - cancelFuncName, - title, - msg, - cancelArgs, - lblOK, - lblCancel - ) { - $rootScope.confirmMessage = { - title: title, - content: msg, - context: context, - okFuncName: okFuncName, - okArgs: okArgs, - cancelFuncName: cancelFuncName, - cancelArgs: cancelArgs, - lblOK: lblOK ? lblOK : "OK", - lblCancel: lblCancel ? lblCancel : "Cancel", - }; - - $("#dlg-confirm-msg").modal("show"); - }; - - $rootScope.preview = function (type, data, title, size, objClass) { - $rootScope.previewObject = { - title: title || "Preview", - size: size || "modal-md", - objClass: objClass, - type: type, - data: data, - }; - $("#dlg-preview-popup").modal("show"); - }; - - $rootScope.initEditors = function () { - setTimeout(function () { - $.each($(".code-editor"), function (i, e) { - var container = $(this); - var editor = ace.edit(e); - if (container.hasClass("json")) { - editor.session.setMode("ace/mode/json"); - } else { - editor.session.setMode("ace/mode/razor"); - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - editor.$blockScrolling = Infinity; - editor.session.setUseWrapMode(true); - editor.setOptions({ - maxLines: Infinity, - }); - editor.getSession().on("change", function (e) { - // e.type, etc - $(container).parent().find(".code-content").val(editor.getValue()); - }); - }); - }, 200); - }; - - $rootScope.showErrors = function (errors) { - if (errors.length) { - $.each(errors, function (i, e) { - $rootScope.showMessage(e, "danger"); - }); - } else { - $rootScope.showMessage("Server Errors", "danger"); - } - }; - $rootScope.shortString = function (msg, max) { - var data = decodeURIComponent(msg); - if (data) { - if (max < data.length) { - return data.replace(/[+]/g, " ").substr(0, max) + " ..."; - } else { - return data.replace(/[+]/g, " "); - } - } - }; - $rootScope.showMessage = function (content, type) { - // $rootScope.toast = new bootstrap.Toast(document.getElementById('toast-msg')); - // $rootScope.toastMsg= content; - // $rootScope.toast.show(); - var from = "bottom"; - var align = "right"; - if ($ && $.notify) { - $.notify( - { - icon: "fas fa-bell", - message: $rootScope.translate(content), - }, - { - type: type, - timer: 2000, - placement: { - from: from, - align: align, - }, - } - ); - } else { - alert(content); - } - }; - $rootScope.encrypt = function (message) { - var keySize = 256; - var ivSize = 128; - var iterations = 100; - var salt = CryptoJS.lib.WordArray.random(128 / 8); - var pass = "secret-key"; - var key = CryptoJS.PBKDF2(pass, salt, { - keySize: keySize / 32, - iterations: iterations, - }); - - var iv = CryptoJS.lib.WordArray.random(ivSize / 8); - - var options = { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - iv: iv, - }; - var encrypted = CryptoJS.AES.encrypt(message, key, options); - return { - key: key.toString(CryptoJS.enc.Base64), - iv: iv.toString(CryptoJS.enc.Base64), - data: encrypted.ciphertext.toString(CryptoJS.enc.Base64), - }; - }; - $rootScope.decrypt = function (encryptedData) { - var ivSize = 128; - var cipherParams = CryptoJS.lib.CipherParams.create({ - ciphertext: CryptoJS.enc.Base64.parse(encryptedData.data), - }); - var key = CryptoJS.enc.Base64.parse(encryptedData.key); - var iv = CryptoJS.lib.WordArray.random(ivSize / 8); - var options = { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7, - iv: iv, - }; - - var decrypted = CryptoJS.AES.decrypt(cipherParams, key, options); - return decrypted.toString(CryptoJS.enc.Utf8); - }; - - $rootScope.ajaxSubmitForm = async function (form, url) { - var req = { - serviceBase: this.serviceBase, - method: "POST", - url: url, - headers: { - "Content-Type": undefined, - }, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: form, - }; - return await commonService.getApiResult(req); - }; - - $rootScope.translate = function (keyword, isWrap, defaultText) { - if ($rootScope.globalSettings && $rootScope.translator) { - return ( - $rootScope.translator.get(keyword, isWrap, defaultText) || keyword - ); - } else { - return keyword || defaultText; - } - }; - - $rootScope.getConfiguration = function (keyword, isWrap, defaultText) { - if ( - $rootScope.globalSettings && - ($rootScope.globalSettingsService || $rootScope.isBusy) - ) { - return $rootScope.globalSettingsService.get( - keyword, - isWrap, - defaultText - ); - } else { - return keyword || defaultText; - } - }; - - $rootScope.waitForInit = async function (functionName, args, scope) { - if (!$rootScope.isInit) { - () => { - setTimeout(() => { - $rootScope.waitForInit(functionName, args, scope); - }, 200); - }; - } else { - $rootScope.executeFunctionByName(functionName, args, scope); - } - }; - - $rootScope.$watch("isBusy", function (newValue, oldValue) { - if (newValue) { - $rootScope.message.content = ""; - $rootScope.errors = []; - } - }); - $rootScope.generateUUID = function () { - // Public Domain/MIT - var d = new Date().getTime(); - if ( - typeof performance !== "undefined" && - typeof performance.now === "function" - ) { - d += performance.now(); //use high-precision timer if available - } - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function ( - c - ) { - var r = (d + Math.random() * 16) % 16 | 0; - d = Math.floor(d / 16); - return (c === "x" ? r : (r & 0x3) | 0x8).toString(16); - }); - }; - $rootScope.filterArray = function (array, keys, values) { - var result = []; - if (array) { - for (var i = 0; i < array.length; i++) { - var matched = true; - for (var j = 0; j < keys.length; j++) { - if (array[i][keys[j]] !== values[j]) { - matched = false; - break; - } - } - if (matched) { - result.push(array[i]); - } - } - } - return result; - }; - $rootScope.findObjectByKey = function (array, key, value) { - if (array) { - if (Array.isArray(key)) { - for (var i = 0; i < array.length; i++) { - var isMatch = true; - angular.forEach(key, function (e, j) { - isMatch = array[i][key[j]] == value[j]; - }); - if (isMatch) { - return array[i]; - } - } - } else { - for (var i = 0; i < array.length; i++) { - if (array[i][key] == value) { - return array[i]; - } - } - } - } - return null; - }; - $rootScope.removeObjectByKey = function (array, key, value) { - if (Array.isArray(key)) { - for (var i = 0; i < array.length; i++) { - var isMatch = true; - angular.forEach(key, function (e, j) { - isMatch = array[i][key[j]] == value[j]; - }); - if (isMatch) { - array.splice(i, 1); - break; - } - } - } else { - for (var i = 0; i < array.length; i++) { - if (array[i][key] == value) { - array.splice(i, 1); - break; - } - } - } - for (var i = 0; i < array.length; i++) { - if (array[i][key] == value) { - array.splice(i, 1); - break; - } - } - }; - - $rootScope.changeLang = async function (lang) { - var url = await translatorService.translateUrl(lang); - translatorService.translateUrl(lang); - window.top.location = url; - }; - // upload on file select or drop - $rootScope.upload = function (file, url) { - Upload.upload({ - url: "upload/url", - data: { - file: file, - username: $scope.username, - }, - }).then( - function (resp) { - console.log( - "Success " + - resp.config.data.file.name + - "uploaded. Response: " + - resp.data - ); - }, - function (resp) { - console.log("Error status: " + resp.status); - }, - function (evt) { - var progressPercentage = parseInt((100.0 * evt.loaded) / evt.total); - console.log( - "progress: " + progressPercentage + "% " + evt.config.data.file.name - ); - } - ); - }; - $rootScope.goToSiteUrl = function (url) { - window.top.location = url; - }; - $rootScope.goToPath = function (url) { - $location.url(url.trim()); - }; - $rootScope.encryptMixDatabase = function (attributes, data) { - angular.forEach(attributes, function (attr) { - if (attr.isEncrypt) { - angular.forEach(data, function (item) { - var fieldData = $rootScope.findObjectByKey( - item.data, - "attributeName", - attr.name - ); - if (fieldData) { - var encryptedData = $rootScope.encrypt(fieldData.stringValue); - fieldData.encryptValue = encryptedData.data; - fieldData.encryptKey = encryptedData.key; - fieldData.stringValue = ""; - } - }); - } - }); - }; - $rootScope.decryptMixDatabase = function (attributes, data) { - angular.forEach(attributes, function (attr) { - if (attr.isEncrypt) { - angular.forEach(data, function (item) { - var fieldData = $rootScope.findObjectByKey( - item.data, - "attributeName", - attr.name - ); - if (fieldData) { - var encryptedData = { - key: fieldData.encryptKey, - data: fieldData.encryptValue, - }; - fieldData.stringValue = $rootScope.decrypt(encryptedData); - } - }); - } - }); - }; - $rootScope.testJSON = function (obj) { - if (typeof obj === "object" && obj !== null) { - return obj; - } - if (typeof obj !== "string") { - return false; - } - try { - return JSON.parse(obj); - } catch (error) { - return false; - } - }; - $rootScope.getRestService = function (modelName, isGlobal, lang) { - var serviceFactory = angular.copy(baseRestService); - serviceFactory.init(modelName, isGlobal, lang); - return serviceFactory; - }; - $rootScope.showLogin = function (req, type = null) { - $rootScope.isBusy = false; - $rootScope.loginCallbackRequest = req; - $rootScope.loginCallbackType = type; - - // window.top.location.href = "/security/login"; - $("#login-popup").modal("show"); - }; - $rootScope.isInRoles = function (roleNames) { - for (let index = 0; index < roleNames.length; index++) { - const roleName = roleNames[index]; - if (authService.isInRole(roleName)) { - return true; - } - } - return false; - }; - - $rootScope.isInRole = function (roleName) { - return authService.isInRole(roleName); - }; - $rootScope.showContentFilter = function (callback) { - $rootScope.contentFilterCallback = callback; - $("#modal-content-filter").modal("show"); - }; - - $rootScope.updateOrders = function (index, minIndex, items) { - items.splice(index, 1); - for (var i = 0; i < items.length; i++) { - items[i].priority = minIndex + i; - } - }; - - $rootScope.showHelper = function (url) { - $rootScope.helperUrl = url; - $("#dev-helper-modal").modal("show"); - }; - - $rootScope.openModal = function ( - templateUrl, - controllerName, - resolve, - size = "lg", - successCallback = null, - failCallback = null - ) { - var modalInstance = $uibModal.open({ - animation: true, - windowClass: "show", - templateUrl: templateUrl, - controller: controllerName, - controllerAs: "$ctrl", - size: size, - resolve: resolve, - }); - - modalInstance.result.then( - function (result) { - successCallback(result); - }, - function (error) { - failCallback(error); - } - ); - }; - }, -]); - -// if (document.getElementsByTagName('trumbowyg').length) { // ($.trumbowyg) { -// $.trumbowyg.svgPath = '/assets/icons.svg'; -// } - -"use strict"; -app - .directive("ngEnter", function () { - return function (scope, element, attrs) { - element.bind("keydown keypress", function (event) { - if (event.which === 13) { - scope.$apply(function () { - scope.$eval(attrs.ngEnter); - }); - - event.preventDefault(); - } - }); - }; - }) - .directive("ngScroll", function () { - return function (scope, element, attrs) { - element.bind("scroll", function (event) { - scope.$apply(function () { - scope.$eval(attrs.ngScroll); - }); - event.preventDefault(); - }); - }; - }) - .directive("file", function () { - return { - scope: { - file: "=", - files: "=", - }, - link: function (scope, el, attrs) { - el.bind("change", function (event) { - var files = event.target.files; - var file = files[0]; - scope.file = file; - scope.files = files; - scope.$apply(); - }); - }, - }; - }) - .directive("imageonload", function () { - return { - restrict: "A", - link: function (scope, element, attrs) { - element.bind("load", function () { }); - element.bind("error", function () { }); - }, - }; - }); - -'use strict'; -app.filter('utcToLocal', FilterUtcDate) - .filter('utcToLocalTime', FilterUtcDateTime) - .filter('phoneNumber', FilterPhoneNumber) - .filter('money', FilterMoney) - .filter('markdown', MarkdownToHtml) - .constant('ngAppSettings', { - serviceBase: '', - clientId: 'ngAuthApp', - facebookAppId: '', - request: { - pageSize: '20', - pageIndex: 0, - status: 'Published', - orderBy: 'CreatedDateTime', - direction: 'Desc', - fromDate: null, - toDate: null, - keyword: '', - key: '', - query: '{}' - }, - privacies: [ - 'VND', - 'USD' - ], - pageSizes: [ - '5', - '10', - '15', - '20' - ], - directions: [ - { - value: '0', - title: 'Asc' - }, - { - value: '1', - title: 'Desc' - } - ], - orders: [ - { - value: 'CreatedDateTime', - title: 'Created Date' - } - , - { - value: 'Priority', - title: 'Priority' - }, - - { - value: 'Title', - title: 'Title' - } - ], - contentStatuses: [ - 'Deleted', - 'Preview', - 'Published', - 'Draft', - 'Schedule' - ], - dataTypes: [ - { title: 'Custom', value: 0 }, - { title: 'DateTime', value: 1 }, - { title: 'Date', value: 2 }, - { title: 'Time', value: 3 }, - { title: 'Duration', value: 4 }, - { title: 'PhoneNumber', value: 5 }, - { title: 'Currency', value: 6 }, - { title: 'Text', value: 7 }, - { title: 'Html', value: 8 }, - { title: 'MultilineText', value: 9 }, - { title: 'EmailAddress', value: 10 }, - { title: 'Password', value: 11 }, - { title: 'Url', value: 12 }, - { title: 'ImageUrl', value: 13 }, - { title: 'CreditCard', value: 14 }, - { title: 'PostalCode', value: 15 }, - { title: 'Upload', value: 16 }, - - ] - }); - -function MarkdownToHtml($filter) { - return function (mdContent) { - var converter = new showdown.Converter(); - return converter.makeHtml(mdContent); - } -} - -function FilterUtcDate($filter) { - return function (utcDateString, format) { - format = format || 'MM.dd.yyyy - hh:mm:ss a'; - // return if input date is null or undefined - if (!utcDateString) { - return; - } - - // append 'Z' to the date string to indicate UTC time if the timezone isn't already specified - if (utcDateString.indexOf('Z') === -1 && utcDateString.indexOf('+') === -1) { - utcDateString += 'Z'; - } - - // convert and format date using the built in angularjs date filter - return $filter('date')(utcDateString, format); - }; -} -function FilterUtcDateTime($filter) { - return function (utcDateString, format) { - format = format || 'yyyy-MM-ddThh:mm'; - // return if input date is null or undefined - if (!utcDateString) { - return; - } - - // append 'Z' to the date string to indicate UTC time if the timezone isn't already specified - if (utcDateString.indexOf('Z') === -1 && utcDateString.indexOf('+') === -1) { - utcDateString += 'Z'; - } - - // convert and format date using the built in angularjs date filter - return $filter('date')(utcDateString, format); - }; -} -function buildDropdown(trumbowyg) { - var dropdown = []; - - $.each(trumbowyg.o.plugins.fontfamily.fontList, function (index, font) { - trumbowyg.addBtnDef('fontfamily_' + index, { - title: '' + font.name + '', - hasIcon: false, - fn: function () { - trumbowyg.execCmd('fontName', font.family, true); - } - }); - dropdown.push('fontfamily_' + index); - }); - - return dropdown; -} -function FilterPhoneNumber() { - return function (phone) { - return phone.replace(/^([0-9]{3})([0-9]{3})([0-9]{4,})$/, '($1) $2-$3'); - }; -} - -function FilterMoney() { - return function (money) { - return money.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,'); - }; -} - -'use strict'; -app.controller('ModuleFormController', [ - '$scope', 'SharedModuleDataService', - function ($scope, moduleDataService) { - $scope.initModuleForm = async function (name) { - var resp = null; - if (!$rootScope.isInit) { - setTimeout(function () { $scope.initModuleForm(name); }, 500); - } else { - resp = await moduleDataService.initModuleForm(name); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $scope.data.postId = $scope.postId; - $scope.data.productId = $scope.productId; - $scope.data.categoryId = $scope.categoryId; - $rootScope.isBusy = false; - $scope.$apply(); - //$scope.initEditor(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $scope.$apply(); - } - } - }; - - $scope.loadModuleData = async function (id) { - $rootScope.isBusy = true; - var response = await moduleDataService.getModuleData($scope.moduleId, $scope.d, 'portal'); - if (response.isSucceed) { - $scope.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveModuleData = async function () { - var form = $('#module-' + $scope.data.moduleId); - $.each($scope.data.dataProperties, function (i, e) { - switch (e.dataType) { - case 5: - e.value = $(form).find('.' + e.name).val(); - break; - default: - e.value = e.value ? e.value.toString() : null; - break; - } - }); - var resp = await moduleDataService.saveModuleData($scope.data); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $scope.initModuleForm(); - $rootScope.showMessage('success', 'success'); - if ($scope.saveSuccessCallback) { - $scope.saveSuccessCallback({ data: $scope.data }); - } - else { - $rootScope.isBusy = false; - $scope.$apply(); - } - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }]); -"use strict"; - -function BaseCtrl($scope, $rootScope, $routeParams, ngAppSettings, service) { - $scope.request = angular.copy(ngAppSettings.request); - $scope.contentStatuses = angular.copy(ngAppSettings.contentStatuses); - $scope.viewModel = null; - $scope.data = null; - $scope.isInit = false; - $scope.isValid = true; - $scope.errors = []; - $scope.saveSuccessCallbackArgs = []; - $scope.validateArgs = []; - $scope.removeCallbackArgs = []; - $scope.range = $rootScope.range; - $scope.validate = null; - $scope.getSingleSuccessCallback = null; - $scope.getSingleFailCallback = null; - $scope.getListSuccessCallback = null; - $scope.getListFailCallback = null; - $scope.saveFailCallback = null; - $scope.selectedList = { - action: "", - data: [], - }; - $scope.actions = ["Delete", "Publish", "Export"]; - $scope.translate = $rootScope.translate; - if ($rootScope.referrerUrl) { - $scope.referrerUrl = $rootScope.referrerUrl; - } else { - $scope.referrerUrl = `/portal/${service.modelName}/list`; - } - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var resp = await service.getSingle([id, "portal"]); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.getList = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - $rootScope.isBusy = true; - var resp = await service.getList($scope.request); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $.each($scope.data.items, function (i, data) { - $.each($scope.viewModels, function (i, e) { - if (e.dataId === data.id) { - data.isHidden = true; - } - }); - }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - $("html, body").animate({ scrollTop: "0px" }, 500); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.remove = function (id) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete(id); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.applyList = async function () { - $rootScope.showConfirm( - $scope, - "applyListConfirmed", - [], - null, - "Remove", - "Are you sure to " + $scope.selectedList.action + " these items" - ); - }; - - $scope.applyListConfirmed = async function () { - $rootScope.isBusy = true; - var resp = await service.applyList($scope.selectedList); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage("success", "success"); - switch ($scope.selectedList.action) { - case "Delete": - $scope.selectedList.isSelectAll = false; - $scope.selectedList.data = []; - $scope.getList(); - break; - case "Export": - window.open(resp.data.webPath, "_blank"); - $rootScope.isBusy = false; - $scope.$apply(); - break; - } - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.save = async function (data) { - if ($scope.validate) { - $scope.isValid = await $rootScope.executeFunctionByName( - "validate", - $scope.validateArgs, - $scope - ); - } - $rootScope.isBusy = true; - $scope.viewModel = data || $scope.viewModel; - if ($scope.isValid) { - var resp = await service.save($scope.viewModel); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage("success", "success"); - - if ($scope.saveSuccessCallback) { - $rootScope.executeFunctionByName( - "saveSuccessCallback", - $scope.saveSuccessCallbackArgs, - $scope - ); - } else { - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if ($scope.saveFailCallback) { - $rootScope.executeFunctionByName( - "saveFailCallback", - $scope.saveSuccessCallbackArgs, - $scope - ); - } - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - $rootScope.showErrors(["invalid model"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.select = function (id, isSelected) { - if (isSelected) { - $scope.selectedList.data.push(id); - } else { - $scope.removeObject($scope.selectedList.data, id); - } - }; - $scope.selectAll = function (isSelected) { - $scope.selectedList.data = []; - angular.forEach($scope.data.items, function (e) { - e.isSelected = isSelected; - if (isSelected) { - $scope.selectedList.data.push(e.id); - } - }); - }; - $scope.applyList = async function () { - $rootScope.showConfirm( - $scope, - "applyListConfirmed", - [], - null, - "Remove", - "Are you sure to" + $scope.selectedList.action + " these items" - ); - }; - - $scope.applyListConfirmed = async function () { - $rootScope.isBusy = true; - var resp = await service.applyList($scope.selectedList); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage("success", "success"); - switch ($scope.selectedList.action) { - case "Delete": - $scope.selectedList.isSelectAll = false; - $scope.selectedList.data = []; - $scope.getList(); - break; - case "Export": - window.open(resp.data.webPath, "_blank"); - $rootScope.isBusy = false; - $scope.$apply(); - break; - } - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.shortString = function (msg, max) { - if (msg) { - var data = decodeURIComponent(msg); - - if (max < data.length) { - return data.replace(/[+]/g, " ").substr(0, max) + " ..."; - } else { - return data.replace(/[+]/g, " "); - } - } else { - return ""; - } - }; -} - -'use strict'; -function BaseODataCtrl($scope, $rootScope, $routeParams, ngAppSettings, service) { - - $scope.request = angular.copy(ngAppSettings.request); - $scope.contentStatuses = angular.copy(ngAppSettings.contentStatuses); - $scope.viewModel = null; - $scope.defaultId = 0; - $scope.data = null; - $scope.isInit = false; - $scope.isValid = true; - $scope.errors = []; - $scope.saveSuccessCallbackArgs = []; - $scope.validateArgs = []; - $scope.removeCallbackArgs = []; - $scope.range = $rootScope.range; - $scope.validate = null; - $scope.getSingleSuccessCallback = null; - $scope.getSingleFailCallback = null; - $scope.getListSuccessCallback = null; - $scope.getListFailCallback = null; - $scope.saveFailCallback = null; - $scope.selectedList = { - action: '', - data: [] - }; - $scope.actions = ['Delete', 'Publish', 'Export']; - $scope.translate = $rootScope.translate; - if ($rootScope.referrerUrl) { - $scope.referrerUrl = $rootScope.referrerUrl; - } - else { - $scope.referrerUrl = '/portal';// document.referrer.substr(document.referrer.indexOf('/portal')); - } - - $scope.getSingle = async function (params = []) { - $rootScope.isBusy = true; - var id = $routeParams.id || $scope.defaultId; - params.splice(0, 0, id); - var resp = await service.getSingle('portal', [id]); - if (resp) { - $scope.viewModel = resp; - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors('Failed'); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.count = async function (params = []) { - $rootScope.isBusy = true; - var resp = await service.count('read', params); - if (resp) { - $scope.request.totalItems = resp; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors('Failed'); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.getList = async function (pageIndex, params = []) { - $rootScope.isBusy = true; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - var resp = await service.getList('read', $scope.request, params); - if (resp) { - $scope.data = resp; - $scope.count(params); - $.each($scope.data, function (i, data) { - $.each($scope.viewModels, function (i, e) { - if (e.dataId === data.id) { - data.isHidden = true; - } - }); - }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - $("html, body").animate({ "scrollTop": "0px" }, 500); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors('Failed'); - } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.remove = function (id) { - $rootScope.showConfirm($scope, 'removeConfirmed', [id], null, 'Remove', 'Deleted data will not able to recover, are you sure you want to delete this item?'); - }; - - $scope.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete([id]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName('removeCallback', $scope.removeCallbackArgs, $scope) - } - $scope.getList(); - } else { - $rootScope.showMessage('failed'); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.save = async function (data) { - $rootScope.isBusy = true; - if ($scope.validate) { - $scope.isValid = await $rootScope.executeFunctionByName('validate', $scope.validateArgs, $scope); - } - if ($scope.isValid) { - var resp = await service.save('portal', data); - if (resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage('success', 'success'); - - if ($scope.saveSuccessCallback) { - $rootScope.executeFunctionByName('saveSuccessCallback', $scope.saveSuccessCallbackArgs, $scope); - } - else { - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if ($scope.saveFailCallback) { - $rootScope.executeFunctionByName('saveFailCallback', $scope.saveSuccessCallbackArgs, $scope) - } - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - return resp; - } - else { - $rootScope.showErrors(['invalid model']); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.select = function (id, isSelected) { - if (isSelected) { - $scope.selectedList.data.push(id); - } - else { - $scope.removeObject($scope.selectedList.data, id); - } - } - $scope.selectAll = function (isSelected) { - $scope.selectedList.data = []; - angular.forEach($scope.data, function (e) { - e.isSelected = isSelected; - if (isSelected) { - $scope.selectedList.data.push(e.id); - } - }); - - } - $scope.applyList = async function () { - $rootScope.showConfirm($scope, 'applyListConfirmed', [], null, 'Remove', 'Are you sure to ' + $scope.selectedList.action + ' these items'); - }; - - $scope.applyListConfirmed = async function () { - $rootScope.isBusy = true; - var resp = await service.applyList('read', $scope.selectedList); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage('success', 'success'); - switch ($scope.selectedList.action) { - case 'Delete': - $scope.selectedList.isSelectAll = false; - $scope.selectedList.data = []; - $scope.getList(); - break; - case 'Export': - window.open(resp.data.webPath, '_blank'); - $rootScope.isBusy = false; - $scope.$apply(); - break; - } - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - - - $scope.shortString = function (msg, max) { - if (msg) { - var data = decodeURIComponent(msg); - - if (max < data.length) { - return data.replace(/[+]/g, ' ').substr(0, max) + ' ...'; - } else { - return data.replace(/[+]/g, ' '); - } - } else { - return ''; - } - } -} -"use strict"; -function BaseRestCtrl( - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service -) { - $scope.request = { - pageSize: "20", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - }; - $scope.contentStatuses = angular.copy(ngAppSettings.contentStatuses); - $scope.viewModel = null; - $scope.isScrollTop = true; - $scope.defaultId = 0; - $scope.data = null; - $scope.isInit = false; - $scope.isValid = true; - $scope.errors = []; - $scope.saveSuccessCallbackArgs = []; - $scope.validateArgs = []; - $scope.removeCallbackArgs = []; - $scope.range = $rootScope.range; - $scope.validate = null; - $scope.getSingleSuccessCallback = null; - $scope.getSingleFailCallback = null; - $scope.getListSuccessCallback = null; - $scope.getListFailCallback = null; - $scope.saveFailCallback = null; - $scope.selectedList = { - action: "", - data: [], - }; - $scope.actions = ["Delete", "Publish", "Export"]; - $scope.translate = $rootScope.translate; - if ($rootScope.referrerUrl) { - $scope.referrerUrl = $rootScope.referrerUrl; - } else { - $scope.referrerUrl = `/portal/${service.modelName.substr( - 0, - service.modelName.indexOf("/") - )}/list`; // document.referrer); - } - - $scope.duplicate = async function (id) { - $rootScope.isBusy = true; - if (!id) { - return await this.getDefault(); - } else { - var resp = await service.duplicate([id]); - if (resp.isSucceed) { - $scope.goToDetail(resp.data.id, "post"); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - - $scope.goToDetail = function (id, type) { - const url = `/portal/${type}/details/${id}`; - window.location.href = url; - }; - $scope.getSingle = async function (params = []) { - $rootScope.isBusy = true; - var id = $routeParams.id; - if (!id) { - return await this.getDefault(); - } else { - params.splice(0, 0, id); - var resp = await service.getSingle([id]); - if (resp.isSucceed) { - $scope.viewModel = resp.data; - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - - $scope.getDefault = async function () { - $rootScope.isBusy = true; - var resp = await service.getDefault(); - if (resp.isSucceed) { - $scope.viewModel = resp.data; - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.getList = async function (pageIndex, params = []) { - $rootScope.isBusy = true; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var resp = await service.getList($scope.request, params); - if (resp && resp.isSucceed) { - $scope.data = resp.data; - $.each($scope.data, function (i, data) { - $.each($scope.viewModels, function (i, e) { - if (e.dataId === data.id) { - data.isHidden = true; - } - }); - }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - if ($scope.isScrollTop) { - $("html, body").animate({ scrollTop: "0px" }, 500); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors || ["Failed"]); - } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.remove = function (id) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete([id]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.save = async function () { - $rootScope.isBusy = true; - if ($scope.validate) { - $scope.isValid = await $rootScope.executeFunctionByName( - "validate", - $scope.validateArgs, - $scope - ); - } - if ($scope.isValid) { - var resp = null; - if ($scope.viewModel.id == 0 || $scope.viewModel.id == null) { - resp = await service.create($scope.viewModel); - } else { - resp = await service.update($scope.viewModel.id, $scope.viewModel); - } - $rootScope.isBusy = false; - $scope.$apply(); - if (resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage("success", "success"); - - if ($scope.saveSuccessCallback) { - $rootScope.executeFunctionByName( - "saveSuccessCallback", - $scope.saveSuccessCallbackArgs, - $scope - ); - } - } else { - if ($scope.saveFailCallback) { - $rootScope.executeFunctionByName( - "saveFailCallback", - $scope.saveSuccessCallbackArgs, - $scope - ); - } - if (resp) { - $rootScope.showErrors(resp.errors); - } - } - return resp; - } else { - $rootScope.showErrors(["invalid model"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.select = function (id, isSelected) { - if (isSelected) { - $scope.selectedList.data.push(id); - } else { - $scope.removeObject($scope.selectedList.data, id); - } - }; - - $scope.selectAll = function (isSelected) { - $scope.selectedList.data = []; - angular.forEach($scope.data.items, function (e) { - e.isSelected = isSelected; - if (isSelected) { - $scope.selectedList.data.push(e.id); - } - }); - }; - - $scope.applyList = async function () { - $rootScope.showConfirm( - $scope, - "applyListConfirmed", - [], - null, - "Remove", - "Are you sure to " + $scope.selectedList.action + " these items" - ); - }; - - $scope.applyListConfirmed = async function () { - $rootScope.isBusy = true; - var resp = await service.applyList($scope.selectedList); - if (resp && resp.isSucceed) { - $rootScope.showMessage("success", "success"); - switch ($scope.selectedList.action) { - case "Export": - window.top.location = resp.data.data.webPath; - $rootScope.isBusy = false; - $scope.$apply(); - break; - case "Delete": - default: - $scope.selectedList.isSelectAll = false; - $scope.selectedList.data = []; - $scope.getList(); - break; - } - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.clearCache = async function () { - if ($scope.viewModel) { - $rootScope.isBusy = true; - var resp = await service.clearCache([$scope.viewModel.id]); - if (resp.isSucceed) { - $rootScope.showMessage("success", "success"); - } else { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.shortString = function (msg, max) { - if (msg) { - var data = decodeURIComponent(msg); - - if (max < data.length) { - return data.replace(/[+]/g, " ").substr(0, max) + " ..."; - } else { - return data.replace(/[+]/g, " "); - } - } else { - return ""; - } - }; -} - -function BaseHub(scope) { - scope.isLog = true; - scope.connection = null; - scope.host = "/"; - scope.responses = []; - scope.requests = []; - scope.rooms = []; - scope.others = []; - scope.totalReconnect = 10; - scope.timeDelay = 1000; - - scope.connect = function () { - scope.connection.invoke('join', scope.player); - }; - scope.sendMessage = function () { - scope.connection.invoke('SendMessage', scope.request); - }; - scope.receiveMessage = function (msg) { - console.log(msg); - scope.responses.splice(0, 0, msg); - scope.$applyAsync(); - }; - scope.prettyJsonObj = function (obj) { - return JSON.stringify(obj, null, '\t'); - } - // Starts a connection with transport fallback - if the connection cannot be started using - // the webSockets transport the function will fallback to the serverSentEvents transport and - // if this does not work it will try longPolling. If the connection cannot be started using - // any of the available transports the function will return a rejected Promise. - scope.startConnection = async function (hubName, callback) { - - scope.connection = new signalR.HubConnectionBuilder() - .withUrl(scope.host + hubName) - .withAutomaticReconnect() - .configureLogging(signalR.LogLevel.Information) - .build(); - // Create a function that the hub can call to broadcast messages. - - // https://docs.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-3.1&tabs=dotnet - //It's not possible to configure JSON serialization in the JavaScript client at this time. - scope.connection.on("receive_message", (resp) => { - console.log(resp); - scope.receiveMessage(JSON.parse(resp)); - }); - scope.connection.start() - .then(function () { - console.log('connection started', scope.connection); - if (callback) { - callback(); - } - //scope.$apply(); - }) - .catch(function (error) { - console.log(`Cannot start the connection use transport.`, error); - return Promise.reject(error); - }); - // scope.connection.onclose(function (e) { - // var count = 0; - // setTimeout(function () { - - // while (count < scope.totalReconnect) { - // if (scope.reconnect()) { - // count = scope.totalReconnect; - // } else { - // count++; - // } - // } - // }, scope.timeDelay); - // }); - - // scope.reconnect = function () { - // scope.connection.start() - // .then(function () { - // console.log('connection started', scope.connection); - // return true; - // //scope.$apply(); - // }) - // .catch(function (error) { - // console.log(`Cannot start the connection use transport.`, error); - // return false; - // }); - // }; - }; - - scope.$onDestroy = function () { - scope.connection.stop(); - }; -}; -/*! - * angular-loading-bar v0.9.0 - * https://chieffancypants.github.io/angular-loading-bar - * Copyright (c) 2016 Wes Cruver - * License: MIT - */ -!function () { "use strict"; angular.module("angular-loading-bar", ["cfp.loadingBarInterceptor"]), angular.module("chieffancypants.loadingBar", ["cfp.loadingBarInterceptor"]), angular.module("cfp.loadingBarInterceptor", ["cfp.loadingBar"]).config(["$httpProvider", function (a) { var b = ["$q", "$cacheFactory", "$timeout", "$rootScope", "$log", "cfpLoadingBar", function (b, c, d, e, f, g) { function h() { d.cancel(j), g.complete(), l = 0, k = 0 } function i(b) { var d, e = c.get("$http"), f = a.defaults; !b.cache && !f.cache || b.cache === !1 || "GET" !== b.method && "JSONP" !== b.method || (d = angular.isObject(b.cache) ? b.cache : angular.isObject(f.cache) ? f.cache : e); var g = void 0 !== d ? void 0 !== d.get(b.url) : !1; return void 0 !== b.cached && g !== b.cached ? b.cached : (b.cached = g, g) } var j, k = 0, l = 0, m = g.latencyThreshold; return { request: function (a) { return a.ignoreLoadingBar || i(a) || (e.$broadcast("cfpLoadingBar:loading", { url: a.url }), 0 === k && (j = d(function () { g.start() }, m)), k++, g.set(l / k)), a }, response: function (a) { return a && a.config ? (a.config.ignoreLoadingBar || i(a.config) || (l++, l >= k ? (e.$broadcast("cfpLoadingBar:loaded", { url: a.config.url, result: a }), h()) : g.set(l / k)), a) : (f.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"), a) }, responseError: function (a) { return a && a.config ? (a.config.ignoreLoadingBar || i(a.config) || (l++, l >= k ? (e.$broadcast("cfpLoadingBar:loaded", { url: a.config.url, result: a }), h()) : g.set(l / k)), b.reject(a)) : (f.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"), b.reject(a)) } } }]; a.interceptors.push(b) }]), angular.module("cfp.loadingBar", []).provider("cfpLoadingBar", function () { this.autoIncrement = !0, this.includeSpinner = !0, this.includeBar = !0, this.latencyThreshold = 100, this.startSize = .02, this.parentSelector = "body", this.spinnerTemplate = '
', this.loadingBarTemplate = '
', this.$get = ["$injector", "$document", "$timeout", "$rootScope", function (a, b, c, d) { function e() { if (k || (k = a.get("$animate")), c.cancel(m), !r) { var e = b[0], g = e.querySelector ? e.querySelector(n) : b.find(n)[0]; g || (g = e.getElementsByTagName("body")[0]); var h = angular.element(g), i = g.lastChild && angular.element(g.lastChild); d.$broadcast("cfpLoadingBar:started"), r = !0, v && k.enter(o, h, i), u && k.enter(q, h, o), f(w) } } function f(a) { if (r) { var b = 100 * a + "%"; p.css("width", b), s = a, t && (c.cancel(l), l = c(function () { g() }, 250)) } } function g() { if (!(h() >= 1)) { var a = 0, b = h(); a = b >= 0 && .25 > b ? (3 * Math.random() + 3) / 100 : b >= .25 && .65 > b ? 3 * Math.random() / 100 : b >= .65 && .9 > b ? 2 * Math.random() / 100 : b >= .9 && .99 > b ? .005 : 0; var c = h() + a; f(c) } } function h() { return s } function i() { s = 0, r = !1 } function j() { k || (k = a.get("$animate")), f(1), c.cancel(m), m = c(function () { var a = k.leave(o, i); a && a.then && a.then(i), k.leave(q), d.$broadcast("cfpLoadingBar:completed") }, 500) } var k, l, m, n = this.parentSelector, o = angular.element(this.loadingBarTemplate), p = o.find("div").eq(0), q = angular.element(this.spinnerTemplate), r = !1, s = 0, t = this.autoIncrement, u = this.includeSpinner, v = this.includeBar, w = this.startSize; return { start: e, set: f, status: h, inc: g, complete: j, autoIncrement: this.autoIncrement, includeSpinner: this.includeSpinner, latencyThreshold: this.latencyThreshold, parentSelector: this.parentSelector, startSize: this.startSize } }] }) }(); -/** - * @ngDoc directive - * @name ng.directive:paging - * - * @description - * A directive to aid in paging large datasets - * while requiring a small amount of page - * information. - * - * @element EA - * - */ -angular.module('bw.paging', []).directive('paging', function () { - - - /** - * The regex expression to use for any replace methods - * Feel free to tweak / fork values for your application - */ - var regex = /\{page\}/g; - - - /** - * The angular return value required for the directive - * Feel free to tweak / fork values for your application - */ - return { - - // Restrict to elements and attributes - restrict: 'EA', - - // Assign the angular link function - link: fieldLink, - - // Assign the angular directive template HTML - template: fieldTemplate, - - // Assign the angular scope attribute formatting - scope: { - page: '=', - pageSize: '=', - total: '=', - disabled: '@', - dots: '@', - ulClass: '@', - aClass: '@', - activeClass: '@', - disabledClass: '@', - adjacent: '@', - pagingAction: '&', - pgHref: '@', - textFirst: '@', - textLast: '@', - textNext: '@', - textPrev: '@', - textFirstClass: '@', - textLastClass: '@', - textNextClass: '@', - textPrevClass: '@', - textTitlePage: '@', - textTitleFirst: '@', - textTitleLast: '@', - textTitleNext: '@', - textTitlePrev: '@' - } - - }; - - - /** - * Link the directive to enable our scope watch values - * - * @param {object} scope - Angular link scope - * @param {object} el - Angular link element - * @param {object} attrs - Angular link attribute - */ - function fieldLink(scope, el, attrs) { - - // Hook in our watched items - scope.$watchCollection('[page,pageSize,total,disabled]', function () { - build(scope, attrs); - }); - } - - - /** - * Create our template html - * We use a function to figure out how to handle href correctly - * - * @param {object} el - Angular link element - * @param {object} attrs - Angular link attribute - */ - function fieldTemplate(el, attrs) { - return '
    ' + - '
  • ' + - '' + - ' ' + - '
  • ' + - '
' - } - - - /** - * Assign default scope values from settings - * Feel free to tweak / fork these for your application - * - * @param {Object} scope - The local directive scope object - * @param {Object} attrs - The local directive attribute object - */ - function setScopeValues(scope, attrs) { - - scope.List = []; - scope.Hide = false; - - scope.page = parseInt(scope.page) || 1; - scope.total = parseInt(scope.total) || 0; - scope.adjacent = parseInt(scope.adjacent) || 2; - - scope.pgHref = scope.pgHref || ''; - scope.dots = scope.dots || '...'; - - scope.ulClass = scope.ulClass || 'pagination'; - scope.activeClass = scope.activeClass || 'active'; - scope.disabledClass = scope.disabledClass || 'disabled'; - - scope.textFirst = scope.textFirst || '<<'; - scope.textLast = scope.textLast || '>>'; - scope.textNext = scope.textNext || '>'; - scope.textPrev = scope.textPrev || '<'; - - scope.textFirstClass = scope.textFirstClass || ''; - scope.textLastClass = scope.textLastClass || ''; - scope.textNextClass = scope.textNextClass || ''; - scope.textPrevClass = scope.textPrevClass || ''; - - scope.textTitlePage = scope.textTitlePage || 'Page {page}'; - scope.textTitleFirst = scope.textTitleFirst || 'First Page'; - scope.textTitleLast = scope.textTitleLast || 'Last Page'; - scope.textTitleNext = scope.textTitleNext || 'Next Page'; - scope.textTitlePrev = scope.textTitlePrev || 'Previous Page'; - - scope.hideIfEmpty = evalBoolAttribute(scope, attrs.hideIfEmpty); - scope.showPrevNext = evalBoolAttribute(scope, attrs.showPrevNext); - scope.showFirstLast = evalBoolAttribute(scope, attrs.showFirstLast); - scope.scrollTop = evalBoolAttribute(scope, attrs.scrollTop); - scope.isDisabled = evalBoolAttribute(scope, attrs.disabled); - } - - - /** - * A helper to perform our boolean eval on attributes - * This allows flexibility in the attribute for strings and variables in scope - * - * @param {Object} scope - The local directive scope object - * @param {Object} value - The attribute value of interest - */ - function evalBoolAttribute(scope, value) { - return angular.isDefined(value) - ? !!scope.$parent.$eval(value) - : false; - } - - - /** - * Validate and clean up any scope values - * This happens after we have set the scope values - * - * @param {Object} scope - The local directive scope object - * @param {int} pageCount - The last page number or total page count - */ - function validateScopeValues(scope, pageCount) { - - // Block where the page is larger than the pageCount - // if (scope.page > pageCount) { - // scope.page = pageCount; - // } - - // Block where the page is less than 0 - if (scope.page <= 0) { - scope.page = 1; - } - - // Block where adjacent value is 0 or below - if (scope.adjacent <= 0) { - scope.adjacent = 2; - } - - // Hide from page if we have 1 or less pages - // if directed to hide empty - if (pageCount <= 1) { - scope.Hide = scope.hideIfEmpty; - } - } - - - /** - * Assign the method action to take when a page is clicked - * - * @param {Object} scope - The local directive scope object - * @param {int} page - The current page of interest - */ - function internalAction(scope, page) { - - // Block clicks we try to load the active page - if (scope.page === page) { - return; - } - - // Block if we are forcing disabled - if (scope.isDisabled) { - return; - } - - // Update the page in scope - scope.page = page; - - // Pass our parameters to the paging action - scope.pagingAction({ - page: scope.page, - pageSize: scope.pageSize, - total: scope.total - }); - - // If allowed scroll up to the top of the page - if (scope.scrollTop) { - //scrollTo(0, 0); - $("html, body").animate({ "scrollTop": "0px" }, 500); - } - } - - - /** - * Add the first, previous, next, and last buttons if desired - * The logic is defined by the mode of interest - * This method will simply return if the scope.showPrevNext is false - * This method will simply return if there are no pages to display - * - * @param {Object} scope - The local directive scope object - * @param {int} pageCount - The last page number or total page count - * @param {string} mode - The mode of interest either prev or last - */ - function addPrevNext(scope, pageCount, mode) { - - // Ignore if we are not showing - // or there are no pages to display - if ((!scope.showPrevNext && !scope.showFirstLast) || pageCount < 1) { - return; - } - - // Local variables to help determine logic - var disabled, alpha, beta; - - // Determine logic based on the mode of interest - // Calculate the previous / next page and if the click actions are allowed - if (mode === 'prev') { - - disabled = scope.page - 1 <= 0; - var prevPage = scope.page - 1 <= 0 ? 1 : scope.page - 1; - - if (scope.showFirstLast) { - alpha = { - value: scope.textFirst, - title: scope.textTitleFirst, - aClass: scope.textFirstClass, - page: 1 - }; - } - - if (scope.showPrevNext) { - beta = { - value: scope.textPrev, - title: scope.textTitlePrev, - aClass: scope.textPrevClass, - page: prevPage - }; - } - - } else { - - disabled = scope.page + 1 > pageCount; - var nextPage = scope.page + 1 >= pageCount ? pageCount : scope.page + 1; - - if (scope.showPrevNext) { - alpha = { - value: scope.textNext, - title: scope.textTitleNext, - aClass: scope.textNextClass, - page: nextPage - }; - } - - if (scope.showFirstLast) { - beta = { - value: scope.textLast, - title: scope.textTitleLast, - aClass: scope.textLastClass, - page: pageCount - }; - } - - } - - // Create the Add Item Function - var buildItem = function (item, disabled) { - return { - title: item.title, - aClass: item.aClass, - value: item.aClass ? '' : item.value, - liClass: disabled ? scope.disabledClass : '', - pgHref: disabled ? '' : scope.pgHref.replace(regex, item.page), - action: function () { - if (!disabled) { - internalAction(scope, item.page); - } - } - }; - }; - - // Force disabled if specified - if (scope.isDisabled) { - disabled = true; - } - - // Add alpha items - if (alpha) { - var alphaItem = buildItem(alpha, disabled); - scope.List.push(alphaItem); - } - - // Add beta items - if (beta) { - var betaItem = buildItem(beta, disabled); - scope.List.push(betaItem); - } - } - - - /** - * Adds a range of numbers to our list - * The range is dependent on the start and finish parameters - * - * @param {int} start - The start of the range to add to the paging list - * @param {int} finish - The end of the range to add to the paging list - * @param {Object} scope - The local directive scope object - */ - function addRange(start, finish, scope) { - - // Add our items where i is the page number - var i = 0; - for (i = start; i <= finish; i++) { - - var pgHref = scope.pgHref.replace(regex, i); - var liClass = scope.page === i ? scope.activeClass : ''; - - // Handle items that are affected by disabled - if (scope.isDisabled) { - pgHref = ''; - liClass = scope.disabledClass; - } - - - scope.List.push({ - value: i, - title: scope.textTitlePage.replace(regex, i), - liClass: liClass, - pgHref: pgHref, - action: function () { - internalAction(scope, this.value); - } - }); - } - } - - - /** - * Add Dots ie: 1 2 [...] 10 11 12 [...] 56 57 - * This is my favorite function not going to lie - * - * @param {Object} scope - The local directive scope object - */ - function addDots(scope) { - scope.List.push({ - value: scope.dots, - liClass: scope.disabledClass - }); - } - - - /** - * Add the first or beginning items in our paging list - * We leverage the 'next' parameter to determine if the dots are required - * - * @param {Object} scope - The local directive scope object - * @param {int} next - the next page number in the paging sequence - */ - function addFirst(scope, next) { - - addRange(1, 2, scope); - - // We ignore dots if the next value is 3 - // ie: 1 2 [...] 3 4 5 becomes just 1 2 3 4 5 - if (next !== 3) { - addDots(scope); - } - } - - - /** - * Add the last or end items in our paging list - * We leverage the 'prev' parameter to determine if the dots are required - * - * @param {int} pageCount - The last page number or total page count - * @param {Object} scope - The local directive scope object - * @param {int} prev - the previous page number in the paging sequence - */ - // Add Last Pages - function addLast(pageCount, scope, prev) { - - // We ignore dots if the previous value is one less that our start range - // ie: 1 2 3 4 [...] 5 6 becomes just 1 2 3 4 5 6 - if (prev !== pageCount - 2) { - addDots(scope); - } - - addRange(pageCount - 1, pageCount, scope); - } - - - - /** - * The main build function used to determine the paging logic - * Feel free to tweak / fork values for your application - * - * @param {Object} scope - The local directive scope object - * @param {Object} attrs - The local directive attribute object - */ - function build(scope, attrs) { - - // Block divide by 0 and empty page size - if (!scope.pageSize || scope.pageSize <= 0) { - scope.pageSize = 1; - } - - // Determine the last page or total page count - var pageCount = Math.ceil(scope.total / scope.pageSize); - - // Set the default scope values where needed - setScopeValues(scope, attrs); - - // Validate the scope values to protect against strange states - validateScopeValues(scope, pageCount); - - // Create the beginning and end page values - var start, finish; - - // Calculate the full adjacency value - var fullAdjacentSize = (scope.adjacent * 2) + 2; - - - // Add the Next and Previous buttons to our list - addPrevNext(scope, pageCount, 'prev'); - - // If the page count is less than the full adjacnet size - // Then we simply display all the pages, Otherwise we calculate the proper paging display - if (pageCount <= (fullAdjacentSize + 2)) { - - start = 1; - addRange(start, pageCount, scope); - - } else { - - // Determine if we are showing the beginning of the paging list - // We know it is the beginning if the page - adjacent is <= 2 - if (scope.page - scope.adjacent <= 2) { - - start = 1; - finish = 1 + fullAdjacentSize; - - addRange(start, finish, scope); - addLast(pageCount, scope, finish); - } - - // Determine if we are showing the middle of the paging list - // We know we are either in the middle or at the end since the beginning is ruled out above - // So we simply check if we are not at the end - // Again 2 is hard coded as we always display two pages after the dots - else if (scope.page < pageCount - (scope.adjacent + 2)) { - - start = scope.page - scope.adjacent; - finish = scope.page + scope.adjacent; - - addFirst(scope, start); - addRange(start, finish, scope); - addLast(pageCount, scope, finish); - } - - // If nothing else we conclude we are at the end of the paging list - // We know this since we have already ruled out the beginning and middle above - else { - - start = pageCount - fullAdjacentSize; - finish = pageCount; - - addFirst(scope, start); - addRange(start, finish, scope); - } - } - - // Add the next and last buttons to our paging list - addPrevNext(scope, pageCount, 'next'); - } - -}); - -(function webpackUniversalModuleDefinition(root, factory) { if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["signalR"] = factory(); else root["signalR"] = factory() })(window, function () { - return function (modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { return installedModules[moduleId].exports } var module = installedModules[moduleId] = { i: moduleId, l: false, exports: {} }; modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); module.l = true; return module.exports } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.d = function (exports, name, getter) { if (!__webpack_require__.o(exports, name)) { Object.defineProperty(exports, name, { enumerable: true, get: getter }) } }; __webpack_require__.r = function (exports) { if (typeof Symbol !== "undefined" && Symbol.toStringTag) { Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }) } Object.defineProperty(exports, "__esModule", { value: true }) }; __webpack_require__.t = function (value, mode) { if (mode & 1) value = __webpack_require__(value); if (mode & 8) return value; if (mode & 4 && typeof value === "object" && value && value.__esModule) return value; var ns = Object.create(null); __webpack_require__.r(ns); Object.defineProperty(ns, "default", { enumerable: true, value: value }); if (mode & 2 && typeof value != "string") for (var key in value) __webpack_require__.d(ns, key, function (key) { return value[key] }.bind(null, key)); return ns }; __webpack_require__.n = function (module) { var getter = module && module.__esModule ? function getDefault() { return module["default"] } : function getModuleExports() { return module }; __webpack_require__.d(getter, "a", getter); return getter }; __webpack_require__.o = function (object, property) { return Object.prototype.hasOwnProperty.call(object, property) }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 0) }([function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); var es6_promise_dist_es6_promise_auto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); var es6_promise_dist_es6_promise_auto_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(es6_promise_dist_es6_promise_auto_js__WEBPACK_IMPORTED_MODULE_0__); var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); __webpack_require__.d(__webpack_exports__, "VERSION", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["VERSION"] }); __webpack_require__.d(__webpack_exports__, "AbortError", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["AbortError"] }); __webpack_require__.d(__webpack_exports__, "HttpError", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HttpError"] }); __webpack_require__.d(__webpack_exports__, "TimeoutError", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"] }); __webpack_require__.d(__webpack_exports__, "HttpClient", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HttpClient"] }); __webpack_require__.d(__webpack_exports__, "HttpResponse", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"] }); __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["DefaultHttpClient"] }); __webpack_require__.d(__webpack_exports__, "HubConnection", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HubConnection"] }); __webpack_require__.d(__webpack_exports__, "HubConnectionState", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HubConnectionState"] }); __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HubConnectionBuilder"] }); __webpack_require__.d(__webpack_exports__, "MessageType", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["MessageType"] }); __webpack_require__.d(__webpack_exports__, "LogLevel", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["LogLevel"] }); __webpack_require__.d(__webpack_exports__, "HttpTransportType", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["HttpTransportType"] }); __webpack_require__.d(__webpack_exports__, "TransferFormat", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"] }); __webpack_require__.d(__webpack_exports__, "NullLogger", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["NullLogger"] }); __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["JsonHubProtocol"] }); __webpack_require__.d(__webpack_exports__, "Subject", function () { return _index__WEBPACK_IMPORTED_MODULE_1__["Subject"] }); if (!Uint8Array.prototype.indexOf) { Object.defineProperty(Uint8Array.prototype, "indexOf", { value: Array.prototype.indexOf, writable: true }) } if (!Uint8Array.prototype.slice) { Object.defineProperty(Uint8Array.prototype, "slice", { value: function (start, end) { return new Uint8Array(Array.prototype.slice.call(this, start, end)) }, writable: true }) } if (!Uint8Array.prototype.forEach) { Object.defineProperty(Uint8Array.prototype, "forEach", { value: Array.prototype.forEach, writable: true }) } }, function (module, exports, __webpack_require__) { - (function (global) { - var require; - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.2+97478eb6 - */ - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.2+97478eb6 - */ - (function (global, factory) { true ? module.exports = factory() : undefined })(this, function () { "use strict"; function objectOrFunction(x) { var type = typeof x; return x !== null && (type === "object" || type === "function") } function isFunction(x) { return typeof x === "function" } var _isArray = void 0; if (Array.isArray) { _isArray = Array.isArray } else { _isArray = function (x) { return Object.prototype.toString.call(x) === "[object Array]" } } var isArray = _isArray; var len = 0; var vertxNext = void 0; var customSchedulerFn = void 0; var asap = function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { if (customSchedulerFn) { customSchedulerFn(flush) } else { scheduleFlush() } } }; function setScheduler(scheduleFn) { customSchedulerFn = scheduleFn } function setAsap(asapFn) { asap = asapFn } var browserWindow = typeof window !== "undefined" ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === "undefined" && typeof process !== "undefined" && {}.toString.call(process) === "[object process]"; var isWorker = typeof Uint8ClampedArray !== "undefined" && typeof importScripts !== "undefined" && typeof MessageChannel !== "undefined"; function useNextTick() { return function () { return process.nextTick(flush) } } function useVertxTimer() { if (typeof vertxNext !== "undefined") { return function () { vertxNext(flush) } } return useSetTimeout() } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(""); observer.observe(node, { characterData: true }); return function () { node.data = iterations = ++iterations % 2 } } function useMessageChannel() { var channel = new MessageChannel; channel.port1.onmessage = flush; return function () { return channel.port2.postMessage(0) } } function useSetTimeout() { var globalSetTimeout = setTimeout; return function () { return globalSetTimeout(flush, 1) } } var queue = new Array(1e3); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined } len = 0 } function attemptVertx() { try { var r = require; var vertx = __webpack_require__(!function webpackMissingModule() { var e = new Error("Cannot find module 'vertx'"); e.code = "MODULE_NOT_FOUND"; throw e }()); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer() } catch (e) { return useSetTimeout() } } var scheduleFlush = void 0; if (isNode) { scheduleFlush = useNextTick() } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver() } else if (isWorker) { scheduleFlush = useMessageChannel() } else if (browserWindow === undefined && "function" === "function") { scheduleFlush = attemptVertx() } else { scheduleFlush = useSetTimeout() } function then(onFulfillment, onRejection) { var parent = this; var child = new this.constructor(noop); if (child[PROMISE_ID] === undefined) { makePromise(child) } var _state = parent._state; if (_state) { var callback = arguments[_state - 1]; asap(function () { return invokeCallback(_state, child, callback, parent._result) }) } else { subscribe(parent, child, onFulfillment, onRejection) } return child } function resolve$1(object) { var Constructor = this; if (object && typeof object === "object" && object.constructor === Constructor) { return object } var promise = new Constructor(noop); resolve(promise, object); return promise } var PROMISE_ID = Math.random().toString(36).substring(16); function noop() { } var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var GET_THEN_ERROR = new ErrorObject; function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself") } function cannotReturnOwn() { return new TypeError("A promises callback cannot return that same promise.") } function getThen(promise) { try { return promise.then } catch (error) { GET_THEN_ERROR.error = error; return GET_THEN_ERROR } } function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { try { then$$1.call(value, fulfillmentHandler, rejectionHandler) } catch (e) { return e } } function handleForeignThenable(promise, thenable, then$$1) { asap(function (promise) { var sealed = false; var error = tryThen(then$$1, thenable, function (value) { if (sealed) { return } sealed = true; if (thenable !== value) { resolve(promise, value) } else { fulfill(promise, value) } }, function (reason) { if (sealed) { return } sealed = true; reject(promise, reason) }, "Settle: " + (promise._label || " unknown promise")); if (!sealed && error) { sealed = true; reject(promise, error) } }, promise) } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result) } else if (thenable._state === REJECTED) { reject(promise, thenable._result) } else { subscribe(thenable, undefined, function (value) { return resolve(promise, value) }, function (reason) { return reject(promise, reason) }) } } function handleMaybeThenable(promise, maybeThenable, then$$1) { if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { handleOwnThenable(promise, maybeThenable) } else { if (then$$1 === GET_THEN_ERROR) { reject(promise, GET_THEN_ERROR.error); GET_THEN_ERROR.error = null } else if (then$$1 === undefined) { fulfill(promise, maybeThenable) } else if (isFunction(then$$1)) { handleForeignThenable(promise, maybeThenable, then$$1) } else { fulfill(promise, maybeThenable) } } } function resolve(promise, value) { if (promise === value) { reject(promise, selfFulfillment()) } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)) } else { fulfill(promise, value) } } function publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result) } publish(promise) } function fulfill(promise, value) { if (promise._state !== PENDING) { return } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length !== 0) { asap(publish, promise) } } function reject(promise, reason) { if (promise._state !== PENDING) { return } promise._state = REJECTED; promise._result = reason; asap(publishRejection, promise) } function subscribe(parent, child, onFulfillment, onRejection) { var _subscribers = parent._subscribers; var length = _subscribers.length; parent._onerror = null; _subscribers[length] = child; _subscribers[length + FULFILLED] = onFulfillment; _subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { asap(publish, parent) } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return } var child = void 0, callback = void 0, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail) } else { callback(detail) } } promise._subscribers.length = 0 } function ErrorObject() { this.error = null } var TRY_CATCH_ERROR = new ErrorObject; function tryCatch(callback, detail) { try { return callback(detail) } catch (e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = void 0, failed = void 0; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value.error = null } else { succeeded = true } if (promise === value) { reject(promise, cannotReturnOwn()); return } } else { value = detail; succeeded = true } if (promise._state !== PENDING) { } else if (hasCallback && succeeded) { resolve(promise, value) } else if (failed) { reject(promise, error) } else if (settled === FULFILLED) { fulfill(promise, value) } else if (settled === REJECTED) { reject(promise, value) } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { resolve(promise, value) }, function rejectPromise(reason) { reject(promise, reason) }) } catch (e) { reject(promise, e) } } var id = 0; function nextId() { return id++ } function makePromise(promise) { promise[PROMISE_ID] = id++; promise._state = undefined; promise._result = undefined; promise._subscribers = [] } function validationError() { return new Error("Array Methods must be provided an Array") } function validationError() { return new Error("Array Methods must be provided an Array") } var Enumerator = function () { function Enumerator(Constructor, input) { this._instanceConstructor = Constructor; this.promise = new Constructor(noop); if (!this.promise[PROMISE_ID]) { makePromise(this.promise) } if (isArray(input)) { this.length = input.length; this._remaining = input.length; this._result = new Array(this.length); if (this.length === 0) { fulfill(this.promise, this._result) } else { this.length = this.length || 0; this._enumerate(input); if (this._remaining === 0) { fulfill(this.promise, this._result) } } } else { reject(this.promise, validationError()) } } Enumerator.prototype._enumerate = function _enumerate(input) { for (var i = 0; this._state === PENDING && i < input.length; i++) { this._eachEntry(input[i], i) } }; Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { var c = this._instanceConstructor; var resolve$$1 = c.resolve; if (resolve$$1 === resolve$1) { var _then = getThen(entry); if (_then === then && entry._state !== PENDING) { this._settledAt(entry._state, i, entry._result) } else if (typeof _then !== "function") { this._remaining--; this._result[i] = entry } else if (c === Promise$2) { var promise = new c(noop); handleMaybeThenable(promise, entry, _then); this._willSettleAt(promise, i) } else { this._willSettleAt(new c(function (resolve$$1) { return resolve$$1(entry) }), i) } } else { this._willSettleAt(resolve$$1(entry), i) } }; Enumerator.prototype._settledAt = function _settledAt(state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (state === REJECTED) { reject(promise, value) } else { this._result[i] = value } } if (this._remaining === 0) { fulfill(promise, this._result) } }; Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { var enumerator = this; subscribe(promise, undefined, function (value) { return enumerator._settledAt(FULFILLED, i, value) }, function (reason) { return enumerator._settledAt(REJECTED, i, reason) }) }; return Enumerator }(); function all(entries) { return new Enumerator(this, entries).promise } function race(entries) { var Constructor = this; if (!isArray(entries)) { return new Constructor(function (_, reject) { return reject(new TypeError("You must pass an array to race.")) }) } else { return new Constructor(function (resolve, reject) { var length = entries.length; for (var i = 0; i < length; i++) { Constructor.resolve(entries[i]).then(resolve, reject) } }) } } function reject$1(reason) { var Constructor = this; var promise = new Constructor(noop); reject(promise, reason); return promise } function needsResolver() { throw new TypeError("You must pass a resolver function as the first argument to the promise constructor") } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.") } var Promise$2 = function () { function Promise(resolver) { this[PROMISE_ID] = nextId(); this._result = this._state = undefined; this._subscribers = []; if (noop !== resolver) { typeof resolver !== "function" && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew() } } Promise.prototype.catch = function _catch(onRejection) { return this.then(null, onRejection) }; Promise.prototype.finally = function _finally(callback) { var promise = this; var constructor = promise.constructor; return promise.then(function (value) { return constructor.resolve(callback()).then(function () { return value }) }, function (reason) { return constructor.resolve(callback()).then(function () { throw reason }) }) }; return Promise }(); Promise$2.prototype.then = then; Promise$2.all = all; Promise$2.race = race; Promise$2.resolve = resolve$1; Promise$2.reject = reject$1; Promise$2._setScheduler = setScheduler; Promise$2._setAsap = setAsap; Promise$2._asap = asap; function polyfill() { var local = void 0; if (typeof global !== "undefined") { local = global } else if (typeof self !== "undefined") { local = self } else { try { local = Function("return this")() } catch (e) { throw new Error("polyfill failed because global object is unavailable in this environment") } } var P = local.Promise; if (P) { var promiseToString = null; try { promiseToString = Object.prototype.toString.call(P.resolve()) } catch (e) { } if (promiseToString === "[object Promise]" && !P.cast) { return } } local.Promise = Promise$2 } Promise$2.polyfill = polyfill; Promise$2.Promise = Promise$2; Promise$2.polyfill(); return Promise$2 }) - }).call(this, __webpack_require__(2)) - }, function (module, exports) { var g; g = function () { return this }(); try { g = g || new Function("return this")() } catch (e) { if (typeof window === "object") g = window } module.exports = g }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "VERSION", function () { return VERSION }); var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); __webpack_require__.d(__webpack_exports__, "AbortError", function () { return _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"] }); __webpack_require__.d(__webpack_exports__, "HttpError", function () { return _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"] }); __webpack_require__.d(__webpack_exports__, "TimeoutError", function () { return _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"] }); var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); __webpack_require__.d(__webpack_exports__, "HttpClient", function () { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"] }); __webpack_require__.d(__webpack_exports__, "HttpResponse", function () { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"] }); var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6); __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function () { return _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__["DefaultHttpClient"] }); var _HubConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10); __webpack_require__.d(__webpack_exports__, "HubConnection", function () { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnection"] }); __webpack_require__.d(__webpack_exports__, "HubConnectionState", function () { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnectionState"] }); var _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function () { return _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__["HubConnectionBuilder"] }); var _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15); __webpack_require__.d(__webpack_exports__, "MessageType", function () { return _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__["MessageType"] }); var _ILogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9); __webpack_require__.d(__webpack_exports__, "LogLevel", function () { return _ILogger__WEBPACK_IMPORTED_MODULE_6__["LogLevel"] }); var _ITransport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20); __webpack_require__.d(__webpack_exports__, "HttpTransportType", function () { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["HttpTransportType"] }); __webpack_require__.d(__webpack_exports__, "TransferFormat", function () { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["TransferFormat"] }); var _Loggers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14); __webpack_require__.d(__webpack_exports__, "NullLogger", function () { return _Loggers__WEBPACK_IMPORTED_MODULE_8__["NullLogger"] }); var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25); __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function () { return _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__["JsonHubProtocol"] }); var _Subject__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(16); __webpack_require__.d(__webpack_exports__, "Subject", function () { return _Subject__WEBPACK_IMPORTED_MODULE_10__["Subject"] }); var VERSION = "3.1.2" }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HttpError", function () { return HttpError }); __webpack_require__.d(__webpack_exports__, "TimeoutError", function () { return TimeoutError }); __webpack_require__.d(__webpack_exports__, "AbortError", function () { return AbortError }); var __extends = undefined && undefined.__extends || function () { var 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 function (d, b) { extendStatics(d, b); function __() { this.constructor = d } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __) } }(); var HttpError = function (_super) { __extends(HttpError, _super); function HttpError(errorMessage, statusCode) { var _newTarget = this.constructor; var _this = this; var trueProto = _newTarget.prototype; _this = _super.call(this, errorMessage) || this; _this.statusCode = statusCode; _this.__proto__ = trueProto; return _this } return HttpError }(Error); var TimeoutError = function (_super) { __extends(TimeoutError, _super); function TimeoutError(errorMessage) { var _newTarget = this.constructor; if (errorMessage === void 0) { errorMessage = "A timeout occurred." } var _this = this; var trueProto = _newTarget.prototype; _this = _super.call(this, errorMessage) || this; _this.__proto__ = trueProto; return _this } return TimeoutError }(Error); var AbortError = function (_super) { __extends(AbortError, _super); function AbortError(errorMessage) { var _newTarget = this.constructor; if (errorMessage === void 0) { errorMessage = "An abort occurred." } var _this = this; var trueProto = _newTarget.prototype; _this = _super.call(this, errorMessage) || this; _this.__proto__ = trueProto; return _this } return AbortError }(Error) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HttpResponse", function () { return HttpResponse }); __webpack_require__.d(__webpack_exports__, "HttpClient", function () { return HttpClient }); var __assign = undefined && undefined.__assign || Object.assign || function (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 }; var HttpResponse = function () { function HttpResponse(statusCode, statusText, content) { this.statusCode = statusCode; this.statusText = statusText; this.content = content } return HttpResponse }(); var HttpClient = function () { function HttpClient() { } HttpClient.prototype.get = function (url, options) { return this.send(__assign({}, options, { method: "GET", url: url })) }; HttpClient.prototype.post = function (url, options) { return this.send(__assign({}, options, { method: "POST", url: url })) }; HttpClient.prototype.delete = function (url, options) { return this.send(__assign({}, options, { method: "DELETE", url: url })) }; HttpClient.prototype.getCookieString = function (url) { return "" }; return HttpClient }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function () { return DefaultHttpClient }); var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); var _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7); var _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); var __extends = undefined && undefined.__extends || function () { var 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 function (d, b) { extendStatics(d, b); function __() { this.constructor = d } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __) } }(); var DefaultHttpClient = function (_super) { __extends(DefaultHttpClient, _super); function DefaultHttpClient(logger) { var _this = _super.call(this) || this; if (typeof XMLHttpRequest !== "undefined") { _this.httpClient = new _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__["XhrHttpClient"](logger) } else { _this.httpClient = new _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__["NodeHttpClient"](logger) } return _this } DefaultHttpClient.prototype.send = function (request) { if (request.abortSignal && request.abortSignal.aborted) { return Promise.reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]) } if (!request.method) { return Promise.reject(new Error("No method defined.")) } if (!request.url) { return Promise.reject(new Error("No url defined.")) } return this.httpClient.send(request) }; DefaultHttpClient.prototype.getCookieString = function (url) { return this.httpClient.getCookieString(url) }; return DefaultHttpClient }(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "NodeHttpClient", function () { return NodeHttpClient }); var _HttpClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); var __extends = undefined && undefined.__extends || function () { var 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 function (d, b) { extendStatics(d, b); function __() { this.constructor = d } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __) } }(); var NodeHttpClient = function (_super) { __extends(NodeHttpClient, _super); function NodeHttpClient(logger) { return _super.call(this) || this } NodeHttpClient.prototype.send = function () { return Promise.reject(new Error("If using Node either provide an XmlHttpRequest polyfill or consume the cjs or esm script instead of the browser/signalr.js one.")) }; return NodeHttpClient }(_HttpClient__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "XhrHttpClient", function () { return XhrHttpClient }); var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); var __extends = undefined && undefined.__extends || function () { var 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 function (d, b) { extendStatics(d, b); function __() { this.constructor = d } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __) } }(); var XhrHttpClient = function (_super) { __extends(XhrHttpClient, _super); function XhrHttpClient(logger) { var _this = _super.call(this) || this; _this.logger = logger; return _this } XhrHttpClient.prototype.send = function (request) { var _this = this; if (request.abortSignal && request.abortSignal.aborted) { return Promise.reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]) } if (!request.method) { return Promise.reject(new Error("No method defined.")) } if (!request.url) { return Promise.reject(new Error("No url defined.")) } return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest; xhr.open(request.method, request.url, true); xhr.withCredentials = true; xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); var headers = request.headers; if (headers) { Object.keys(headers).forEach(function (header) { xhr.setRequestHeader(header, headers[header]) }) } if (request.responseType) { xhr.responseType = request.responseType } if (request.abortSignal) { request.abortSignal.onabort = function () { xhr.abort(); reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]) } } if (request.timeout) { xhr.timeout = request.timeout } xhr.onload = function () { if (request.abortSignal) { request.abortSignal.onabort = null } if (xhr.status >= 200 && xhr.status < 300) { resolve(new _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"](xhr.status, xhr.statusText, xhr.response || xhr.responseText)) } else { reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText, xhr.status)) } }; xhr.onerror = function () { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Error from HTTP request. " + xhr.status + ": " + xhr.statusText + "."); reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText, xhr.status)) }; xhr.ontimeout = function () { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Timeout from HTTP request."); reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]) }; xhr.send(request.content || "") }) }; return XhrHttpClient }(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "LogLevel", function () { return LogLevel }); var LogLevel; (function (LogLevel) { LogLevel[LogLevel["Trace"] = 0] = "Trace"; LogLevel[LogLevel["Debug"] = 1] = "Debug"; LogLevel[LogLevel["Information"] = 2] = "Information"; LogLevel[LogLevel["Warning"] = 3] = "Warning"; LogLevel[LogLevel["Error"] = 4] = "Error"; LogLevel[LogLevel["Critical"] = 5] = "Critical"; LogLevel[LogLevel["None"] = 6] = "None" })(LogLevel || (LogLevel = {})) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HubConnectionState", function () { return HubConnectionState }); __webpack_require__.d(__webpack_exports__, "HubConnection", function () { return HubConnection }); var _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); var _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 DEFAULT_TIMEOUT_IN_MS = 30 * 1e3; var DEFAULT_PING_INTERVAL_IN_MS = 15 * 1e3; var HubConnectionState; (function (HubConnectionState) { HubConnectionState["Disconnected"] = "Disconnected"; HubConnectionState["Connecting"] = "Connecting"; HubConnectionState["Connected"] = "Connected"; HubConnectionState["Disconnecting"] = "Disconnecting"; HubConnectionState["Reconnecting"] = "Reconnecting" })(HubConnectionState || (HubConnectionState = {})); var HubConnection = function () { function HubConnection(connection, logger, protocol, reconnectPolicy) { var _this = this; _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(connection, "connection"); _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(logger, "logger"); _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(protocol, "protocol"); this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS; this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS; this.logger = logger; this.protocol = protocol; this.connection = connection; this.reconnectPolicy = reconnectPolicy; this.handshakeProtocol = new _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__["HandshakeProtocol"]; this.connection.onreceive = function (data) { return _this.processIncomingData(data) }; this.connection.onclose = function (error) { return _this.connectionClosed(error) }; this.callbacks = {}; this.methods = {}; this.closedCallbacks = []; this.reconnectingCallbacks = []; this.reconnectedCallbacks = []; this.invocationId = 0; this.receivedHandshakeResponse = false; this.connectionState = HubConnectionState.Disconnected; this.connectionStarted = false; this.cachedPingMessage = this.protocol.writeMessage({ type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Ping }) } HubConnection.create = function (connection, logger, protocol, reconnectPolicy) { return new HubConnection(connection, logger, protocol, reconnectPolicy) }; Object.defineProperty(HubConnection.prototype, "state", { get: function () { return this.connectionState }, enumerable: true, configurable: true }); Object.defineProperty(HubConnection.prototype, "connectionId", { get: function () { return this.connection ? this.connection.connectionId || null : null }, enumerable: true, configurable: true }); Object.defineProperty(HubConnection.prototype, "baseUrl", { get: function () { return this.connection.baseUrl || "" }, set: function (url) { if (this.connectionState !== HubConnectionState.Disconnected && this.connectionState !== HubConnectionState.Reconnecting) { throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.") } if (!url) { throw new Error("The HubConnection url must be a valid url.") } this.connection.baseUrl = url }, enumerable: true, configurable: true }); HubConnection.prototype.start = function () { this.startPromise = this.startWithStateTransitions(); return this.startPromise }; HubConnection.prototype.startWithStateTransitions = function () { return __awaiter(this, void 0, void 0, function () { var e_1; return __generator(this, function (_a) { switch (_a.label) { case 0: if (this.connectionState !== HubConnectionState.Disconnected) { return [2, Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))] } this.connectionState = HubConnectionState.Connecting; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Starting HubConnection."); _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); return [4, this.startInternal()]; case 2: _a.sent(); this.connectionState = HubConnectionState.Connected; this.connectionStarted = true; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection connected successfully."); return [3, 4]; case 3: e_1 = _a.sent(); this.connectionState = HubConnectionState.Disconnected; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection failed to start successfully because of error '" + e_1 + "'."); return [2, Promise.reject(e_1)]; case 4: return [2] } }) }) }; HubConnection.prototype.startInternal = function () { return __awaiter(this, void 0, void 0, function () { var handshakePromise, handshakeRequest, e_2; var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: this.stopDuringStartError = undefined; this.receivedHandshakeResponse = false; handshakePromise = new Promise(function (resolve, reject) { _this.handshakeResolver = resolve; _this.handshakeRejecter = reject }); return [4, this.connection.start(this.protocol.transferFormat)]; case 1: _a.sent(); _a.label = 2; case 2: _a.trys.push([2, 5, , 7]); handshakeRequest = { protocol: this.protocol.name, version: this.protocol.version }; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Sending handshake request."); return [4, this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))]; case 3: _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Using HubProtocol '" + this.protocol.name + "'."); this.cleanupTimeout(); this.resetTimeoutPeriod(); this.resetKeepAliveInterval(); return [4, handshakePromise]; case 4: _a.sent(); if (this.stopDuringStartError) { throw this.stopDuringStartError } return [3, 7]; case 5: e_2 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Hub handshake failed with error '" + e_2 + "' during start(). Stopping HubConnection."); this.cleanupTimeout(); this.cleanupPingTimer(); return [4, this.connection.stop(e_2)]; case 6: _a.sent(); throw e_2; case 7: return [2] } }) }) }; HubConnection.prototype.stop = function () { return __awaiter(this, void 0, void 0, function () { var startPromise, e_3; return __generator(this, function (_a) { switch (_a.label) { case 0: startPromise = this.startPromise; this.stopPromise = this.stopInternal(); return [4, this.stopPromise]; case 1: _a.sent(); _a.label = 2; case 2: _a.trys.push([2, 4, , 5]); return [4, startPromise]; case 3: _a.sent(); return [3, 5]; case 4: e_3 = _a.sent(); return [3, 5]; case 5: return [2] } }) }) }; HubConnection.prototype.stopInternal = function (error) { if (this.connectionState === HubConnectionState.Disconnected) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HubConnection.stop(" + error + ") ignored because it is already in the disconnected state."); return Promise.resolve() } if (this.connectionState === HubConnectionState.Disconnecting) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); return this.stopPromise } this.connectionState = HubConnectionState.Disconnecting; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Stopping HubConnection."); if (this.reconnectDelayHandle) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection stopped during reconnect delay. Done reconnecting."); clearTimeout(this.reconnectDelayHandle); this.reconnectDelayHandle = undefined; this.completeClose(); return Promise.resolve() } this.cleanupTimeout(); this.cleanupPingTimer(); this.stopDuringStartError = error || new Error("The connection was stopped before the hub handshake could complete."); return this.connection.stop(error) }; HubConnection.prototype.stream = function (methodName) { var _this = this; var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i] } var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; var invocationDescriptor = this.createStreamInvocation(methodName, args, streamIds); var promiseQueue; var subject = new _Subject__WEBPACK_IMPORTED_MODULE_3__["Subject"]; subject.cancelCallback = function () { var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId); delete _this.callbacks[invocationDescriptor.invocationId]; return promiseQueue.then(function () { return _this.sendWithProtocol(cancelInvocation) }) }; this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { if (error) { subject.error(error); return } else if (invocationEvent) { if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { if (invocationEvent.error) { subject.error(new Error(invocationEvent.error)) } else { subject.complete() } } else { subject.next(invocationEvent.item) } } }; promiseQueue = this.sendWithProtocol(invocationDescriptor).catch(function (e) { subject.error(e); delete _this.callbacks[invocationDescriptor.invocationId] }); this.launchStreams(streams, promiseQueue); return subject }; HubConnection.prototype.sendMessage = function (message) { this.resetKeepAliveInterval(); return this.connection.send(message) }; HubConnection.prototype.sendWithProtocol = function (message) { return this.sendMessage(this.protocol.writeMessage(message)) }; HubConnection.prototype.send = function (methodName) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i] } var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; var sendPromise = this.sendWithProtocol(this.createInvocation(methodName, args, true, streamIds)); this.launchStreams(streams, sendPromise); return sendPromise }; HubConnection.prototype.invoke = function (methodName) { var _this = this; var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i] } var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; var invocationDescriptor = this.createInvocation(methodName, args, false, streamIds); var p = new Promise(function (resolve, reject) { _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { if (error) { reject(error); return } else if (invocationEvent) { if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { if (invocationEvent.error) { reject(new Error(invocationEvent.error)) } else { resolve(invocationEvent.result) } } else { reject(new Error("Unexpected message type: " + invocationEvent.type)) } } }; var promiseQueue = _this.sendWithProtocol(invocationDescriptor).catch(function (e) { reject(e); delete _this.callbacks[invocationDescriptor.invocationId] }); _this.launchStreams(streams, promiseQueue) }); return p }; HubConnection.prototype.on = function (methodName, newMethod) { if (!methodName || !newMethod) { return } methodName = methodName.toLowerCase(); if (!this.methods[methodName]) { this.methods[methodName] = [] } if (this.methods[methodName].indexOf(newMethod) !== -1) { return } this.methods[methodName].push(newMethod) }; HubConnection.prototype.off = function (methodName, method) { if (!methodName) { return } methodName = methodName.toLowerCase(); var handlers = this.methods[methodName]; if (!handlers) { return } if (method) { var removeIdx = handlers.indexOf(method); if (removeIdx !== -1) { handlers.splice(removeIdx, 1); if (handlers.length === 0) { delete this.methods[methodName] } } } else { delete this.methods[methodName] } }; HubConnection.prototype.onclose = function (callback) { if (callback) { this.closedCallbacks.push(callback) } }; HubConnection.prototype.onreconnecting = function (callback) { if (callback) { this.reconnectingCallbacks.push(callback) } }; HubConnection.prototype.onreconnected = function (callback) { if (callback) { this.reconnectedCallbacks.push(callback) } }; HubConnection.prototype.processIncomingData = function (data) { this.cleanupTimeout(); if (!this.receivedHandshakeResponse) { data = this.processHandshakeResponse(data); this.receivedHandshakeResponse = true } if (data) { var messages = this.protocol.parseMessages(data, this.logger); for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { var message = messages_1[_i]; switch (message.type) { case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation: this.invokeClientMethod(message); break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem: case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion: var callback = this.callbacks[message.invocationId]; if (callback) { if (message.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { delete this.callbacks[message.invocationId] } callback(message) } break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Ping: break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Close: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Close message received from server."); var error = message.error ? new Error("Server returned an error on close: " + message.error) : undefined; if (message.allowReconnect === true) { this.connection.stop(error) } else { this.stopPromise = this.stopInternal(error) } break; default: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Invalid message type: " + message.type + "."); break } } } this.resetTimeoutPeriod() }; HubConnection.prototype.processHandshakeResponse = function (data) { var _a; var responseMessage; var remainingData; try { _a = this.handshakeProtocol.parseHandshakeResponse(data), remainingData = _a[0], responseMessage = _a[1] } catch (e) { var message = "Error parsing handshake response: " + e; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); var error = new Error(message); this.handshakeRejecter(error); throw error } if (responseMessage.error) { var message = "Server returned handshake error: " + responseMessage.error; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); var error = new Error(message); this.handshakeRejecter(error); throw error } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Server handshake complete.") } this.handshakeResolver(); return remainingData }; HubConnection.prototype.resetKeepAliveInterval = function () { var _this = this; this.cleanupPingTimer(); this.pingServerHandle = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: if (!(this.connectionState === HubConnectionState.Connected)) return [3, 4]; _b.label = 1; case 1: _b.trys.push([1, 3, , 4]); return [4, this.sendMessage(this.cachedPingMessage)]; case 2: _b.sent(); return [3, 4]; case 3: _a = _b.sent(); this.cleanupPingTimer(); return [3, 4]; case 4: return [2] } }) }) }, this.keepAliveIntervalInMilliseconds) }; HubConnection.prototype.resetTimeoutPeriod = function () { var _this = this; if (!this.connection.features || !this.connection.features.inherentKeepAlive) { this.timeoutHandle = setTimeout(function () { return _this.serverTimeout() }, this.serverTimeoutInMilliseconds) } }; HubConnection.prototype.serverTimeout = function () { this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server.")) }; HubConnection.prototype.invokeClientMethod = function (invocationMessage) { var _this = this; var methods = this.methods[invocationMessage.target.toLowerCase()]; if (methods) { try { methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments) }) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "A callback for the method " + invocationMessage.target.toLowerCase() + " threw error '" + e + "'.") } if (invocationMessage.invocationId) { var message = "Server requested a response, which is not supported in this version of the client."; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); this.stopPromise = this.stopInternal(new Error(message)) } } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "No client method with the name '" + invocationMessage.target + "' found.") } }; HubConnection.prototype.connectionClosed = function (error) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection.connectionClosed(" + error + ") called while in state " + this.connectionState + "."); this.stopDuringStartError = this.stopDuringStartError || error || new Error("The underlying connection was closed before the hub handshake could complete."); if (this.handshakeResolver) { this.handshakeResolver() } this.cancelCallbacksWithError(error || new Error("Invocation canceled due to the underlying connection being closed.")); this.cleanupTimeout(); this.cleanupPingTimer(); if (this.connectionState === HubConnectionState.Disconnecting) { this.completeClose(error) } else if (this.connectionState === HubConnectionState.Connected && this.reconnectPolicy) { this.reconnect(error) } else if (this.connectionState === HubConnectionState.Connected) { this.completeClose(error) } }; HubConnection.prototype.completeClose = function (error) { var _this = this; if (this.connectionStarted) { this.connectionState = HubConnectionState.Disconnected; this.connectionStarted = false; try { this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]) }) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onclose callback called with error '" + error + "' threw error '" + e + "'.") } } }; HubConnection.prototype.reconnect = function (error) { return __awaiter(this, void 0, void 0, function () { var reconnectStartTime, previousReconnectAttempts, retryError, nextRetryDelay, e_4; var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: reconnectStartTime = Date.now(); previousReconnectAttempts = 0; retryError = error !== undefined ? error : new Error("Attempting to reconnect due to a unknown error."); nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, 0, retryError); if (nextRetryDelay === null) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."); this.completeClose(error); return [2] } this.connectionState = HubConnectionState.Reconnecting; if (error) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting because of error '" + error + "'.") } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting.") } if (this.onreconnecting) { try { this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]) }) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnecting callback called with error '" + error + "' threw error '" + e + "'.") } if (this.connectionState !== HubConnectionState.Reconnecting) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state in onreconnecting callback. Done reconnecting."); return [2] } } _a.label = 1; case 1: if (!(nextRetryDelay !== null)) return [3, 7]; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt number " + previousReconnectAttempts + " will start in " + nextRetryDelay + " ms."); return [4, new Promise(function (resolve) { _this.reconnectDelayHandle = setTimeout(resolve, nextRetryDelay) })]; case 2: _a.sent(); this.reconnectDelayHandle = undefined; if (this.connectionState !== HubConnectionState.Reconnecting) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect delay. Done reconnecting."); return [2] } _a.label = 3; case 3: _a.trys.push([3, 5, , 6]); return [4, this.startInternal()]; case 4: _a.sent(); this.connectionState = HubConnectionState.Connected; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "HubConnection reconnected successfully."); if (this.onreconnected) { try { this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]) }) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnected callback called with connectionId '" + this.connection.connectionId + "; threw error '" + e + "'.") } } return [2]; case 5: e_4 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt failed because of error '" + e_4 + "'."); if (this.connectionState !== HubConnectionState.Reconnecting) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect attempt. Done reconnecting."); return [2] } retryError = e_4 instanceof Error ? e_4 : new Error(e_4.toString()); nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError); return [3, 6]; case 6: return [3, 1]; case 7: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect retries have been exhausted after " + (Date.now() - reconnectStartTime) + " ms and " + previousReconnectAttempts + " failed attempts. Connection disconnecting."); this.completeClose(); return [2] } }) }) }; HubConnection.prototype.getNextRetryDelay = function (previousRetryCount, elapsedMilliseconds, retryReason) { try { return this.reconnectPolicy.nextRetryDelayInMilliseconds({ elapsedMilliseconds: elapsedMilliseconds, previousRetryCount: previousRetryCount, retryReason: retryReason }) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "IRetryPolicy.nextRetryDelayInMilliseconds(" + previousRetryCount + ", " + elapsedMilliseconds + ") threw error '" + e + "'."); return null } }; HubConnection.prototype.cancelCallbacksWithError = function (error) { var callbacks = this.callbacks; this.callbacks = {}; Object.keys(callbacks).forEach(function (key) { var callback = callbacks[key]; callback(null, error) }) }; HubConnection.prototype.cleanupPingTimer = function () { if (this.pingServerHandle) { clearTimeout(this.pingServerHandle) } }; HubConnection.prototype.cleanupTimeout = function () { if (this.timeoutHandle) { clearTimeout(this.timeoutHandle) } }; HubConnection.prototype.createInvocation = function (methodName, args, nonblocking, streamIds) { if (nonblocking) { return { arguments: args, streamIds: streamIds, target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation } } else { var invocationId = this.invocationId; this.invocationId++; return { arguments: args, invocationId: invocationId.toString(), streamIds: streamIds, target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation } } }; HubConnection.prototype.launchStreams = function (streams, promiseQueue) { var _this = this; if (streams.length === 0) { return } if (!promiseQueue) { promiseQueue = Promise.resolve() } var _loop_1 = function (streamId) { streams[streamId].subscribe({ complete: function () { promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId)) }) }, error: function (err) { var message; if (err instanceof Error) { message = err.message } else if (err && err.toString) { message = err.toString() } else { message = "Unknown error" } promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId, message)) }) }, next: function (item) { promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createStreamItemMessage(streamId, item)) }) } }) }; for (var streamId in streams) { _loop_1(streamId) } }; HubConnection.prototype.replaceStreamingParams = function (args) { var streams = []; var streamIds = []; for (var i = 0; i < args.length; i++) { var argument = args[i]; if (this.isObservable(argument)) { var streamId = this.invocationId; this.invocationId++; streams[streamId] = argument; streamIds.push(streamId.toString()); args.splice(i, 1) } } return [streams, streamIds] }; HubConnection.prototype.isObservable = function (arg) { return arg && arg.subscribe && typeof arg.subscribe === "function" }; HubConnection.prototype.createStreamInvocation = function (methodName, args, streamIds) { var invocationId = this.invocationId; this.invocationId++; return { arguments: args, invocationId: invocationId.toString(), streamIds: streamIds, target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamInvocation } }; HubConnection.prototype.createCancelInvocation = function (id) { return { invocationId: id, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].CancelInvocation } }; HubConnection.prototype.createStreamItemMessage = function (id, item) { return { invocationId: id, item: item, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem } }; HubConnection.prototype.createCompletionMessage = function (id, error, result) { if (error) { return { error: error, invocationId: id, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion } } return { invocationId: id, result: result, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion } }; return HubConnection }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HandshakeProtocol", function () { return HandshakeProtocol }); var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12); var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); var HandshakeProtocol = function () { function HandshakeProtocol() { } HandshakeProtocol.prototype.writeHandshakeRequest = function (handshakeRequest) { return _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].write(JSON.stringify(handshakeRequest)) }; HandshakeProtocol.prototype.parseHandshakeResponse = function (data) { var responseMessage; var messageData; var remainingData; if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["isArrayBuffer"])(data) || typeof Buffer !== "undefined" && data instanceof Buffer) { var binaryData = new Uint8Array(data); var separatorIndex = binaryData.indexOf(_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].RecordSeparatorCode); if (separatorIndex === -1) { throw new Error("Message is incomplete.") } var responseLength = separatorIndex + 1; messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength)); remainingData = binaryData.byteLength > responseLength ? binaryData.slice(responseLength).buffer : null } else { var textData = data; var separatorIndex = textData.indexOf(_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].RecordSeparator); if (separatorIndex === -1) { throw new Error("Message is incomplete.") } var responseLength = separatorIndex + 1; messageData = textData.substring(0, responseLength); remainingData = textData.length > responseLength ? textData.substring(responseLength) : null } var messages = _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].parse(messageData); var response = JSON.parse(messages[0]); if (response.type) { throw new Error("Expected a handshake response from the server.") } responseMessage = response; return [remainingData, responseMessage] }; return HandshakeProtocol }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "TextMessageFormat", function () { return TextMessageFormat }); var TextMessageFormat = function () { function TextMessageFormat() { } TextMessageFormat.write = function (output) { return "" + output + TextMessageFormat.RecordSeparator }; TextMessageFormat.parse = function (input) { if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { throw new Error("Message is incomplete.") } var messages = input.split(TextMessageFormat.RecordSeparator); messages.pop(); return messages }; TextMessageFormat.RecordSeparatorCode = 30; TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); return TextMessageFormat }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "Arg", function () { return Arg }); __webpack_require__.d(__webpack_exports__, "Platform", function () { return Platform }); __webpack_require__.d(__webpack_exports__, "getDataDetail", function () { return getDataDetail }); __webpack_require__.d(__webpack_exports__, "formatArrayBuffer", function () { return formatArrayBuffer }); __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function () { return isArrayBuffer }); __webpack_require__.d(__webpack_exports__, "sendMessage", function () { return sendMessage }); __webpack_require__.d(__webpack_exports__, "createLogger", function () { return createLogger }); __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function () { return SubjectSubscription }); __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function () { return ConsoleLogger }); var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); var _Loggers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 Arg = function () { function Arg() { } Arg.isRequired = function (val, name) { if (val === null || val === undefined) { throw new Error("The '" + name + "' argument is required.") } }; Arg.isIn = function (val, values, name) { if (!(val in values)) { throw new Error("Unknown " + name + " value: " + val + ".") } }; return Arg }(); var Platform = function () { function Platform() { } Object.defineProperty(Platform, "isBrowser", { get: function () { return typeof window === "object" }, enumerable: true, configurable: true }); Object.defineProperty(Platform, "isWebWorker", { get: function () { return typeof self === "object" && "importScripts" in self }, enumerable: true, configurable: true }); Object.defineProperty(Platform, "isNode", { get: function () { return !this.isBrowser && !this.isWebWorker }, enumerable: true, configurable: true }); return Platform }(); function getDataDetail(data, includeContent) { var detail = ""; if (isArrayBuffer(data)) { detail = "Binary data of length " + data.byteLength; if (includeContent) { detail += ". Content: '" + formatArrayBuffer(data) + "'" } } else if (typeof data === "string") { detail = "String data of length " + data.length; if (includeContent) { detail += ". Content: '" + data + "'" } } return detail } function formatArrayBuffer(data) { var view = new Uint8Array(data); var str = ""; view.forEach(function (num) { var pad = num < 16 ? "0" : ""; str += "0x" + pad + num.toString(16) + " " }); return str.substr(0, str.length - 1) } function isArrayBuffer(val) { return val && typeof ArrayBuffer !== "undefined" && (val instanceof ArrayBuffer || val.constructor && val.constructor.name === "ArrayBuffer") } function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, logMessageContent) { return __awaiter(this, void 0, void 0, function () { var _a, headers, token, responseType, response; return __generator(this, function (_b) { switch (_b.label) { case 0: if (!accessTokenFactory) return [3, 2]; return [4, accessTokenFactory()]; case 1: token = _b.sent(); if (token) { headers = (_a = {}, _a["Authorization"] = "Bearer " + token, _a) } _b.label = 2; case 2: logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(" + transportName + " transport) sending data. " + getDataDetail(content, logMessageContent) + "."); responseType = isArrayBuffer(content) ? "arraybuffer" : "text"; return [4, httpClient.post(url, { content: content, headers: headers, responseType: responseType })]; case 3: response = _b.sent(); logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(" + transportName + " transport) request complete. Response status: " + response.statusCode + "."); return [2] } }) }) } function createLogger(logger) { if (logger === undefined) { return new ConsoleLogger(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information) } if (logger === null) { return _Loggers__WEBPACK_IMPORTED_MODULE_1__["NullLogger"].instance } if (logger.log) { return logger } return new ConsoleLogger(logger) } var SubjectSubscription = function () { function SubjectSubscription(subject, observer) { this.subject = subject; this.observer = observer } SubjectSubscription.prototype.dispose = function () { var index = this.subject.observers.indexOf(this.observer); if (index > -1) { this.subject.observers.splice(index, 1) } if (this.subject.observers.length === 0 && this.subject.cancelCallback) { this.subject.cancelCallback().catch(function (_) { }) } }; return SubjectSubscription }(); var ConsoleLogger = function () { function ConsoleLogger(minimumLogLevel) { this.minimumLogLevel = minimumLogLevel; this.outputConsole = console } ConsoleLogger.prototype.log = function (logLevel, message) { if (logLevel >= this.minimumLogLevel) { switch (logLevel) { case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Critical: case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Error: this.outputConsole.error("[" + (new Date).toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Warning: this.outputConsole.warn("[" + (new Date).toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information: this.outputConsole.info("[" + (new Date).toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; default: this.outputConsole.log("[" + (new Date).toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break } } }; return ConsoleLogger }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "NullLogger", function () { return NullLogger }); var NullLogger = function () { function NullLogger() { } NullLogger.prototype.log = function (_logLevel, _message) { }; NullLogger.instance = new NullLogger; return NullLogger }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "MessageType", function () { return MessageType }); var MessageType; (function (MessageType) { MessageType[MessageType["Invocation"] = 1] = "Invocation"; MessageType[MessageType["StreamItem"] = 2] = "StreamItem"; MessageType[MessageType["Completion"] = 3] = "Completion"; MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation"; MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation"; MessageType[MessageType["Ping"] = 6] = "Ping"; MessageType[MessageType["Close"] = 7] = "Close" })(MessageType || (MessageType = {})) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "Subject", function () { return Subject }); var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); var Subject = function () { function Subject() { this.observers = [] } Subject.prototype.next = function (item) { for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { var observer = _a[_i]; observer.next(item) } }; Subject.prototype.error = function (err) { for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { var observer = _a[_i]; if (observer.error) { observer.error(err) } } }; Subject.prototype.complete = function () { for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { var observer = _a[_i]; if (observer.complete) { observer.complete() } } }; Subject.prototype.subscribe = function (observer) { this.observers.push(observer); return new _Utils__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscription"](this, observer) }; return Subject }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function () { return HubConnectionBuilder }); var _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); var _HttpConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); var _HubConnection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); var _ILogger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9); var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25); var _Loggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(14); var _Utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13); var __assign = undefined && undefined.__assign || Object.assign || function (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 }; var LogLevelNameMapping = { trace: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Trace, debug: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Debug, info: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, information: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, warn: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, warning: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, error: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Error, critical: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Critical, none: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].None }; function parseLogLevel(name) { var mapping = LogLevelNameMapping[name.toLowerCase()]; if (typeof mapping !== "undefined") { return mapping } else { throw new Error("Unknown log level: " + name) } } var HubConnectionBuilder = function () { function HubConnectionBuilder() { } HubConnectionBuilder.prototype.configureLogging = function (logging) { _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(logging, "logging"); if (isLogger(logging)) { this.logger = logging } else if (typeof logging === "string") { var logLevel = parseLogLevel(logging); this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logLevel) } else { this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logging) } return this }; HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) { _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(url, "url"); this.url = url; if (typeof transportTypeOrOptions === "object") { this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions) } else { this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions }) } return this }; HubConnectionBuilder.prototype.withHubProtocol = function (protocol) { _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(protocol, "protocol"); this.protocol = protocol; return this }; HubConnectionBuilder.prototype.withAutomaticReconnect = function (retryDelaysOrReconnectPolicy) { if (this.reconnectPolicy) { throw new Error("A reconnectPolicy has already been set.") } if (!retryDelaysOrReconnectPolicy) { this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"] } else if (Array.isArray(retryDelaysOrReconnectPolicy)) { this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"](retryDelaysOrReconnectPolicy) } else { this.reconnectPolicy = retryDelaysOrReconnectPolicy } return this }; HubConnectionBuilder.prototype.build = function () { var httpConnectionOptions = this.httpConnectionOptions || {}; if (httpConnectionOptions.logger === undefined) { httpConnectionOptions.logger = this.logger } if (!this.url) { throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.") } var connection = new _HttpConnection__WEBPACK_IMPORTED_MODULE_1__["HttpConnection"](this.url, httpConnectionOptions); return _HubConnection__WEBPACK_IMPORTED_MODULE_2__["HubConnection"].create(connection, this.logger || _Loggers__WEBPACK_IMPORTED_MODULE_5__["NullLogger"].instance, this.protocol || new _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__["JsonHubProtocol"], this.reconnectPolicy) }; return HubConnectionBuilder }(); function isLogger(logger) { return logger.log !== undefined } }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "DefaultReconnectPolicy", function () { return DefaultReconnectPolicy }); var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2e3, 1e4, 3e4, null]; var DefaultReconnectPolicy = function () { function DefaultReconnectPolicy(retryDelays) { this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS } DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (retryContext) { return this.retryDelays[retryContext.previousRetryCount] }; return DefaultReconnectPolicy }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HttpConnection", function () { return HttpConnection }); __webpack_require__.d(__webpack_exports__, "TransportSendQueue", function () { return TransportSendQueue }); var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); var _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21); var _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23); var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13); var _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 MAX_REDIRECTS = 100; var WebSocketModule = null; var EventSourceModule = null; if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && "function" !== "undefined") { var requireFunc = true ? require : undefined; WebSocketModule = requireFunc("ws"); EventSourceModule = requireFunc("eventsource") } var HttpConnection = function () { function HttpConnection(url, options) { if (options === void 0) { options = {} } this.features = {}; this.negotiateVersion = 1; _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isRequired(url, "url"); this.logger = Object(_Utils__WEBPACK_IMPORTED_MODULE_5__["createLogger"])(options.logger); this.baseUrl = this.resolveUrl(url); options = options || {}; options.logMessageContent = options.logMessageContent || false; if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof WebSocket !== "undefined" && !options.WebSocket) { options.WebSocket = WebSocket } else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.WebSocket) { if (WebSocketModule) { options.WebSocket = WebSocketModule } } if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof EventSource !== "undefined" && !options.EventSource) { options.EventSource = EventSource } else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.EventSource) { if (typeof EventSourceModule !== "undefined") { options.EventSource = EventSourceModule } } this.httpClient = options.httpClient || new _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__["DefaultHttpClient"](this.logger); this.connectionState = "Disconnected"; this.connectionStarted = false; this.options = options; this.onreceive = null; this.onclose = null } HttpConnection.prototype.start = function (transferFormat) { return __awaiter(this, void 0, void 0, function () { var message, message; return __generator(this, function (_a) { switch (_a.label) { case 0: transferFormat = transferFormat || _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Binary; _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"], "transferFormat"); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Starting connection with transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][transferFormat] + "'."); if (this.connectionState !== "Disconnected") { return [2, Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))] } this.connectionState = "Connecting "; this.startInternalPromise = this.startInternal(transferFormat); return [4, this.startInternalPromise]; case 1: _a.sent(); if (!(this.connectionState === "Disconnecting")) return [3, 3]; message = "Failed to start the HttpConnection before stop() was called."; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); return [4, this.stopPromise]; case 2: _a.sent(); return [2, Promise.reject(new Error(message))]; case 3: if (this.connectionState !== "Connected") { message = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!"; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); return [2, Promise.reject(new Error(message))] } _a.label = 4; case 4: this.connectionStarted = true; return [2] } }) }) }; HttpConnection.prototype.send = function (data) { if (this.connectionState !== "Connected") { return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) } if (!this.sendQueue) { this.sendQueue = new TransportSendQueue(this.transport) } return this.sendQueue.send(data) }; HttpConnection.prototype.stop = function (error) { return __awaiter(this, void 0, void 0, function () { var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: if (this.connectionState === "Disconnected") { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnected state."); return [2, Promise.resolve()] } if (this.connectionState === "Disconnecting") { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); return [2, this.stopPromise] } this.connectionState = "Disconnecting"; this.stopPromise = new Promise(function (resolve) { _this.stopPromiseResolver = resolve }); return [4, this.stopInternal(error)]; case 1: _a.sent(); return [4, this.stopPromise]; case 2: _a.sent(); return [2] } }) }) }; HttpConnection.prototype.stopInternal = function (error) { return __awaiter(this, void 0, void 0, function () { var e_1, e_2, e_3; return __generator(this, function (_a) { switch (_a.label) { case 0: this.stopError = error; _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); return [4, this.startInternalPromise]; case 2: _a.sent(); return [3, 4]; case 3: e_1 = _a.sent(); return [3, 4]; case 4: if (!this.sendQueue) return [3, 9]; _a.label = 5; case 5: _a.trys.push([5, 7, , 8]); return [4, this.sendQueue.stop()]; case 6: _a.sent(); return [3, 8]; case 7: e_2 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "TransportSendQueue.stop() threw error '" + e_2 + "'."); return [3, 8]; case 8: this.sendQueue = undefined; _a.label = 9; case 9: if (!this.transport) return [3, 14]; _a.label = 10; case 10: _a.trys.push([10, 12, , 13]); return [4, this.transport.stop()]; case 11: _a.sent(); return [3, 13]; case 12: e_3 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.transport.stop() threw error '" + e_3 + "'."); this.stopConnection(); return [3, 13]; case 13: this.transport = undefined; return [3, 15]; case 14: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."); this.stopConnection(); _a.label = 15; case 15: return [2] } }) }) }; HttpConnection.prototype.startInternal = function (transferFormat) { return __awaiter(this, void 0, void 0, function () { var url, negotiateResponse, redirects, _loop_1, this_1, e_4; return __generator(this, function (_a) { switch (_a.label) { case 0: url = this.baseUrl; this.accessTokenFactory = this.options.accessTokenFactory; _a.label = 1; case 1: _a.trys.push([1, 12, , 13]); if (!this.options.skipNegotiation) return [3, 5]; if (!(this.options.transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets)) return [3, 3]; this.transport = this.constructTransport(_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets); return [4, this.startTransport(url, transferFormat)]; case 2: _a.sent(); return [3, 4]; case 3: throw new Error("Negotiation can only be skipped when using the WebSocket transport directly."); case 4: return [3, 11]; case 5: negotiateResponse = null; redirects = 0; _loop_1 = function () { var accessToken_1; return __generator(this, function (_a) { switch (_a.label) { case 0: return [4, this_1.getNegotiationResponse(url)]; case 1: negotiateResponse = _a.sent(); if (this_1.connectionState === "Disconnecting" || this_1.connectionState === "Disconnected") { throw new Error("The connection was stopped during negotiation.") } if (negotiateResponse.error) { throw new Error(negotiateResponse.error) } if (negotiateResponse.ProtocolVersion) { throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.") } if (negotiateResponse.url) { url = negotiateResponse.url } if (negotiateResponse.accessToken) { accessToken_1 = negotiateResponse.accessToken; this_1.accessTokenFactory = function () { return accessToken_1 } } redirects++; return [2] } }) }; this_1 = this; _a.label = 6; case 6: return [5, _loop_1()]; case 7: _a.sent(); _a.label = 8; case 8: if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3, 6]; _a.label = 9; case 9: if (redirects === MAX_REDIRECTS && negotiateResponse.url) { throw new Error("Negotiate redirection limit exceeded.") } return [4, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)]; case 10: _a.sent(); _a.label = 11; case 11: if (this.transport instanceof _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__["LongPollingTransport"]) { this.features.inherentKeepAlive = true } if (this.connectionState === "Connecting ") { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "The HttpConnection connected successfully."); this.connectionState = "Connected" } return [3, 13]; case 12: e_4 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the connection: " + e_4); this.connectionState = "Disconnected"; this.transport = undefined; return [2, Promise.reject(e_4)]; case 13: return [2] } }) }) }; HttpConnection.prototype.getNegotiationResponse = function (url) { return __awaiter(this, void 0, void 0, function () { var _a, headers, token, negotiateUrl, response, negotiateResponse, e_5; return __generator(this, function (_b) { switch (_b.label) { case 0: if (!this.accessTokenFactory) return [3, 2]; return [4, this.accessTokenFactory()]; case 1: token = _b.sent(); if (token) { headers = (_a = {}, _a["Authorization"] = "Bearer " + token, _a) } _b.label = 2; case 2: negotiateUrl = this.resolveNegotiateUrl(url); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Sending negotiation request: " + negotiateUrl + "."); _b.label = 3; case 3: _b.trys.push([3, 5, , 6]); return [4, this.httpClient.post(negotiateUrl, { content: "", headers: headers })]; case 4: response = _b.sent(); if (response.statusCode !== 200) { return [2, Promise.reject(new Error("Unexpected status code returned from negotiate " + response.statusCode))] } negotiateResponse = JSON.parse(response.content); if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) { negotiateResponse.connectionToken = negotiateResponse.connectionId } return [2, negotiateResponse]; case 5: e_5 = _b.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to complete negotiation with the server: " + e_5); return [2, Promise.reject(e_5)]; case 6: return [2] } }) }) }; HttpConnection.prototype.createConnectUrl = function (url, connectionToken) { if (!connectionToken) { return url } return url + (url.indexOf("?") === -1 ? "?" : "&") + ("id=" + connectionToken) }; HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) { return __awaiter(this, void 0, void 0, function () { var connectUrl, transportExceptions, transports, negotiate, _i, transports_1, endpoint, transportOrError, ex_1, ex_2, message; return __generator(this, function (_a) { switch (_a.label) { case 0: connectUrl = this.createConnectUrl(url, negotiateResponse.connectionToken); if (!this.isITransport(requestedTransport)) return [3, 2]; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Connection was provided an instance of ITransport, using that directly."); this.transport = requestedTransport; return [4, this.startTransport(connectUrl, requestedTransferFormat)]; case 1: _a.sent(); this.connectionId = negotiateResponse.connectionId; return [2]; case 2: transportExceptions = []; transports = negotiateResponse.availableTransports || []; negotiate = negotiateResponse; _i = 0, transports_1 = transports; _a.label = 3; case 3: if (!(_i < transports_1.length)) return [3, 13]; endpoint = transports_1[_i]; transportOrError = this.resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat); if (!(transportOrError instanceof Error)) return [3, 4]; transportExceptions.push(endpoint.transport + " failed: " + transportOrError); return [3, 12]; case 4: if (!this.isITransport(transportOrError)) return [3, 12]; this.transport = transportOrError; if (!!negotiate) return [3, 9]; _a.label = 5; case 5: _a.trys.push([5, 7, , 8]); return [4, this.getNegotiationResponse(url)]; case 6: negotiate = _a.sent(); return [3, 8]; case 7: ex_1 = _a.sent(); return [2, Promise.reject(ex_1)]; case 8: connectUrl = this.createConnectUrl(url, negotiate.connectionToken); _a.label = 9; case 9: _a.trys.push([9, 11, , 12]); return [4, this.startTransport(connectUrl, requestedTransferFormat)]; case 10: _a.sent(); this.connectionId = negotiate.connectionId; return [2]; case 11: ex_2 = _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the transport '" + endpoint.transport + "': " + ex_2); negotiate = undefined; transportExceptions.push(endpoint.transport + " failed: " + ex_2); if (this.connectionState !== "Connecting ") { message = "Failed to select transport before stop() was called."; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, message); return [2, Promise.reject(new Error(message))] } return [3, 12]; case 12: _i++; return [3, 3]; case 13: if (transportExceptions.length > 0) { return [2, Promise.reject(new Error("Unable to connect to the server with any of the available transports. " + transportExceptions.join(" ")))] } return [2, Promise.reject(new Error("None of the transports supported by the client are supported by the server."))] } }) }) }; HttpConnection.prototype.constructTransport = function (transport) { switch (transport) { case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets: if (!this.options.WebSocket) { throw new Error("'WebSocket' is not supported in your environment.") } return new _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__["WebSocketTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.WebSocket); case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents: if (!this.options.EventSource) { throw new Error("'EventSource' is not supported in your environment.") } return new _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__["ServerSentEventsTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.EventSource); case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].LongPolling: return new _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__["LongPollingTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false); default: throw new Error("Unknown transport: " + transport + ".") } }; HttpConnection.prototype.startTransport = function (url, transferFormat) { var _this = this; this.transport.onreceive = this.onreceive; this.transport.onclose = function (e) { return _this.stopConnection(e) }; return this.transport.connect(url, transferFormat) }; HttpConnection.prototype.resolveTransportOrError = function (endpoint, requestedTransport, requestedTransferFormat) { var transport = _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][endpoint.transport]; if (transport === null || transport === undefined) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + endpoint.transport + "' because it is not supported by this client."); return new Error("Skipping transport '" + endpoint.transport + "' because it is not supported by this client.") } else { if (transportMatches(requestedTransport, transport)) { var transferFormats = endpoint.transferFormats.map(function (s) { return _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][s] }); if (transferFormats.indexOf(requestedTransferFormat) >= 0) { if (transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets && !this.options.WebSocket || transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents && !this.options.EventSource) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it is not supported in your environment.'"); return new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is not supported in your environment.") } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Selecting transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "'."); try { return this.constructTransport(transport) } catch (ex) { return ex } } } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it does not support the requested transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + "'."); return new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' does not support " + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + ".") } } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it was disabled by the client."); return new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is disabled by the client.") } } }; HttpConnection.prototype.isITransport = function (transport) { return transport && typeof transport === "object" && "connect" in transport }; HttpConnection.prototype.stopConnection = function (error) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.stopConnection(" + error + ") called while in state " + this.connectionState + "."); this.transport = undefined; error = this.stopError || error; this.stopError = undefined; if (this.connectionState === "Disconnected") { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection is already in the disconnected state."); return } if (this.connectionState === "Connecting ") { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Warning, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection hasn't yet left the in the connecting state."); return } if (this.connectionState === "Disconnecting") { this.stopPromiseResolver() } if (error) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Connection disconnected with error '" + error + "'.") } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Connection disconnected.") } this.connectionId = undefined; this.connectionState = "Disconnected"; if (this.onclose && this.connectionStarted) { this.connectionStarted = false; try { this.onclose(error) } catch (e) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.onclose(" + error + ") threw error '" + e + "'.") } } }; HttpConnection.prototype.resolveUrl = function (url) { if (url.lastIndexOf("https://", 0) === 0 || url.lastIndexOf("http://", 0) === 0) { return url } if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isBrowser || !window.document) { throw new Error("Cannot resolve '" + url + "'.") } var aTag = window.document.createElement("a"); aTag.href = url; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Normalizing '" + url + "' to '" + aTag.href + "'."); return aTag.href }; HttpConnection.prototype.resolveNegotiateUrl = function (url) { var index = url.indexOf("?"); var negotiateUrl = url.substring(0, index === -1 ? url.length : index); if (negotiateUrl[negotiateUrl.length - 1] !== "/") { negotiateUrl += "/" } negotiateUrl += "negotiate"; negotiateUrl += index === -1 ? "" : url.substring(index); if (negotiateUrl.indexOf("negotiateVersion") === -1) { negotiateUrl += index === -1 ? "?" : "&"; negotiateUrl += "negotiateVersion=" + this.negotiateVersion } return negotiateUrl }; return HttpConnection }(); function transportMatches(requestedTransport, actualTransport) { return !requestedTransport || (actualTransport & requestedTransport) !== 0 } var TransportSendQueue = function () { function TransportSendQueue(transport) { this.transport = transport; this.buffer = []; this.executing = true; this.sendBufferedData = new PromiseSource; this.transportResult = new PromiseSource; this.sendLoopPromise = this.sendLoop() } TransportSendQueue.prototype.send = function (data) { this.bufferData(data); if (!this.transportResult) { this.transportResult = new PromiseSource } return this.transportResult.promise }; TransportSendQueue.prototype.stop = function () { this.executing = false; this.sendBufferedData.resolve(); return this.sendLoopPromise }; TransportSendQueue.prototype.bufferData = function (data) { if (this.buffer.length && typeof this.buffer[0] !== typeof data) { throw new Error("Expected data to be of type " + typeof this.buffer + " but was of type " + typeof data) } this.buffer.push(data); this.sendBufferedData.resolve() }; TransportSendQueue.prototype.sendLoop = function () { return __awaiter(this, void 0, void 0, function () { var transportResult, data, error_1; return __generator(this, function (_a) { switch (_a.label) { case 0: if (false) { } return [4, this.sendBufferedData.promise]; case 1: _a.sent(); if (!this.executing) { if (this.transportResult) { this.transportResult.reject("Connection stopped.") } return [3, 6] } this.sendBufferedData = new PromiseSource; transportResult = this.transportResult; this.transportResult = undefined; data = typeof this.buffer[0] === "string" ? this.buffer.join("") : TransportSendQueue.concatBuffers(this.buffer); this.buffer.length = 0; _a.label = 2; case 2: _a.trys.push([2, 4, , 5]); return [4, this.transport.send(data)]; case 3: _a.sent(); transportResult.resolve(); return [3, 5]; case 4: error_1 = _a.sent(); transportResult.reject(error_1); return [3, 5]; case 5: return [3, 0]; case 6: return [2] } }) }) }; TransportSendQueue.concatBuffers = function (arrayBuffers) { var totalLength = arrayBuffers.map(function (b) { return b.byteLength }).reduce(function (a, b) { return a + b }); var result = new Uint8Array(totalLength); var offset = 0; for (var _i = 0, arrayBuffers_1 = arrayBuffers; _i < arrayBuffers_1.length; _i++) { var item = arrayBuffers_1[_i]; result.set(new Uint8Array(item), offset); offset += item.byteLength } return result }; return TransportSendQueue }(); var PromiseSource = function () { function PromiseSource() { var _this = this; this.promise = new Promise(function (resolve, reject) { var _a; return _a = [resolve, reject], _this.resolver = _a[0], _this.rejecter = _a[1], _a }) } PromiseSource.prototype.resolve = function () { this.resolver() }; PromiseSource.prototype.reject = function (reason) { this.rejecter(reason) }; return PromiseSource }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "HttpTransportType", function () { return HttpTransportType }); __webpack_require__.d(__webpack_exports__, "TransferFormat", function () { return TransferFormat }); var HttpTransportType; (function (HttpTransportType) { HttpTransportType[HttpTransportType["None"] = 0] = "None"; HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets"; HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents"; HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling" })(HttpTransportType || (HttpTransportType = {})); var TransferFormat; (function (TransferFormat) { TransferFormat[TransferFormat["Text"] = 1] = "Text"; TransferFormat[TransferFormat["Binary"] = 2] = "Binary" })(TransferFormat || (TransferFormat = {})) }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "LongPollingTransport", function () { return LongPollingTransport }); var _AbortController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22); var _Errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); var _ITransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20); var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 LongPollingTransport = function () { function LongPollingTransport(httpClient, accessTokenFactory, logger, logMessageContent) { this.httpClient = httpClient; this.accessTokenFactory = accessTokenFactory; this.logger = logger; this.pollAbort = new _AbortController__WEBPACK_IMPORTED_MODULE_0__["AbortController"]; this.logMessageContent = logMessageContent; this.running = false; this.onreceive = null; this.onclose = null } Object.defineProperty(LongPollingTransport.prototype, "pollAborted", { get: function () { return this.pollAbort.aborted }, enumerable: true, configurable: true }); LongPollingTransport.prototype.connect = function (url, transferFormat) { return __awaiter(this, void 0, void 0, function () { var pollOptions, token, pollUrl, response; return __generator(this, function (_a) { switch (_a.label) { case 0: _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(url, "url"); _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(transferFormat, "transferFormat"); _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"], "transferFormat"); this.url = url; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Connecting."); if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"].Binary && (typeof XMLHttpRequest !== "undefined" && typeof (new XMLHttpRequest).responseType !== "string")) { throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.") } pollOptions = { abortSignal: this.pollAbort.signal, headers: {}, timeout: 1e5 }; if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"].Binary) { pollOptions.responseType = "arraybuffer" } return [4, this.getAccessToken()]; case 1: token = _a.sent(); this.updateHeaderToken(pollOptions, token); pollUrl = url + "&_=" + Date.now(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) polling: " + pollUrl + "."); return [4, this.httpClient.get(pollUrl, pollOptions)]; case 2: response = _a.sent(); if (response.statusCode !== 200) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "(LongPolling transport) Unexpected response code: " + response.statusCode + "."); this.closeError = new _Errors__WEBPACK_IMPORTED_MODULE_1__["HttpError"](response.statusText || "", response.statusCode); this.running = false } else { this.running = true } this.receiving = this.poll(this.url, pollOptions); return [2] } }) }) }; LongPollingTransport.prototype.getAccessToken = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: if (!this.accessTokenFactory) return [3, 2]; return [4, this.accessTokenFactory()]; case 1: return [2, _a.sent()]; case 2: return [2, null] } }) }) }; LongPollingTransport.prototype.updateHeaderToken = function (request, token) { if (!request.headers) { request.headers = {} } if (token) { request.headers["Authorization"] = "Bearer " + token; return } if (request.headers["Authorization"]) { delete request.headers["Authorization"] } }; LongPollingTransport.prototype.poll = function (url, pollOptions) { return __awaiter(this, void 0, void 0, function () { var token, pollUrl, response, e_1; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, , 8, 9]); _a.label = 1; case 1: if (!this.running) return [3, 7]; return [4, this.getAccessToken()]; case 2: token = _a.sent(); this.updateHeaderToken(pollOptions, token); _a.label = 3; case 3: _a.trys.push([3, 5, , 6]); pollUrl = url + "&_=" + Date.now(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) polling: " + pollUrl + "."); return [4, this.httpClient.get(pollUrl, pollOptions)]; case 4: response = _a.sent(); if (response.statusCode === 204) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "(LongPolling transport) Poll terminated by server."); this.running = false } else if (response.statusCode !== 200) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "(LongPolling transport) Unexpected response code: " + response.statusCode + "."); this.closeError = new _Errors__WEBPACK_IMPORTED_MODULE_1__["HttpError"](response.statusText || "", response.statusCode); this.running = false } else { if (response.content) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_4__["getDataDetail"])(response.content, this.logMessageContent) + "."); if (this.onreceive) { this.onreceive(response.content) } } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll timed out, reissuing.") } } return [3, 6]; case 5: e_1 = _a.sent(); if (!this.running) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll errored after shutdown: " + e_1.message) } else { if (e_1 instanceof _Errors__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll timed out, reissuing.") } else { this.closeError = e_1; this.running = false } } return [3, 6]; case 6: return [3, 1]; case 7: return [3, 9]; case 8: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Polling complete."); if (!this.pollAborted) { this.raiseOnClose() } return [7]; case 9: return [2] } }) }) }; LongPollingTransport.prototype.send = function (data) { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { if (!this.running) { return [2, Promise.reject(new Error("Cannot send until the transport is connected"))] } return [2, Object(_Utils__WEBPACK_IMPORTED_MODULE_4__["sendMessage"])(this.logger, "LongPolling", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)] }) }) }; LongPollingTransport.prototype.stop = function () { return __awaiter(this, void 0, void 0, function () { var deleteOptions, token; return __generator(this, function (_a) { switch (_a.label) { case 0: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Stopping polling."); this.running = false; this.pollAbort.abort(); _a.label = 1; case 1: _a.trys.push([1, , 5, 6]); return [4, this.receiving]; case 2: _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) sending DELETE request to " + this.url + "."); deleteOptions = { headers: {} }; return [4, this.getAccessToken()]; case 3: token = _a.sent(); this.updateHeaderToken(deleteOptions, token); return [4, this.httpClient.delete(this.url, deleteOptions)]; case 4: _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) DELETE request sent."); return [3, 6]; case 5: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Stop finished."); this.raiseOnClose(); return [7]; case 6: return [2] } }) }) }; LongPollingTransport.prototype.raiseOnClose = function () { if (this.onclose) { var logMessage = "(LongPolling transport) Firing onclose event."; if (this.closeError) { logMessage += " Error: " + this.closeError } this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, logMessage); this.onclose(this.closeError) } }; return LongPollingTransport }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "AbortController", function () { return AbortController }); var AbortController = function () { function AbortController() { this.isAborted = false; this.onabort = null } AbortController.prototype.abort = function () { if (!this.isAborted) { this.isAborted = true; if (this.onabort) { this.onabort() } } }; Object.defineProperty(AbortController.prototype, "signal", { get: function () { return this }, enumerable: true, configurable: true }); Object.defineProperty(AbortController.prototype, "aborted", { get: function () { return this.isAborted }, enumerable: true, configurable: true }); return AbortController }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "ServerSentEventsTransport", function () { return ServerSentEventsTransport }); var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 ServerSentEventsTransport = function () { function ServerSentEventsTransport(httpClient, accessTokenFactory, logger, logMessageContent, eventSourceConstructor) { this.httpClient = httpClient; this.accessTokenFactory = accessTokenFactory; this.logger = logger; this.logMessageContent = logMessageContent; this.eventSourceConstructor = eventSourceConstructor; this.onreceive = null; this.onclose = null } ServerSentEventsTransport.prototype.connect = function (url, transferFormat) { return __awaiter(this, void 0, void 0, function () { var token; var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(url, "url"); _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(transferFormat, "transferFormat"); _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"], "transferFormat"); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(SSE transport) Connecting."); this.url = url; if (!this.accessTokenFactory) return [3, 2]; return [4, this.accessTokenFactory()]; case 1: token = _a.sent(); if (token) { url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)) } _a.label = 2; case 2: return [2, new Promise(function (resolve, reject) { var opened = false; if (transferFormat !== _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"].Text) { reject(new Error("The Server-Sent Events transport only supports the 'Text' transfer format")); return } var eventSource; if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isBrowser || _Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isWebWorker) { eventSource = new _this.eventSourceConstructor(url, { withCredentials: true }) } else { var cookies = _this.httpClient.getCookieString(url); eventSource = new _this.eventSourceConstructor(url, { withCredentials: true, headers: { Cookie: cookies } }) } try { eventSource.onmessage = function (e) { if (_this.onreceive) { try { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(SSE transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(e.data, _this.logMessageContent) + "."); _this.onreceive(e.data) } catch (error) { _this.close(error); return } } }; eventSource.onerror = function (e) { var error = new Error(e.data || "Error occurred"); if (opened) { _this.close(error) } else { reject(error) } }; eventSource.onopen = function () { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information, "SSE connected to " + _this.url); _this.eventSource = eventSource; opened = true; resolve() } } catch (e) { reject(e); return } })] } }) }) }; ServerSentEventsTransport.prototype.send = function (data) { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { if (!this.eventSource) { return [2, Promise.reject(new Error("Cannot send until the transport is connected"))] } return [2, Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["sendMessage"])(this.logger, "SSE", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)] }) }) }; ServerSentEventsTransport.prototype.stop = function () { this.close(); return Promise.resolve() }; ServerSentEventsTransport.prototype.close = function (e) { if (this.eventSource) { this.eventSource.close(); this.eventSource = undefined; if (this.onclose) { this.onclose(e) } } }; return ServerSentEventsTransport }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "WebSocketTransport", function () { return WebSocketTransport }); var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value) }).then(fulfilled, rejected) } step((generator = generator.apply(thisArg, _arguments || [])).next()) }) }; var __generator = undefined && undefined.__generator || function (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 WebSocketTransport = function () { function WebSocketTransport(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor) { this.logger = logger; this.accessTokenFactory = accessTokenFactory; this.logMessageContent = logMessageContent; this.webSocketConstructor = webSocketConstructor; this.httpClient = httpClient; this.onreceive = null; this.onclose = null } WebSocketTransport.prototype.connect = function (url, transferFormat) { return __awaiter(this, void 0, void 0, function () { var token; var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(url, "url"); _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(transferFormat, "transferFormat"); _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"], "transferFormat"); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) Connecting."); if (!this.accessTokenFactory) return [3, 2]; return [4, this.accessTokenFactory()]; case 1: token = _a.sent(); if (token) { url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)) } _a.label = 2; case 2: return [2, new Promise(function (resolve, reject) { url = url.replace(/^http/, "ws"); var webSocket; var cookies = _this.httpClient.getCookieString(url); var opened = false; if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isNode && cookies) { webSocket = new _this.webSocketConstructor(url, undefined, { headers: { Cookie: "" + cookies } }) } if (!webSocket) { webSocket = new _this.webSocketConstructor(url) } if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"].Binary) { webSocket.binaryType = "arraybuffer" } webSocket.onopen = function (_event) { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information, "WebSocket connected to " + url + "."); _this.webSocket = webSocket; opened = true; resolve() }; webSocket.onerror = function (event) { var error = null; if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) { error = event.error } else { error = new Error("There was an error with the transport.") } reject(error) }; webSocket.onmessage = function (message) { _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(message.data, _this.logMessageContent) + "."); if (_this.onreceive) { _this.onreceive(message.data) } }; webSocket.onclose = function (event) { if (opened) { _this.close(event) } else { var error = null; if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) { error = event.error } else { error = new Error("There was an error with the transport.") } reject(error) } } })] } }) }) }; WebSocketTransport.prototype.send = function (data) { if (this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) sending data. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(data, this.logMessageContent) + "."); this.webSocket.send(data); return Promise.resolve() } return Promise.reject("WebSocket is not in the OPEN state") }; WebSocketTransport.prototype.stop = function () { if (this.webSocket) { this.webSocket.onclose = function () { }; this.webSocket.onmessage = function () { }; this.webSocket.onerror = function () { }; this.webSocket.close(); this.webSocket = undefined; this.close(undefined) } return Promise.resolve() }; WebSocketTransport.prototype.close = function (event) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) socket closed."); if (this.onclose) { if (event && (event.wasClean === false || event.code !== 1e3)) { this.onclose(new Error("WebSocket closed with status code: " + event.code + " (" + event.reason + ").")) } else { this.onclose() } } }; return WebSocketTransport }() }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function () { return JsonHubProtocol }); var _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); var _Loggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14); var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12); var JSON_HUB_PROTOCOL_NAME = "json"; var JsonHubProtocol = function () { function JsonHubProtocol() { this.name = JSON_HUB_PROTOCOL_NAME; this.version = 1; this.transferFormat = _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Text } JsonHubProtocol.prototype.parseMessages = function (input, logger) { if (typeof input !== "string") { throw new Error("Invalid input for JSON hub protocol. Expected a string.") } if (!input) { return [] } if (logger === null) { logger = _Loggers__WEBPACK_IMPORTED_MODULE_3__["NullLogger"].instance } var messages = _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__["TextMessageFormat"].parse(input); var hubMessages = []; for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { var message = messages_1[_i]; var parsedMessage = JSON.parse(message); if (typeof parsedMessage.type !== "number") { throw new Error("Invalid payload.") } switch (parsedMessage.type) { case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Invocation: this.isInvocationMessage(parsedMessage); break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].StreamItem: this.isStreamItemMessage(parsedMessage); break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Completion: this.isCompletionMessage(parsedMessage); break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Ping: break; case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Close: break; default: logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Unknown message type '" + parsedMessage.type + "' ignored."); continue }hubMessages.push(parsedMessage) } return hubMessages }; JsonHubProtocol.prototype.writeMessage = function (message) { return _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__["TextMessageFormat"].write(JSON.stringify(message)) }; JsonHubProtocol.prototype.isInvocationMessage = function (message) { this.assertNotEmptyString(message.target, "Invalid payload for Invocation message."); if (message.invocationId !== undefined) { this.assertNotEmptyString(message.invocationId, "Invalid payload for Invocation message.") } }; JsonHubProtocol.prototype.isStreamItemMessage = function (message) { this.assertNotEmptyString(message.invocationId, "Invalid payload for StreamItem message."); if (message.item === undefined) { throw new Error("Invalid payload for StreamItem message.") } }; JsonHubProtocol.prototype.isCompletionMessage = function (message) { if (message.result && message.error) { throw new Error("Invalid payload for Completion message.") } if (!message.result && message.error) { this.assertNotEmptyString(message.error, "Invalid payload for Completion message.") } this.assertNotEmptyString(message.invocationId, "Invalid payload for Completion message.") }; JsonHubProtocol.prototype.assertNotEmptyString = function (value, errorMessage) { if (typeof value !== "string" || value === "") { throw new Error(errorMessage) } }; return JsonHubProtocol }() }]) -}); -//# sourceMappingURL=signalr.min.js.map -"use strict"; -app.factory("AuthService", [ - "$http", - "$rootScope", - "$routeParams", - "$q", - "localStorageService", - "AppSettings", - function ( - $http, - $rootScope, - $routeParams, - $q, - localStorageService, - appSettings - ) { - var authServiceFactory = {}; - var _referredUrl = ""; - var _authentication = null; - - var _externalAuthData = { - provider: "", - userName: "", - externalAccessToken: "", - }; - - var _saveRegistration = function (registration) { - _logOut(); - - return $http - .post("/account/register", registration) - .then(function (response) { - return response; - }); - }; - var _forgotPassword = async function (data) { - var apiUrl = "/account/forgot-password"; - var req = { - method: "POST", - url: apiUrl, - data: JSON.stringify(data), - }; - var resp = await _getApiResult(req); - return resp; - }; - var _resetPassword = async function (data) { - var apiUrl = "/account/reset-password"; - var req = { - method: "POST", - url: apiUrl, - data: JSON.stringify(data), - }; - var resp = await _getApiResult(req); - return resp; - }; - - var _login = async function (loginData) { - var data = { - UserName: loginData.userName, - Password: loginData.password, - RememberMe: loginData.rememberMe, - Email: "", - ReturnUrl: "", - }; - var apiUrl = "/account/login"; - var req = { - method: "POST", - url: apiUrl, - data: JSON.stringify(data), - }; - var resp = await _getApiResult(req); - - if (resp.isSucceed) { - data = resp.data; - var authData = { - userRoles: data.info.userRoles, - token: data.access_token, - userName: data.info.user.username, - roleNames: data.info.userRoles.map((i) => i.role.normalizedName), - avatar: data.info.user.avatar, - refresh_token: data.refresh_token, - userId: data.info.user.id, - }; - var encrypted = $rootScope.encrypt(JSON.stringify(authData)); - localStorageService.set("authorizationData", encrypted); - _authentication = { - isAuth: true, - userName: data.info.user.username, - userId: data.info.user.id, - roleNames: data.info.userRoles.map((i) => i.role.normalizedName), - token: data.access_token, - useRefreshTokens: loginData.rememberme, - avatar: data.info.user.avatar, - refresh_token: data.refresh_token, - referredUrl: "/", - }; - angular.forEach(data.info.userRoles, function (value, key) { - if ( - value.role.name === "SuperAdmin" - //|| value.role.name === 'Admin' - ) { - _authentication.isAdmin = true; - } - }); - this.authentication = _authentication; - _initSettings().then(function () { - if ($routeParams.ReturnUrl) { - setTimeout(() => { - window.top.location = $routeParams.ReturnUrl; - }, 200); - } else if ( - document.referrer && - document.referrer.indexOf("init") === -1 - ) { - setTimeout(() => { - window.top.location = document.referrer; - }, 200); - } else { - setTimeout(() => { - window.top.location = "/"; - }, 200); - } - }); - } else { - $rootScope.isBusy = false; - $rootScope.showErrors(resp.errors); - } - return resp; - }; - - var _loginPopup = async function (loginData) { - var data = { - UserName: loginData.userName, - Password: loginData.password, - RememberMe: loginData.rememberMe, - Email: "", - ReturnUrl: "", - }; - var apiUrl = "/account/login"; - var req = { - method: "POST", - url: apiUrl, - data: JSON.stringify(data), - }; - var resp = await _getApiResult(req); - - if (resp.isSucceed) { - data = resp.data; - var authData = { - userRoles: data.info.userRoles, - token: data.access_token, - userName: data.info.user.username, - roleNames: data.info.userRoles.map((i) => i.role.normalizedName), - avatar: data.info.user.avatar, - refresh_token: data.refresh_token, - userId: data.info.user.id, - }; - var encrypted = $rootScope.encrypt(JSON.stringify(authData)); - localStorageService.set("authorizationData", encrypted); - _authentication = { - isAuth: true, - userName: data.info.user.NickName, - userId: data.info.user.id, - roleNames: data.info.userRoles.map((i) => i.role.normalizedName), - token: data.access_token, - useRefreshTokens: loginData.rememberme, - avatar: data.info.user.avatar, - refresh_token: data.refresh_token, - referredUrl: "/", - }; - angular.forEach(data.info.userRoles, function (value, key) { - if ( - value.role.name === "SuperAdmin" - //|| value.role.name === 'Admin' - ) { - _authentication.isAdmin = true; - } - }); - this.authentication = _authentication; - _initSettings().then(function () { - return resp; - }); - } else { - $rootScope.isBusy = false; - $rootScope.showErrors(resp.errors); - } - return resp; - }; - - var _logOut = async function () { - var apiUrl = "/account/logout"; - var req = { - method: "GET", - url: apiUrl, - }; - var resp = await _getApiResult(req); - if (resp.isSucceed) { - localStorageService.remove("authorizationData"); - _authentication = null; - // window.top.location.href = '/security/login'; - } - }; - - var _fillAuthData = async function () { - var encryptedAuthData = localStorageService.get("authorizationData"); - - if (encryptedAuthData) { - var authData = JSON.parse($rootScope.decrypt(encryptedAuthData)); - _authentication = { - isAuth: true, - userName: authData.userName, - userId: authData.userId, - roleNames: authData.roleNames, - token: authData.token, - useRefreshTokens: authData.useRefreshTokens, - avatar: authData.avatar, - refresh_token: authData.refresh_token, - referredUrl: "/", - }; - angular.forEach(authData.userRoles, function (value, key) { - if ( - value.role.name === "SuperAdmin" - //|| value.role.name === 'Admin' - ) { - _authentication.isAdmin = true; - } - }); - this.authentication = _authentication; - } - }; - - var _getSettings = async function (culture) { - var settings = localStorageService.get("settings"); - // && culture !== undefined && settings.lang === culture - if (settings) { - return settings; - } else { - var url = "/portal"; - if (culture) { - url += "/" + culture; - } - url += "/all-settings"; - var req = { - method: "GET", - url: url, - }; - return _getApiResult(req).then(function (response) { - return response.data; - }); - } - }; - - var _fillSettings = async function (culture) { - var settings = localStorageService.get("settings"); - if (settings && settings.lang === culture) { - _settings = settings; - return settings; - } else { - if (culture !== undefined && settings && settings.lang !== culture) { - await _removeSettings(); - await _removeTranslator(); - } - settings = await _getSettings(culture); - localStorageService.set("settings", settings); - //window.top.location = location.href; - return settings; - } - }; - - var _initSettings = async function (culture) { - localStorageService.remove("settings"); - localStorageService.remove("translator"); - localStorageService.remove("globalSettings"); - - var response = await _getSettings(culture); - localStorageService.set("settings", response.settings); - localStorageService.set("translator", response.translator); - localStorageService.set("globalSettings", response.globalSettings); - - return response; - }; - - var _refreshToken = function (id) { - var deferred = $q.defer(); - if (id) { - var url = - appSettings.serviceBase + - "/api/" + - appSettings.apiVersion + - "/account/refresh-token/" + - id; - $http.get(url).then( - function (response) { - var data = response.data.data; - - if (data) { - try { - var authData = { - userRoles: data.info.userRoles, - token: data.access_token, - userName: data.info.user.firstName, - roleNames: data.info.userRoles.map( - (i) => i.role.normalizedName - ), - avatar: data.info.user.avatar, - refresh_token: data.refresh_token, - userId: data.info.user.id, - }; - var encrypted = $rootScope.encrypt(JSON.stringify(authData)); - localStorageService.set("authorizationData", encrypted); - authData.token = data.access_token; - authData.refresh_token = data.refresh_token; - _authentication.token = data.access_token; - _authentication.refresh_token = data.refresh_token; - if ( - !$rootScope.globalSettings.lastUpdateConfiguration || - $rootScope.globalSettings.lastUpdateConfiguration < - data.lastUpdateConfiguration - ) { - _initSettings(); - } - } catch (e) { - _logOut(); - deferred.reject(e); - } - } - - deferred.resolve(response); - }, - function (error) { - _logOut(); - deferred.reject(error); - } - ); - } else { - _logOut(); - deferred.reject(); - } - return deferred.promise; - }; - - var _obtainAccessToken = function (externalData) { - var deferred = $q.defer(); - var url = - appSettings.serviceBase + - "/" + - appSettings.apiVersion + - "/account/ObtainLocalAccessToken"; - $http - .get(url, { - params: { - provider: externalData.provider, - externalAccessToken: externalData.externalAccessToken, - }, - }) - .success(function (response) { - localStorageService.set("authorizationData", { - token: response.access_token, - userName: response.userName, - roleName: response.userData.roleNames, - refresh_token: response.refresh_token, - useRefreshTokens: true, - }); - - _authentication.isAuth = true; - _authentication.isAdmin = _authentication.isAdmin = - $.inArray("SuperAdmin", response.userData.RoleNames) >= 0; - _authentication.userName = response.userName; - _authentication.useRefreshTokens = false; - - deferred.resolve(response); - }) - .error(function (err, status) { - _logOut(); - deferred.reject(err); - }); - - return deferred.promise; - }; - - var _registerExternal = function (registerExternalData) { - var deferred = $q.defer(); - - $http - .post( - appSettings.serviceBase + - "/" + - appSettings.apiVersion + - "/account/registerexternal", - registerExternalData - ) - .success(function (response) { - localStorageService.set("authorizationData", { - token: response.access_token, - userName: response.userName, - refresh_token: response.refresh_token, - useRefreshTokens: true, - }); - - _authentication.isAuth = true; - _authentication.userName = response.userName; - _authentication.useRefreshTokens = false; - - deferred.resolve(response); - }) - .error(function (err, status) { - _logOut(); - deferred.reject(err); - }); - - return deferred.promise; - }; - - var _getApiResult = async function (req) { - $rootScope.isBusy = true; - req.url = - appSettings.serviceBase + "/api/" + appSettings.apiVersion + req.url; - - return $http(req).then( - function (resp) { - //var resp = results.data; - - return resp.data; - }, - function (error) { - var t = { - isSucceed: false, - errors: error.data.errors || [error.statusText], - }; - return t; - } - ); - }; - - var _isInRole = function (roleName) { - return this.authentication.roleNames.includes(roleName.toUpperCase()); - }; - - authServiceFactory.saveRegistration = _saveRegistration; - authServiceFactory.isInRole = _isInRole; - authServiceFactory.forgotPassword = _forgotPassword; - authServiceFactory.resetPassword = _resetPassword; - authServiceFactory.initSettings = _initSettings; - authServiceFactory.login = _login; - authServiceFactory.loginPopup = _loginPopup; - authServiceFactory.logOut = _logOut; - authServiceFactory.referredUrl = _referredUrl; - authServiceFactory.fillAuthData = _fillAuthData; - authServiceFactory.authentication = _authentication; - authServiceFactory.refreshToken = _refreshToken; - - authServiceFactory.obtainAccessToken = _obtainAccessToken; - authServiceFactory.externalAuthData = _externalAuthData; - authServiceFactory.registerExternal = _registerExternal; - - return authServiceFactory; - }, -]); - -"use strict"; -app.factory("BaseRestService", [ - "$rootScope", - "$routeParams", - "CommonService", - "localStorageService", - function ($rootScope, $routeParams, commonService) { - var serviceFactory = {}; - var _init = function (modelName, isGlobal, lang, serviceBase) { - this.modelName = modelName; - if(serviceBase){ - this.serviceBase = serviceBase; - } - if (!isGlobal && isGlobal != "true") { - if ($rootScope.settings || lang) { - this.lang = lang || $rootScope.settings.lang; - this.prefixUrl = "/rest/" + this.lang + "/" + modelName; - } - } else { - this.prefixUrl = "/rest/" + modelName; - } - }; - - var _duplicate = async function (params = [], queries) { - var url = this.prefixUrl + "/duplicate"; - for (let i = 0; i < params.length; i++) { - if (params[i] != undefined && params[i] != null) { - url += "/" + params[i]; - } - } - var querystring = _parseQuery(queries); - var req = { - method: "GET", - url: `${url}?${querystring}`, - }; - return await commonService.getRestApiResult(req); - }; - - var _getSingle = async function (params = [], queries) { - var url = this.prefixUrl; - for (let i = 0; i < params.length; i++) { - if (params[i] != undefined && params[i] != null) { - url += "/" + params[i]; - } - } - var querystring = _parseQuery(queries); - var req = { - method: "GET", - url: `${url}?${querystring}`, - }; - return await commonService.getRestApiResult(req); - }; - - var _clearCache = async function (params = [], queries) { - var url = this.prefixUrl; - for (let i = 0; i < params.length; i++) { - if (params[i] != undefined && params[i] != null) { - url += "/remove-cache/" + params[i]; - } - } - var querystring = _parseQuery(queries); - var req = { - method: "GET", - url: `${url}?${querystring}`, - }; - return await commonService.getRestApiResult(req); - }; - - var _getDefault = async function (queriesObj) { - var url = `${this.prefixUrl}/default`; - var querystring = _parseQuery(queriesObj); - var req = { - method: "GET", - url: `${url}?${querystring}`, - }; - return await commonService.getRestApiResult(req); - }; - var _count = async function (params = []) { - var url = this.prefixUrl + "/count"; - for (let i = 0; i < params.length; i++) { - if (params[i] != null) { - url += "/" + params[i]; - } - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - var _getList = async function (objData) { - var data = serviceFactory.parseQuery(objData); - var url = this.prefixUrl; - - if (data) { - url += "?"; - url = url.concat(data); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - - var _export = async function (objData) { - var data = serviceFactory.parseQuery(objData); - var url = this.prefixUrl + "/export"; - - if (data) { - url += "?"; - url = url.concat(data); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - - var _delete = async function (params = []) { - var url = this.prefixUrl; - for (let i = 0; i < params.length; i++) { - if (params[i] != null) { - url += "/" + params[i]; - } - } - var req = { - method: "DELETE", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - var _save = async function (objData) { - if (objData.id == 0 || objData.id == null) { - return await this.create(objData); - } else { - return await this.update(objData.id, objData); - } - }; - var _create = async function (objData) { - var url = this.prefixUrl; - var req = { - method: "POST", - url: url, - data: JSON.stringify(objData), - }; - return await commonService.getRestApiResult(req); - }; - - var _update = async function (id, objData) { - var url = this.prefixUrl + "/" + id; - var req = { - method: "PUT", - url: url, - data: objData, - }; - return await commonService.getRestApiResult(req); - }; - - var _saveFields = async function (id, objData) { - var url = this.prefixUrl + "/" + id; - var req = { - method: "PATCH", - url: url, - data: JSON.stringify(objData), - }; - return await commonService.getRestApiResult(req); - }; - - var _applyList = async function (objData) { - var url = this.prefixUrl + "/list-action"; - var req = { - method: "POST", - url: url, - data: JSON.stringify(objData), - }; - return await commonService.getRestApiResult(req); - }; - - var _ajaxSubmitForm = async function (form, url) { - var req = { - method: "POST", - url: url, - headers: { "Content-Type": undefined }, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: form, - }; - return await commonService.getRestApiResult(req); - }; - var _parseQuery = function (req) { - var result = ""; - if (req) { - for (var key in req) { - if (req.hasOwnProperty(key)) { - if (result != "") { - result += "&"; - } - result += `${key}=${req[key]}`; - } - } - return result; - } else { - return result; - } - }; - - serviceFactory.lang = ""; - serviceFactory.prefixUrl = ""; - serviceFactory.init = _init; - serviceFactory.count = _count; - serviceFactory.duplicate = _duplicate; - serviceFactory.applyList = _applyList; - serviceFactory.clearCache = _clearCache; - serviceFactory.getDefault = _getDefault; - serviceFactory.getSingle = _getSingle; - serviceFactory.getList = _getList; - serviceFactory.export = _export; - serviceFactory.create = _create; - serviceFactory.update = _update; - serviceFactory.save = _save; - serviceFactory.saveFields = _saveFields; - serviceFactory.delete = _delete; - serviceFactory.ajaxSubmitForm = _ajaxSubmitForm; - serviceFactory.parseQuery = _parseQuery; - return serviceFactory; - }, -]); - -'use strict'; -app.factory('BaseService', ['$rootScope', '$routeParams', 'CommonService', - function ($rootScope, $routeParams, commonService) { - var serviceFactory = {}; - - var _init = function (modelName, isGlobal, serviceBase) { - this.modelName = modelName; - this.serviceBase = serviceBase; - if (!isGlobal) { - this.lang = $rootScope.settings.lang; - this.prefixUrl = '/' + this.lang + '/' + modelName; - } - else { - this.prefixUrl = '/' + modelName; - } - } - var _getSingle = async function (params = []) { - var url = (this.prefixUrl || '/' + this.lang + '/' + this.modelName) + '/details'; - for (let i = 0; i < params.length; i++) { - if (params[i]) { - url += '/' + params[i]; - } - } - var req = { - method: 'GET', - serviceBase: this.serviceBase, - url: url - }; - return await commonService.getApiResult(req); - }; - var _getList = async function (objData, params = []) { - var url = this.prefixUrl + '/list'; - for (let i = 0; i < params.length; i++) { - url += '/' + params[i]; - } - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - - return await commonService.getApiResult(req); - }; - var _export = async function (objData, params = []) { - var url = this.prefixUrl + '/export'; - for (let i = 0; i < params.length; i++) { - url += '/' + params[i]; - } - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - - return await commonService.getApiResult(req); - }; - - var _delete = async function (id) { - var url = this.prefixUrl + '/delete/' + id; - var req = { - serviceBase: this.serviceBase, - method: 'GET', - url: url - }; - return await commonService.getApiResult(req); - }; - - var _save = async function (objData) { - var url = this.prefixUrl + '/save'; - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - var _saveProperties = async function (objData) { - var url = this.prefixUrl + '/save-properties'; - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - var _saveList = async function (objData) { - var url = this.prefixUrl + '/save-list'; - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - - var _updateInfos = async function (objData) { - var url = this.prefixUrl + '/update-infos'; - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - var _ajaxSubmitForm = async function (form, url) { - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - headers: { 'Content-Type': undefined }, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: form - }; - return await commonService.getApiResult(req); - }; - - var _applyList = async function (objData) { - var url = this.prefixUrl + '/apply-list'; - var req = { - serviceBase: this.serviceBase, - method: 'POST', - url: url, - data: JSON.stringify(objData) - }; - return await commonService.getApiResult(req); - }; - - serviceFactory.lang = ''; - serviceFactory.prefixUrl = ''; - serviceFactory.init = _init; - serviceFactory.getSingle = _getSingle; - serviceFactory.getList = _getList; - serviceFactory.export = _export; - serviceFactory.save = _save; - serviceFactory.saveProperties = _saveProperties; - serviceFactory.saveList = _saveList; - serviceFactory.applyList = _applyList; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - serviceFactory.ajaxSubmitForm = _ajaxSubmitForm; - return serviceFactory; - - }]); -"use strict"; -app.factory("CommonService", [ - "$location", - "$http", - "$rootScope", - "AuthService", - "localStorageService", - "AppSettings", - function ( - $location, - $http, - $rootScope, - authService, - localStorageService, - appSettings - ) { - var adminCommonFactory = {}; - var _settings = { - lang: "", - cultures: [], - }; - var _loadJArrayData = async function (name) { - var req = { - method: "GET", - url: "/portal/jarray-data/" + name, - }; - return await _getAnonymousApiResult(req); - }; - var _loadJsonData = async function (name) { - var req = { - method: "GET", - url: "/portal/json-data/" + name, - }; - return await _getAnonymousApiResult(req); - }; - var _showAlertMsg = function (title, message) { - $rootScope.message = { - title: title, - value: message, - }; - $("#modal-msg").modal("show"); - }; - - var _checkfile = function (sender, validExts) { - var fileExt = sender.value; - fileExt = fileExt.substring(fileExt.lastIndexOf(".")); - if (validExts.indexOf(fileExt) < 0) { - _showAlertMsg( - "", - "Invalid file selected, valid files are of " + - validExts.toString() + - " types." - ); - sender.value = ""; - return false; - } else return true; - }; - - var _sendMail = async function (subject, body) { - var url = "/portal/sendmail"; - var req = { - method: "POST", - url: url, - data: { subject: subject, body: body }, - }; - return _getApiResult(req).then(function (response) { - return response.data; - }); - }; - - var _getSettings = async function (culture) { - var settings = localStorageService.get("settings"); - // && culture !== undefined && settings.lang === culture - if (settings) { - return settings; - } else { - var url = "/portal"; - if (culture) { - url += "/" + culture; - } - url += "/settings"; - var req = { - method: "GET", - url: url, - }; - return _getApiResult(req).then(function (response) { - return response.data; - }); - } - }; - var _getAllSettings = async function (culture) { - var settings = localStorageService.get("settings"); - var globalSettings = localStorageService.get("globalSettings"); - var translator = localStorageService.get("translator"); - if ( - settings && - globalSettings && - translator && - settings.lang === culture - ) { - $rootScope.settings = settings; - $rootScope.globalSettings = globalSettings; - $rootScope.translator.translator = translator; - } else { - var url = "/portal"; - if (culture) { - url += "/" + culture; - } - url += "/all-settings"; - var req = { - method: "GET", - url: url, - }; - return _getApiResult(req).then(function (response) { - localStorageService.set("settings", response.data.settings); - localStorageService.set( - "globalSettings", - response.data.globalSettings - ); - localStorageService.set("translator", response.data.translator); - $rootScope.settings = response.data.settings; - $rootScope.globalSettings = response.data.globalSettings; - $rootScope.translator.translator = response.data.translator; - }); - } - }; - - var _checkConfig = async function (lastSync) { - if (lastSync) { - var url = "/portal/check-config/" + lastSync; - var req = { - method: "GET", - url: url, - }; - return _getApiResult(req).then(function (response) { - if (response.data) { - _removeSettings().then(() => { - _removeTranslator().then(() => { - localStorageService.set("settings", response.data.settings); - localStorageService.set( - "globalSettings", - response.data.globalSettings - ); - localStorageService.set("translator", response.data.translator); - $rootScope.settings = response.data.settings; - $rootScope.globalSettings = response.data.globalSettings; - $rootScope.translator.translator = response.data.translator; - }); - }); - } else { - $rootScope.settings = localStorageService.get("settings"); - $rootScope.globalSettings = localStorageService.get( - "globalSettings" - ); - $rootScope.translator.translator = localStorageService.get( - "translator" - ); - } - }); - } - }; - - var _genrateSitemap = async function () { - var url = "/portal"; - url += "/sitemap"; - var req = { - method: "GET", - url: url, - }; - return _getApiResult(req).then(function (response) { - return response.data; - }); - }; - - var _setSettings = async function (settings) { - if (settings && settings.cultures.length > 0) { - localStorageService.set("settings", settings); - } - }; - - var _initAllSettings = async function (culture) { - localStorageService.remove("settings"); - localStorageService.remove("translator"); - localStorageService.remove("globalSettings"); - - var response = await _getSettings(culture); - localStorageService.set("settings", response.settings); - localStorageService.set("translator", response.translator); - localStorageService.set("globalSettings", response.globalSettings); - - return response; - }; - - var _removeSettings = async function (settings) { - localStorageService.remove("settings"); - }; - - var _removeTranslator = async function () { - localStorageService.remove("translator"); - }; - - var _fillSettings = async function (culture) { - var settings = localStorageService.get("settings"); - if (settings && settings.lang === culture) { - _settings = settings; - return settings; - } else { - if (culture && settings && settings.lang !== culture) { - await _removeSettings(); - await _removeTranslator(); - } - settings = await _getSettings(culture); - localStorageService.set("settings", settings); - //window.top.location = location.href; - return settings; - } - }; - var _fillAllSettings = async function (culture) { - var settings = localStorageService.get("settings"); - var globalSettings = localStorageService.get("globalSettings"); - var translator = localStorageService.get("translator"); - if ( - settings && - globalSettings && - translator && - (!culture || settings.lang === culture) - ) { - $rootScope.settings = settings; - $rootScope.globalSettings = globalSettings; - $rootScope.translator.translator = translator; - await _checkConfig(globalSettings.lastUpdateConfiguration); - } else { - if (culture && settings && settings.lang !== culture) { - await _removeSettings(); - await _removeTranslator(); - } - await _getAllSettings(culture); - } - }; - var _getApiResult = async function (req, serviceBase) { - await authService.fillAuthData(); - if (authService.authentication) { - req.Authorization = authService.authentication.token; - } - - var serviceUrl = - appSettings.serviceBase + "/api/" + appSettings.apiVersion; - if (serviceBase || req.serviceBase) { - serviceUrl = - (serviceBase || req.serviceBase) + "/api/" + appSettings.apiVersion; - } - - req.url = serviceUrl + req.url; - if (!req.headers) { - req.headers = { - "Content-Type": "application/json", - }; - } - req.headers.Authorization = "Bearer " + req.Authorization || ""; - return $http(req).then( - function (resp) { - if ( - req.url.indexOf("settings") == -1 && - (!$rootScope.settings || - $rootScope.settings.lastUpdateConfiguration < - resp.data.lastUpdateConfiguration) - ) { - _initAllSettings(); - } - - return resp.data; - }, - function (error) { - if (error.status === 401) { - //Try again with new token from previous Request (optional) - return authService - .refreshToken(authService.authentication.refresh_token) - .then( - function () { - req.headers.Authorization = - "Bearer " + authService.authentication.token; - return $http(req).then( - function (results) { - return results.data; - }, - function (err) { - authService.logOut(); - authService.authentication.token = null; - authService.authentication.refresh_token = null; - authService.referredUrl = $location.$$url; - $rootScope.showLogin(req); - // window.top.location.href = '/security/login'; - } - ); - }, - function (err) { - var t = { isSucceed: false }; - - authService.logOut(); - authService.authentication.token = null; - authService.authentication.refresh_token = null; - authService.referredUrl = $location.$$url; - window.top.location.href = "/security/login"; - return t; - } - ); - } else if (error.status === 403) { - var t = { isSucceed: false, errors: ["Forbidden"] }; - $rootScope.showLogin(req, "rest"); - // window.top.location.href = '/security/login'; - return t; - } else { - if (error.data) { - return error.data; - } else { - return { - isSucceed: false, - errors: [error.statusText || error.status], - }; - } - } - } - ); - }; - - var _getRestApiResult = async function (req, serviceBase) { - if (!authService.authentication) { - await authService.fillAuthData(); - } - if (authService.authentication) { - req.Authorization = authService.authentication.token; - } - - var serviceUrl = - appSettings.serviceBase + "/api/" + appSettings.apiVersion; - if (serviceBase || req.serviceBase) { - serviceUrl = - (serviceBase || req.serviceBase) + "/api/" + appSettings.apiVersion; - } - - req.url = serviceUrl + req.url; - if (!req.headers) { - req.headers = { - "Content-Type": "application/json", - }; - } - req.headers.Authorization = "Bearer " + req.Authorization || ""; - return $http(req).then( - function (resp) { - if ( - req.url.indexOf("settings") == -1 && - (!$rootScope.settings || - $rootScope.settings.lastUpdateConfiguration < - resp.data.lastUpdateConfiguration) - ) { - _initAllSettings(); - } - - return { isSucceed: true, data: resp.data }; - }, - function (error) { - if (error.status === 401) { - //Try again with new token from previous Request (optional) - return authService - .refreshToken(authService.authentication.refresh_token) - .then( - function () { - req.headers.Authorization = - "Bearer " + authService.authentication.token; - return $http(req).then( - function (results) { - return { isSucceed: true, data: results.data }; - }, - function (err) { - authService.logOut(); - authService.authentication.token = null; - authService.authentication.refresh_token = null; - authService.referredUrl = $location.$$url; - $rootScope.showLogin(req, "rest"); - // window.top.location.href = '/security/login'; - } - ); - }, - function (err) { - var t = { isSucceed: false }; - - authService.logOut(); - authService.authentication.token = null; - authService.authentication.refresh_token = null; - authService.referredUrl = $location.$$url; - $rootScope.showLogin(req, "rest"); - // window.top.location.href = '/security/login'; - return t; - } - ); - } else if ( - error.status === 200 || - error.status === 204 || - error.status === 205 - ) { - return { - isSucceed: true, - status: err.status, - errors: [error.statusText || error.status], - }; - } else { - if (error.data) { - return { isSucceed: false, errors: [error.data] }; - } else { - return { - isSucceed: false, - errors: [error.statusText || error.status], - }; - } - } - } - ); - }; - - var _getAnonymousApiResult = async function (req) { - $rootScope.isBusy = true; - var serviceUrl = - appSettings.serviceBase + "/api/" + appSettings.apiVersion; - req.url = serviceUrl + req.url; - req.headers = { - "Content-Type": "application/json", - }; - return $http(req).then( - function (resp) { - return resp.data; - }, - function (error) { - return { - isSucceed: false, - errors: [error.statusText || error.status], - }; - } - ); - }; - adminCommonFactory.sendMail = _sendMail; - adminCommonFactory.getApiResult = _getApiResult; - adminCommonFactory.getRestApiResult = _getRestApiResult; - adminCommonFactory.getAnonymousApiResult = _getAnonymousApiResult; - adminCommonFactory.getSettings = _getSettings; - adminCommonFactory.setSettings = _setSettings; - adminCommonFactory.initAllSettings = _initAllSettings; - adminCommonFactory.fillAllSettings = _fillAllSettings; - adminCommonFactory.removeSettings = _removeSettings; - adminCommonFactory.removeTranslator = _removeTranslator; - adminCommonFactory.showAlertMsg = _showAlertMsg; - adminCommonFactory.checkfile = _checkfile; - adminCommonFactory.fillSettings = _fillSettings; - adminCommonFactory.settings = _settings; - adminCommonFactory.genrateSitemap = _genrateSitemap; - adminCommonFactory.loadJArrayData = _loadJArrayData; - adminCommonFactory.loadJsonData = _loadJsonData; - return adminCommonFactory; - }, -]); - -'use strict'; -app.factory('FileService', ['BaseService', - function (baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('file', true); - return serviceFactory; - - }]); - -'use strict'; -app.factory('GlobalSettingsService', ['$rootScope', 'CommonService', 'localStorageService', 'AppSettings', - function ($rootScope, commonService, localStorageService, appSettings) { - var factory = {}; - var _globalSettings = { - lang: '', - data: null - }; - var _fillGlobalSettings = async function (culture) { - this.globalSettings = localStorageService.get('globalSettings'); - if (this.globalSettings && this.globalSettings.data && this.globalSettings.lang === culture) { - - //_globalSettings = globalSettings; - //this.globalSettings = globalSettings; - - return this.globalSettings; - } - else { - - this.globalSettings = await _getglobalSettings(culture); - return this.globalSettings; - } - - }; - var _getglobalSettings = async function (culture) { - var globalSettings = localStorageService.get('globalSettings'); - if (globalSettings && (!culture || globalSettings.lang === culture)) { - globalSettings = globalSettings; - return globalSettings; - } - else { - globalSettings = { lang: culture, data: null }; - var url = '/portal'; - if (culture) { - url += '/' + culture; - } - url += '/global-settings'; - var req = { - method: 'GET', - url: url - }; - var getData = await commonService.getApiResult(req); - if (getData.isSucceed) { - globalSettings = getData.data; - localStorageService.set('globalSettings', globalSettings); - } - return globalSettings; - } - }; - var _reset = async function (lang) { - localStorageService.remove('globalSettings'); - await _getglobalSettings(lang); - }; - var _get = function (keyword, isWrap, defaultText) { - if ($rootScope.waitForInit()) { - if (!this.globalSettings && $rootScope.globalSettings) { - $rootScope.isBusy = true; - this.fillGlobalSettings($rootScope.globalSettings.lang).then(function (response) { - $rootScope.isBusy = false; - return response[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - }); - } else { - return this.globalSettings[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } - } - - }; - - var _getAsync = async function (keyword, defaultText) { - if (!this.globalSettings && $rootScope.globalSettings) { - $rootScope.isBusy = true; - this.globalSettings = await _fillGlobalSettings(lang); - return this.globalSettings[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } else { - return this.globalSettings[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } - - }; - - var getLinkCreateLanguage = function (keyword, isWrap) { - //return '[' + keyword + ']'; - return isWrap ? '[' + keyword + ']' : keyword; - }; - - factory.getAsync = _getAsync; - factory.get = _get; - factory.reset = _reset; - factory.globalSettings = _globalSettings; - factory.fillGlobalSettings = _fillGlobalSettings; - return factory; - }]); - -'use strict'; -app.factory('TranslatorService', ['$rootScope', 'CommonService', 'localStorageService', function ($rootScope, commonService, localStorageService) { - var factory = {}; - var _translator = { - lang: '', - data: null - }; - var _init = function (translator) { - this._translator = translator; - }; - - var _fillTranslator = async function (culture) { - this.translator = localStorageService.get('translator'); - if (this.translator && this.translator.data && this.translator.lang === culture) { - return this.translator; - } - else { - - this.translator = await _getTranslator(culture); - return this.translator; - } - - }; - var _getTranslator = async function (culture) { - var translator = localStorageService.get('translator'); - if (translator && translator.lang === culture) { - translator = translator; - return translator; - } - else { - translator = { lang: culture, data: null }; - var url = '/portal'; - if (culture) { - url += '/' + culture; - } - url += '/translator'; - var req = { - method: 'GET', - url: url - }; - translator.lang = culture; - var getData = await commonService.getApiResult(req); - if (getData.isSucceed) { - translator.data = getData.data; - localStorageService.set('translator', translator); - } - return translator; - } - }; - var _reset = async function (lang) { - localStorageService.remove('translator'); - await _getTranslator(lang); - }; - var _get = function (keyword, isWrap, defaultText) { - if (!this.translator.data && $rootScope.globalSettings) { - $rootScope.isBusy = true; - this.fillTranslator($rootScope.globalSettings.lang).then(function (response) { - $rootScope.isBusy = false; - return response.data[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - }); - } else { - return this.translator.data[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } - - }; - - var _getAsync = async function (keyword, defaultText) { - if (!this.translator.data && $rootScope.globalSettings) { - $rootScope.isBusy = true; - this.translator = await _fillTranslator(lang); - return this.translator.data[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } else { - return this.translator.data[keyword] || defaultText || getLinkCreateLanguage(keyword, isWrap); - } - - }; - - var getLinkCreateLanguage = function (keyword, isWrap) { - //return '[' + keyword + ']'; - return isWrap ? '[' + keyword + ']' : keyword; - }; - var _translateUrl = async function (culture) { - var viewType = document.getElementById('view-type').value; - var viewId = document.getElementById('view-id').value; - var url = '/portal/translate-url/' + culture + '/' + viewType + '/' + viewId; - var req = { - method: 'GET', - url: url - }; - var getData = await commonService.getApiResult(req); - return getData.data; - } - factory.getAsync = _getAsync; - factory.get = _get; - factory.init = _init; - factory.reset = _reset; - factory.translator = _translator; - factory.fillTranslator = _fillTranslator; - factory.translateUrl = _translateUrl; - return factory; -}]); - -modules.component("apiFile", { - templateUrl: "/mix-app/views/app-shared/components/api-file/api-file.html", - controller: [ - "$rootScope", - "$scope", - "Upload", - function PortalTemplateController($rootScope, $scope, uploader) { - var ctrl = this; - ctrl.accept = ctrl.accept || "application/zip"; - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.postedFile = file; - } - }; - - ctrl.uploadFile = function (file) { - // Create FormData object - var files = new FormData(); - var folder = ctrl.folder; - var title = ctrl.title; - var description = ctrl.description; - // Looping over all files and add it to FormData object - files.append(file.name, file); - - // Adding one more key to FormData object - files.append("fileFolder", folder); - files.append("title", title); - files.append("description", description); - $.ajax({ - url: "/" + $rootScope.settings.lang + "/media/upload", //'/tts/UploadImage', - type: "POST", - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: files, - success: function (result) { - ctrl.src = result.data.fullPath; - $scope.$apply(); - }, - error: function (err) { - return ""; - }, - }); - }; - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - var index = reader.result.indexOf(",") + 1; - var base64 = reader.result.substring(index); - ctrl.postedFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.postedFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.postedFile.fileStream = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { }; - } else { - return null; - } - }; - }, - ], - bindings: { - header: "=", - accept: "=", - title: "=", - postedFile: "=", - formName: "=", - isBase64: "=", - }, -}); - -modules.component("azureStorage", { - templateUrl: "/mix-app/views/app-shared/components/azure-storage/view.html", - bindings: { - data: "=", - width: "=", - }, - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.blobSasUrl = ""; - ctrl.blobServiceClient = new BlobServiceClient(blobSasUrl); - ctrl.containerName = "container" + new Date().getTime(); - ctrl.containerClient = blobServiceClient.getContainerClient( - containerName - ); - - const fileInput = document.getElementById("azure-file-input"); - const status = document.getElementById("status"); - const fileList = document.getElementById("file-list"); - - const reportStatus = (message) => { - status.innerHTML += `${message}
`; - status.scrollTop = status.scrollHeight; - }; - - ctrl.$onInit = function () { }; - - ctrl.createContainer = async () => { - try { - reportStatus(`Creating container "${containerName}"...`); - await containerClient.create(); - reportStatus(`Done.`); - } catch (error) { - reportStatus(error.message); - } - }; - - ctrl.deleteContainer = async () => { - try { - reportStatus(`Deleting container "${containerName}"...`); - await containerClient.delete(); - reportStatus(`Done.`); - } catch (error) { - reportStatus(error.message); - } - }; - - ctrl.listFiles = async () => { - fileList.size = 0; - fileList.innerHTML = ""; - try { - reportStatus("Retrieving file list..."); - let iter = containerClient.listBlobsFlat(); - let blobItem = await iter.next(); - while (!blobItem.done) { - fileList.size += 1; - fileList.innerHTML += ``; - blobItem = await iter.next(); - } - if (fileList.size > 0) { - reportStatus("Done."); - } else { - reportStatus("The container does not contain any files."); - } - } catch (error) { - reportStatus(error.message); - } - }; - - ctrl.uploadFiles = async () => { - try { - reportStatus("Uploading files..."); - const promises = []; - for (const file of fileInput.files) { - const blockBlobClient = containerClient.getBlockBlobClient( - file.name - ); - promises.push(blockBlobClient.uploadBrowserData(file)); - } - await Promise.all(promises); - reportStatus("Done."); - listFiles(); - } catch (error) { - reportStatus(error.message); - } - }; - - ctrl.deleteFiles = async () => { - try { - if (fileList.selectedOptions.length > 0) { - reportStatus("Deleting files..."); - for (const option of fileList.selectedOptions) { - await containerClient.deleteBlob(option.text); - } - reportStatus("Done."); - listFiles(); - } else { - reportStatus("No files selected."); - } - } catch (error) { - reportStatus(error.message); - } - }; - }, - ], -}); - - -modules.component('breadcrumbs', { - templateUrl: '/mix-app/views/app-shared/components/breadcrumbs/breadcrumbs.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - }], - bindings: { - breadCrumbs: '=' - } -}); - -modules.component('checkboxSwitch', { - templateUrl: '/mix-app/views/app-shared/components/checkbox-switch/view.html', - controller: ['$rootScope', '$location', function ($rootScope, $location) { - var ctrl = this; - ctrl.guid = $rootScope.generateUUID(); - ctrl.$onInit = function () { - }; - ctrl.limString = function (str, max) { - if (str) { - return (str.length > max) ? str.substring(0, max) + ' ...' : str; - } - }; - }], - - bindings: { - data: '=', - detailsUrl: '=', - callback: '&', - description: '=' - } -}); - -modules.component('cultures', { - templateUrl: '/mix-app/views/app-shared/components/cultures/cultures.html', - bindings: { - isClone: '=', - data: '=' - } -}); -//modules.controller('ImageController', ); -modules.component("customFile", { - templateUrl: "/mix-app/views/app-shared/components/custom-file/custom-file.html", - bindings: { - header: "=", - title: "=", - description: "=", - src: "=", - srcUrl: "=", - data: "=", - type: "=", - folder: "=", - auto: "=", - onDelete: "&", - save: "&", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "MediaService", - function PortalTemplateController($rootScope, $scope, mediaService) { - var ctrl = this; - ctrl.media = null; - ctrl.init = function () { - ctrl.id = Math.random(); - }; - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.getBase64(file); - } - }; - - ctrl.uploadFile = async function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = async function () { - var getMedia = await mediaService.getSingle(["portal"]); - if (getMedia.isSucceed) { - var index = reader.result.indexOf(",") + 1; - var base64 = reader.result.substring(index); - ctrl.data.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.data.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.data.mediaFile.fileStream = reader.result; - var media = getMedia.data; - media.data.mediaFile = ctrl.data.mediaFile; - var resp = await mediaService.save(media); - if (resp && resp.isSucceed) { - ctrl.src = resp.data.fullPath; - ctrl.srcUrl = resp.data.fullPath; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - reader.onerror = function (error) { }; - } else { - return null; - } - }; - ctrl.getBase64 = function (file) { - if (file !== null && ctrl.data.mediaFile) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - var index = reader.result.indexOf(",") + 1; - var base64 = reader.result.substring(index); - ctrl.data.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.data.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.data.mediaFile.fileStream = reader.result; - ctrl.srcUrl = reader.result; - $rootScope.isBusy = false; - - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - }, - ], -}); - -modules.component('swDataPreview', { - templateUrl: '/mix-app/views/app-shared/components/data-preview/data-preview.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - } - ], - bindings: { - type: '=', - value: '=', - } -}); -'use trick' -modules.directive('pane', function () { - return { - require: '^tabs', - restrict: 'E', - transclude: true, - scope: { title: '@' }, - link: function (scope, element, attrs, tabsController) { - tabsController.addPane(scope); - }, - template: - '
' + - '
', - replace: true - }; -}) -modules.directive('tabs', function () { - return { - restrict: 'E', - transclude: true, - scope: {}, - controller: function ($scope, $element) { - var panes = $scope.panes = []; - - $scope.select = function (pane) { - angular.forEach(panes, function (pane) { - pane.selected = false; - }); - pane.selected = true; - } - - this.addPane = function (pane) { - if (panes.length === 0) $scope.select(pane); - panes.push(pane); - } - }, - templateUrl: '/mix-app/views/app-shared/components/templates/tabs.html', - replace: true - }; -}); - -modules.component('goToTop', { - templateUrl: '/mix-app/views/app-shared/components/go-to-top/view.html', - controller: ['$rootScope', '$scope', - function ($rootScope, $scope) { - var ctrl = this; - ctrl.$onInit = function () { - $(window).scroll(function () { - if ($(window).scrollTop() >= 50) { // If page is scrolled more than 50px - $('#return-to-top').fadeIn(200); // Fade in the arrow - } else { - $('#return-to-top').fadeOut(200); // Else fade out the arrow - } - }); - }; - ctrl.goToTop = function () { - // ===== Scroll to Top ==== - $('body,html').animate({ - scrollTop: 0 // Scroll to top of body - }, 500); - }; - }], - bindings: { - } -}); -(function (angular) { - app.component('languageSwitcher', { - templateUrl: '/mix-app/views/app-shared/components/language-switcher/language-switcher.html', - controller: ['$rootScope', '$scope', '$location', - 'CommonService', 'TranslatorService', 'GlobalSettingsService', - function ($rootScope, $scope, $location, - commonService, translatorService, globalSettingsService) { - var ctrl = this; - ctrl.settings = {}; - this.$onInit = function () { - ctrl.settings = $rootScope.settings; - if ($rootScope.globalSettings) { - ctrl.settings.cultures = $rootScope.globalSettings.cultures; - } - }; - - ctrl.changeLang = async function (lang, langIcon) { - ctrl.settings.lang = lang; - ctrl.settings.langIcon = langIcon; - // await commonService.removeSettings(); - // await commonService.removeTranslator(); - // commonService.fillSettings(lang).then(function () { - // translatorService.reset(lang).then(function () { - commonService.fillAllSettings(lang).then(function (response) { - translatorService.translateUrl(lang).then(function (url) { - window.top.location = url; - }); - }); - // }); - // }); - }; - ctrl.logOut = function () { - $rootScope.logOut(); - }; - }], - bindings: { - //settings: '=', - ulStyle: '=', - liStyle: '=', - aStyle: '=', - activeClass: '=' - } - }); -})(window.angular); - -modules.component('limitString', { - templateUrl: '/mix-app/views/app-shared/components/limit-string/limit-string.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', - function ($rootScope, $scope, ngAppSettings) { - var ctrl = this; - ctrl.shortenString = ''; - ctrl.previousContentId = undefined; - - this.$onInit = () => { ctrl.previousContentId = angular.copy(ctrl.contentId) }; - - this.$doCheck = () => { - if (ctrl.contentId !== ctrl.previousContentId) { - ctrl.loadModuleData(); - ctrl.previousContentId = ctrl.contentId; - } - }; - ctrl.shortString = function () { - var data = decodeURIComponent(ctrl.content); - if (data) { - if (ctrl.max < data.length) { - ctrl.shortenString = data.replace(/[+]/g, ' ').substr(0, ctrl.max) + ' ...'; - } - else { - ctrl.shortenString = data.replace(/[+]/g, ' '); - } - } - }; - ctrl.view = function () { - var obj = { - moduleId: ctrl.moduleId, - id: ctrl.contentId - }; - $rootScope.preview('module-data', obj, null, 'modal-lg'); - } - ctrl.translate = $rootScope.translate; - }], - bindings: { - content: '=', - showData: '=', - max: '=', - moduleId: '=', - contentId: '=' - } -}); -app.component("loginPopup", { - templateUrl: "/mix-app/views/app-shared/components/login-popup/view.html", - controller: "LoginPopupController", -}); - -app.controller("LoginPopupController", [ - "$scope", - "$rootScope", - "AuthService", - "CommonService", - function LoginPopupController( - $scope, - $rootScope, - authService, - commonService - ) { - $scope.loginData = { - userName: "", - password: "", - rememberMe: false, - }; - $scope.login = async function () { - var result = await authService.loginPopup($scope.loginData); - if (result && result.isSucceed) { - $rootScope.isBusy = false; - $scope.message = result.errors[0]; - $("#login-popup").modal("hide"); - $scope.$apply(); - - if ($rootScope.loginCallbackRequest) { - if ($rootScope.loginCallbackType == "rest") { - commonService.getRestApiResult($rootScope.loginCallbackRequest); - } else { - commonService.getRestResult($rootScope.loginCallbackRequest); - } - $rootScope.loginCallbackRequest = null; - $rootScope.loginCallbackType = null; - } - } - else { - $rootScope.goToSiteUrl('/security/login'); - } - }; - $scope.closeDialog = function () { - $("#login-popup").modal("hide"); - }; - }, -]); - -app.component("mediaNavs", { - templateUrl: "/mix-app/views/app-shared/components/media-navs/media-navs.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "MediaService", - function ($rootScope, $scope, ngAppSettings, mediaService) { - var ctrl = this; - mediaService.init("media"); - ctrl.request = { - pageSize: "10", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - }; - ctrl.medias = []; - ctrl.activeMedia = function (media) { - var currentItem = null; - if (ctrl.data === null || ctrl.isSingle) { - ctrl.data = []; - } - $.each(ctrl.data, function (i, e) { - if (e.mediaId === media.id) { - e.isActived = media.isActived; - currentItem = e; - return false; - } - }); - if (currentItem === null) { - currentItem = { - description: - media.description !== "undefined" ? media.description : "", - image: media.filePath, - mediaId: media.id, - product: ctrl.id, - specificulture: media.specificulture, - position: 0, - priority: ctrl.data.length + 1, - isActived: true, - }; - ctrl.data.push(currentItem); - } - if (ctrl.isSingle) { - if (!media.isActived) { - ctrl.output = ""; - ctrl.data = []; - } else { - ctrl.output = ctrl.data[0].image; - //ctrl.loadMedias(ctrl.request.pageIndex); - } - } - }; - ctrl.loadMedias = async function (pageIndex) { - if (!ctrl.prefix) { - ctrl.prefix = "media_navs"; - } - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - ctrl.request.toDate = ctrl.request.toDate.toISOString(); - } - if ($rootScope.globalSettings) { - ctrl.isBusy = true; - var resp = await mediaService.getList(ctrl.request); - if (resp && resp.isSucceed) { - ctrl.medias = resp.data; - if (ctrl.data) { - angular.forEach(ctrl.medias.items, function (value, key) { - var temp = ctrl.data.filter(function (item) { - return item.mediaId === value.id; - })[0]; - value.isActived = temp !== undefined; - }); - } - ctrl.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - ctrl.isBusy = false; - $scope.$apply(); - } - } - }; - }, - ], - bindings: { - data: "=", - prefix: "=", - sourceFieldName: "=", - isSingle: "=", - output: "=", - loadMedia: "&", - onDelete: "&", - onUpdate: "&", - }, -}); - -'use strict'; -app.controller('MediaController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', 'MediaService', 'CommonService', - function ($scope, $rootScope, ngAppSettings, $routeParams, service, commonService) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - - $scope.viewModel = { - title: '', - description: '', - status: 'Published', - mediaFile: { - file: null, - fullPath: '', - folderName: 'Media', - fileFolder: '', - fileName: '', - extension: '', - content: '', - fileStream: '' - } - }; - // multipart form - $scope.formFile = null; - $scope.relatedMedias = []; - $scope.save = async function () { - var data = $scope.viewModel; - $rootScope.isBusy = true; - if ($scope.validate) { - $scope.isValid = await $rootScope.executeFunctionByName('validate', $scope.validateArgs, $scope) - } - if ($scope.isValid) { - var resp = await service.save(data, $scope.formFile); - if (resp && resp.isSucceed) { - $scope.viewModel = resp.data; - $rootScope.showMessage('success', 'success'); - - if ($scope.saveSuccessCallback) { - $rootScope.executeFunctionByName('saveSuccessCallback', $scope.saveSuccessCallbackArgs, $scope); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if ($scope.saveFailCallback) { - $rootScope.executeFunctionByName('saveFailCallback', $scope.saveSuccessCallbackArgs, $scope) - } - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - else { - $rootScope.showErrors(['invalid model']); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.uploadMedia = async function () { - $rootScope.isBusy = true; - var resp = await service.uploadMedia($scope.mediaFile); - if (resp && resp.isSucceed) { - //$scope.activedMedia = resp.data; - $scope.getList(); - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.selectFile = function (file, errFiles) { - if (file !== undefined && file !== null) { - $scope.mediaFile.folder = 'Media'; - $scope.mediaFile.file = file; - $scope.getBase64(file); - } - }; - $scope.getBase64 = function (file) { - if (file !== null && $scope.postedFile) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - var index = reader.result.indexOf(',') + 1; - var base64 = reader.result.substring(index); - $scope.activedMedia.mediaFile.fileName = $rootScope.generateKeyword(file.name.substring(0, file.name.lastIndexOf('.')), '-'); - $scope.activedMedia.mediaFile.extension = file.name.substring(file.name.lastIndexOf('.')); - $scope.activedMedia.mediaFile.fileStream = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.showErrors([error]); - $rootScope.isBusy = false; - }; - } - else { - return null; - } - }; - $scope.togglePreview = function (item) { - item.isPreview = item.isPreview === undefined ? true : !item.isPreview; - }; - $scope.clone = async function (id) { - $rootScope.isBusy = true; - var resp = await service.cloneMedia(id); - if (resp && resp.isSucceed) { - $scope.activedMedia = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/portal/media/details/' + resp.data.id); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveSuccessCallback = function () { - $scope.viewModel = { - title: '', - description: '', - status: 'Published', - mediaFile: { - file: null, - fullPath: '', - folderName: 'Media', - fileFolder: '', - fileName: '', - extension: '', - content: '', - fileStream: '' - } - }; - $scope.getList(); - } - $scope.removeCallback = function () { - $scope.getList(); - } - }]); - -'use strict'; -app.factory('MediaService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('media'); - var _cloneMedia = async function (id) { - var req = { - method: 'GET', - url: serviceFactory.prefixUrl + '/clone/' + id - }; - return await commonService.getApiResult(req); - }; - var _save = async function (objData, file) { - var url = this.prefixUrl + '/save'; - var fd = new FormData(); - var file = objData.mediaFile.file; - objData.mediaFile.file = null; - fd.append('model', angular.toJson(objData)); - fd.append('file', file); - return await serviceFactory.ajaxSubmitForm(fd, url); - } - var _uploadMedia = async function (mediaFile, file) { - //var container = $(this).parents('.model-media').first().find('.custom-file').first(); - if (mediaFile.file !== undefined && mediaFile.file !== null) { - // Create FormData object - var url = this.prefixUrl + '/upload-media'; - var fd = new FormData(); - - fd.append('file', file); - return await serviceFactory.ajaxSubmitForm(fd, url); - } - }; - serviceFactory.cloneMedia = _cloneMedia; - serviceFactory.uploadMedia = _uploadMedia; - serviceFactory.save = _save; - return serviceFactory; - - }]); - - -modules.component('medias', { - templateUrl: '/mix-app/views/app-shared/components/medias/medias.html', - controller: 'MediaController', - bindings: { - - } -}); -modules.component('message', { - templateUrl: '/mix-app/views/app-shared/components/message/message.html', - bindings: { - message: '=' - } -}); -'use strict'; -app.controller('MessengerController', ['$scope', function ($scope) { - BaseHub.call(this, $scope); - $scope.user = { - loggedIn: false, - info: {} - }; - $scope.isHide = true; - $scope.hideContact = true; - $scope.members = []; - $scope.messages = []; - $scope.message = { connection: {}, content: '' }; - $scope.request = { - uid: '', - objectType: null, - action: '', - data: {}, - room: '', - isMyself: false - }; - $scope.loadMsgButton = function () { - - } - $scope.init = function () { - $scope.startConnection('MixChatHub', $scope.checkLoginStatus); - - $("button").on("click", function () { - var text = $("#message").val(); - var hnow = new Date().getHours(); - var mnow = new Date().getMinutes(); - mnow = mnow < 10 ? "0" + mnow : mnow; - var d = hnow + ":" + mnow; - - if (text.length > 0) { - $("#message").css("border", "1px solid #f4f5f9"); - $("#conversation").append( - "
  • You
    " + - text + - "
    " + - d + - "
  • " - ); - $("#message").val(""); - $(".widget-conversation").scrollTop( - $("ul li") - .last() - .position().top + - $("ul li") - .last() - .height() - ); - } else { - $("#message").css("border", "1px solid #eb9f9f"); - $("#message").animate({ opacity: "0.1" }, "slow"); - $("#message").animate({ opacity: "1" }, "slow"); - $("#message").animate({ opacity: "0.1" }, "slow"); - $("#message").animate({ opacity: "1" }, "slow"); - } - }); - - - - // var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var HoverButton = function () { - // function HoverButton(el) {_classCallCheck(this, HoverButton); - // this.el = el; - // this.hover = false; - // this.calculatePosition(); - // this.attachEventsListener(); - // }_createClass(HoverButton, [{ key: 'attachEventsListener', value: function attachEventsListener() - - // {var _this = this; - // window.addEventListener('mousemove', function (e) {return _this.onMouseMove(e);}); - // window.addEventListener('resize', function (e) {return _this.calculatePosition(e);}); - // } }, { key: 'calculatePosition', value: function calculatePosition() - - // { - - - // var box = this.el.getBoundingClientRect(); - // this.x = box.left + box.width * 0.5; - // this.y = box.top + box.height * 0.5; - // this.width = box.width; - // this.height = box.height; - // } }, { key: 'onMouseMove', value: function onMouseMove( - - // e) { - // var hover = false; - // var hoverArea = this.hover ? 0.7 : 0.5; - // var x = e.clientX - this.x; - // var y = e.clientY - this.y; - // var distance = Math.sqrt(x * x + y * y); - // if (distance < this.width * hoverArea) { - // hover = true; - // if (!this.hover) { - // this.hover = true; - // } - // this.onHover(e.clientX, e.clientY); - // } - - // if (!hover && this.hover) { - // this.onLeave(); - // this.hover = false; - // } - // } }, { key: 'onHover', value: function onHover( - - // x, y) { - // TweenMax.to(this.el, 0.4, { - // x: (x - this.x) * 0.4, - // y: (y - this.y) * 0.4, - // scale: 1.15, - // ease: Power2.easeOut }); - - // this.el.style.zIndex = 10; - // } }, { key: 'onLeave', value: function onLeave() - // { - // TweenMax.to(this.el, 0.7, { - // x: 0, - // y: 0, - // scale: 1, - // ease: Elastic.easeOut.config(1.2, 0.4) }); - - // this.el.style.zIndex = 1; - // } }]);return HoverButton;}(); - - - // var btn1 = document.querySelector('#quest'); - // new HoverButton(btn1); - }; - $scope.logout = function () { - FB.logout(function (response) { - // user is now logged out - $scope.user.loggedIn = false; - }); - }; - $scope.login = function () { - FB.login(function (response) { - if (response.authResponse) { - FB.api('/me', function (response) { - - $scope.user.info.name = response.name; - $scope.user.info.id = response.id; - $scope.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - $scope.join(); - $scope.$apply(); - }); - } else { - console.log('User cancelled login or did not fully authorize.'); - } - }); - }; - $scope.join = function () { - $scope.request.uid = $scope.user.info.id; - $scope.request.data = $scope.user.info; - $scope.message.connection = $scope.user.info; - $scope.connection.invoke('join', $scope.request); - - }; - $scope.toggle = function () { - $scope.isHide = !$scope.isHide; - } - $scope.toggleContact = function () { - $scope.hideContact = !$scope.hideContact; - } - $scope.sendMessage = function () { - if ($scope.user.loggedIn) { - $scope.request.data = $scope.message; - $scope.connection.invoke('sendMessage', $scope.request); - $scope.message.content = ''; - } - }; - $scope.receiveMessage = function (msg) { - //$scope.responses.splice(0, 0, msg); - switch (msg.responseKey) { - case 'NewMember': - $scope.newMember(msg.data); - $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - - case 'NewMessage': - $scope.newMessage(msg.data); - break; - case 'ConnectSuccess': - $scope.user.loggedIn = true; - $scope.initList(msg.data); - $scope.$apply(); - break; - - case 'MemberOffline': - $scope.removeMember(msg.data); - break; - - } - - }; - $scope.checkLoginStatus = function () { - FB.getLoginStatus(function (response) { - if (response.status === 'connected') { - // The user is logged in and has authenticated your - // app, and response.authResponse supplies - // the user's ID, a valid access token, a signed - // request, and the time the access token - // and signed request each expire. - FB.api('/me', function (response) { - $scope.user.info.name = response.name; - $scope.user.info.id = response.id; - $scope.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - $scope.join(); - $scope.$apply(); - }); - } else if (response.status === 'authorization_expired') { - // The user has signed into your application with - // Facebook Login but must go through the login flow - // again to renew data authorization. You might remind - // the user they've used Facebook, or hide other options - // to avoid duplicate account creation, but you should - // collect a user gesture (e.g. click/touch) to launch the - // login dialog so popup blocking is not triggered. - } else if (response.status === 'not_authorized') { - // The user hasn't authorized your application. They - // must click the Login button, or you must call FB.login - // in response to a user gesture, to launch a login dialog. - } else { - // The user isn't logged in to Facebook. You can launch a - // login dialog with a user gesture, but the user may have - // to log in to Facebook before authorizing your application. - } - }); - }; - $scope.newMember = function (member) { - - var index = $scope.members.findIndex(x => x.id === member.id); - if (index < 0) { - $scope.members.splice(0, 0, member); - } - $scope.$apply(); - } - - $scope.initList = function (data) { - data.forEach(member => { - var index = $scope.members.findIndex(x => x.id === member.id); - if (index < 0) { - $scope.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - } - - $scope.removeMember = function (memberId) { - - var index = $scope.members.findIndex(x => x.id === memberId); - if (index >= 0) { - $scope.members.splice(index, 1); - } - $scope.$apply(); - } - - $scope.newMessage = function (msg) { - $scope.messages.push(msg); - $scope.$apply(); - var objDiv = document.getElementsByClassName("widget-conversation")[0]; - objDiv.scrollTop = objDiv.scrollHeight + 20; - } - - -}]); - - -modules.component('messenger', { - templateUrl: '/mix-app/views/app-shared/components/messenger/index.html', - controller: 'MessengerController', - bindings: { - message: '=' - } -}); -modules.component('messengerPrivate', { - templateUrl: '/mix-app/views/app-shared/components/messenger-private/index.html', - controller: 'MessengerController', - bindings: { - message: '=', - connectionId: '=' - } -}); -modules.component('mixDataPreview', { - templateUrl: '/mix-app/views/app-shared/components/mix-data-preview/mix-data-preview.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - } - ], - bindings: { - type: '=', - value: '=', - width: '=', - } -}); -modules.component('mixDataTable', { - templateUrl: '/mix-app/views/app-shared/components/mix-data-table/mix-data-table.html', - controller: ['$rootScope', '$scope', '$location', 'ngAppSettings', function ($rootScope, $scope, $location, ngAppSettings) { - var ctrl = this; - ctrl.colWidth = 3; - ctrl.init = function () { - if (ctrl.data.items.length) { - ctrl.min = ctrl.data.items[0].priority; - } - ctrl.colWidth = parseInt(9 / ctrl.columns.length); - ctrl.lastColWidth = (9 % ctrl.columns.length) > 0 ? 2 : 1; - }; - ctrl.translate = $rootScope.translate; - ctrl.selected = null; - ctrl.updateOrders = function (index, items) { - items.splice(index, 1); - for (var i = 0; i < items.length; i++) { - items[i].priority = ctrl.min + i; - } - ctrl.onUpdateInfos({ items: items }); - }; - - ctrl.updateChildOrders = function (index, items) { - items.splice(index, 1); - for (var i = 0; i < items.length; i++) { - items[i].priority = ctrl.min + i; - } - ctrl.onUpdateChildInfos({ items: items }); - }; - ctrl.dragoverCallback = function (index, item, external, type) { - //console.log('drop ', index, item, external, type); - } - ctrl.insertCallback = function (index, item, external, type) { - //console.log('insert ', index, item, external, type); - } - ctrl.delete = function (id) { - ctrl.onDelete({ id: id }); - }; - ctrl.goTo = function (id) { - $location.path(ctrl.editUrl + '/' + id); - } - ctrl.toggleChildNavs = function (nav) { - nav.showChildNavs = nav.childNavs.length > 0 && !nav.showChildNavs; - } - }], - bindings: { - data: '=', - childName: '=', - canDrag: '=', - editUrl: '=', - columns: '=', - onDelete: '&', - onUpdateInfos: '&', - onUpdateChildInfos: '&', - } -}); -"use strict"; -app.controller("MixDatabaseDataClientController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "RestMixDatabaseDataPortalService", - "RestRelatedMixDatabasePortalService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - navService, - commonService - ) { - BaseODataCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.defaultId = "default"; - $scope.parentId = null; - $scope.parentType = null; - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.importFile = { - file: null, - fullPath: "", - folder: "import", - title: "", - description: "", - }; - $scope.settings = $rootScope.globalSettings; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.init = async function () { - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.dataId = $routeParams.dataId; - $scope.refParentId = $routeParams.refParentId; - $scope.refParentType = $routeParams.refParentType; - if ($scope.refParentId && $scope.refParentType) { - $scope.refDataModel = { - parentId: $scope.refParentId, - parentType: $scope.refParentType, - }; - } - }; - $scope.saveSuccessCallback = function () { - if ($scope.refDataModel) { - $scope.refDataModel.id = $scope.viewModel.id; - $scope.refDataModel.mixDatabaseId = $scope.viewModel.mixDatabaseId; - $scope.refDataModel.mixDatabaseName = $scope.viewModel.mixDatabaseName; - $scope.refDataModel.specificulture = $scope.viewModel.specificulture; - $scope.refDataModel.data = $scope.viewModel; - $rootScope.isBusy = true; - navService.save("portal", $scope.refDataModel).then((resp) => { - if (resp.isSucceed) { - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } - }; - $scope.export = async function (page = 0) { - $rootScope.isBusy = true; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - if (page != undefined) { - $scope.request.pageIndex = page; - } - var type = $routeParams.type; - var parentId = $routeParams.parentId; - var resp = await service.export( - "portal", - $scope.request, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - type, - parentId - ); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - if (resp && resp.isSucceed) { - window.top.location = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.openImportDialog = function () { - $("#inp-import-data").click(); - }; - - $scope.getList = async function (page = 0) { - $rootScope.isBusy = true; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - if (page != undefined) { - $scope.request.pageIndex = page; - } - var type = $routeParams.type; - var parentId = $routeParams.parentId; - var response = await service.getList( - "read", - $scope.request, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - type, - parentId - ); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - if (response) { - $scope.data = response; - $scope.count([$routeParams.mixDatabaseName]); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors("Failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id || $scope.defaultId; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - var resp = await service.getSingle("portal", [ - id, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - ]); - if (resp) { - $scope.viewModel = resp; - $scope.viewModel.parentType = $scope.parentType; - $scope.viewModel.parentId = $scope.parentId; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.preview = function (item) { - item.editUrl = "/portal/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.edit = function (data) { - $scope.goToPath( - "/portal/mix-database-data/details?dataId=" + - data.id + - "&mixDatabaseId=" + - $scope.mixDatabaseId - ); - }; - $scope.remove = function (data) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (dataId) { - $rootScope.isBusy = true; - var result = await service.delete([dataId]); - if (result.isSucceed) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.isSucceed) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -"use strict"; -app.factory("RestMixDatabasePortalService", [ - "$rootScope", - "CommonService", - "BaseRestService", - function ($rootScope, commonService, baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database-data"); - - var _getList = async function ( - viewType, - objData, - mixDatabaseId, - mixDatabaseName, - parentType, - parentId - ) { - objData.filter = ""; - if (mixDatabaseId) { - objData.filter += "mixDatabaseId eq " + mixDatabaseId; - } - if (mixDatabaseName) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "mixDatabaseName eq '" + mixDatabaseName + "'"; - } - if (parentType) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "parentType eq " + parentType; - } - if (parentId) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "parentId eq '" + parentId + "'"; - } - var data = serviceFactory.parseODataQuery(objData); - var url = this.prefixUrl + "/" + viewType; - if (data) { - url = url.concat(data); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getApiResult(req); - }; - - var _export = async function ( - viewType, - objData, - mixDatabaseId, - mixDatabaseName, - parentType, - parentId - ) { - objData.filter = ""; - if (mixDatabaseId) { - objData.filter += "mixDatabaseId eq " + mixDatabaseId; - } - if (mixDatabaseName) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "mixDatabaseName eq '" + mixDatabaseName + "'"; - } - if (parentType) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "parentType eq " + parentType; - } - if (parentId) { - if (objData.filter) { - objData.filter += " and "; - } - objData.filter += "parentId eq '" + parentId + "'"; - } - var data = serviceFactory.parseODataQuery(objData); - var url = this.prefixUrl + "/" + viewType + "/export/" + mixDatabaseName; - if (data) { - url = url.concat(data); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getApiResult(req); - }; - - serviceFactory.getList = _getList; - serviceFactory.export = _export; - return serviceFactory; - }, -]); - -modules.component("mixDatabaseDataValuePreview", { - templateUrl: "/mix-app/views/app-shared/components/mix-database-data-value-preview/view.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.$onInit = function () { - if (ctrl.data.field && ctrl.data.field.isEncrypt) { - var encryptedData = { - key: ctrl.data.encryptKey, - data: ctrl.data.encryptValue, - }; - ctrl.data.stringValue = $rootScope.decrypt(encryptedData); - } - }; - }, - ], - bindings: { - data: "=", - width: "=", - }, -}); - -modules.component("mixDatabaseFormWeb", { - templateUrl: - "/mix-app/views/app-shared/components/mix-database-form-web/view.html", - bindings: { - attrSetId: "=", - attrSetName: "=", - attrDataId: "=?", - attrData: "=?", - parentType: "=?", // attribute set = 1 | post = 2 | page = 3 | module = 4 - parentId: "=?", - defaultId: "=", - saveData: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "RestMixDatabasePortalService", - function ($rootScope, $scope, service) { - var ctrl = this; - ctrl.isBusy = false; - ctrl.attributes = []; - ctrl.defaultData = null; - ctrl.selectedProp = null; - ctrl.settings = $rootScope.globalSettings; - ctrl.$onInit = async function () { - ctrl.defaultData = await service.getSingle("web", [ - ctrl.defaultId, - ctrl.attrSetId, - ctrl.attrSetName, - ]); - ctrl.loadData(); - }; - ctrl.loadData = async function () { - /* - If input is data id => load ctrl.attrData from service and handle it independently - Else modify input ctrl.attrData - */ - $rootScope.isBusy = true; - if (ctrl.attrDataId) { - ctrl.attrData = await service.getSingle("portal", [ - ctrl.attrDataId, - ctrl.attrSetId, - ctrl.attrSetName, - ]); - if (ctrl.attrData) { - ctrl.defaultData.mixDatabaseId = ctrl.attrData.mixDatabaseId; - ctrl.defaultData.mixDatabaseName = ctrl.attrData.mixDatabaseName; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (ctrl.attrData) { - $rootScope.showErrors("Failed"); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if (!ctrl.attrData) { - ctrl.attrData = angular.copy(ctrl.defaultData); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.reload = async function () { - ctrl.attrData = angular.copy(ctrl.defaultData); - }; - ctrl.submit = async function () { - angular.forEach(ctrl.attrData.values, function (e) { - //Encrypt field before send - if (e.field.isEncrypt) { - var encryptData = $rootScope.encrypt(e.stringValue); - e.encryptKey = encryptData.key; - e.encryptValue = encryptData.data; - e.stringValue = null; - } - }); - if (ctrl.saveData) { - ctrl.isBusy = true; - var result = await ctrl.saveData({ data: ctrl.attrData }); - if (result && result.isSucceed) { - ctrl.isBusy = false; - ctrl.attrData = result.data; - $scope.$apply(); - } else { - ctrl.isBusy = false; - // ctrl.attrData = await service.getSingle('portal', [ctrl.defaultId, ctrl.attrSetId, ctrl.attrSetName]); - $scope.$apply(); - } - } else { - ctrl.isBusy = true; - var saveResult = await service.save(ctrl.attrData); - if (saveResult.isSucceed) { - ctrl.isBusy = false; - } else { - ctrl.isBusy = false; - if (saveResult) { - $rootScope.showErrors(saveResult.errors); - } - $scope.$apply(); - } - } - }; - - ctrl.filterData = function (attributeName) { - if (ctrl.attrData) { - var attr = $rootScope.findObjectByKey( - ctrl.attrData.data, - "mixDatabaseColumnName", - attributeName - ); - if (!attr) { - attr = angular.copy( - $rootScope.findObjectByKey( - ctrl.defaultData.data, - "mixDatabaseColumnName", - attributeName - ) - ); - ctrl.attrData.data.push(attr); - } - return attr; - } - }; - }, - ], -}); - -modules.component("mixFieldEditor", { - templateUrl: - "/mix-app/views/app-shared/components/mix-field-editor/view.html", - bindings: { - model: "=", - field: "=", - isShowTitle: "=?", - inputClass: "=?", - createUrl: "=?", - updateUrl: "=?", - backUrl: "=?", - level: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "$location", - "ngAppSettings", - "$filter", - "RestRelatedAttributeDataPortalService", - function ( - $rootScope, - $scope, - $location, - ngAppSettings, - $filter, - navService - ) { - var ctrl = this; - ctrl.mediaFile = {}; - ctrl.icons = ngAppSettings.icons; - ctrl.previousValue = null; - ctrl.translate = (keyword, isWrap, defaultText) => { - return $rootScope.translate(keyword, isWrap, defaultText); - }; - ctrl.$doCheck = function () { - // Generate seo string if create new or not exist - if ( - ctrl.model && - (!ctrl.model.id || !ctrl.model.obj["seo_url"]) && - ctrl.field.name == "title" - ) { - if ( - ctrl.model.obj[ctrl.field.name] && - ctrl.previousValue !== ctrl.model.obj[ctrl.field.name] - ) { - ctrl.previousValue = ctrl.model.obj[ctrl.field.name]; - ctrl.model.obj["seo_url"] = $rootScope.generateKeyword( - ctrl.model.obj[ctrl.field.name], - "-" - ); - } - } - // check encrypt data - if ( - ctrl.model && - ctrl.field && - ctrl.field.isEncrypt && - ctrl.model.obj[ctrl.field.name] && - $rootScope.testJSON(ctrl.model.obj[ctrl.field.name]) - ) { - ctrl.model.obj[ctrl.field.name] = ctrl.parseEncryptedData( - ctrl.model.obj[ctrl.field.name] - ); - } - }.bind(ctrl); - ctrl.refData = null; - ctrl.defaultDataModel = null; - - ctrl.refDataModel = { - id: null, - data: null, - }; - - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.previousId = null; - ctrl.$onInit = function () { - if (!ctrl.createUrl && ctrl.model && ctrl.field.referenceId) { - var backUrl = encodeURIComponent($location.url()); - ctrl.createUrl = `/portal/mix-database-data/create?mixDatabaseId=${ctrl.field.referenceId}&dataId=default&parentId=${ctrl.model.id}&parentType=Set&backUrl=${backUrl}`; - } - if (!ctrl.updateUrl) { - ctrl.updateUrl = "/portal/mix-database-data/details"; - } - }; - ctrl.initData = async function () { - setTimeout(() => { - switch (ctrl.field.dataType.toLowerCase()) { - case "datetime": - case "date": - case "time": - if (ctrl.model.obj[ctrl.field.name]) { - var local = $filter("utcToLocalTime")( - ctrl.model.obj[ctrl.field.name] - ); - ctrl.model.obj[ctrl.field.name] = new Date(local); - $scope.$apply(); - } - break; - case "reference": // reference - // if(ctrl.field.referenceId && ctrl.model.id){ - // ctrl.model[ctrl.field.name] = ctrl.field.referenceId; - // navService.getSingle(['default']).then(resp=>{ - // resp.mixDatabaseId = ctrl.field.referenceId; - // resp.parentId = ctrl.parentId; - // resp.parentType = ctrl.parentType; - // ctrl.defaultDataModel = resp; - // ctrl.refDataModel = angular.copy(ctrl.defaultDataModel); - // }); - // ctrl.loadRefData(); - // } - break; - default: - if (ctrl.field && !ctrl.model[ctrl.field.name]) { - ctrl.model[ctrl.field.name] = ctrl.field.defaultValue; - $scope.$apply(); - } - break; - } - }, 200); - }; - ctrl.parseEncryptedData = function (data) { - var encryptedData = $rootScope.testJSON(data); - return $rootScope.decrypt(encryptedData); - }; - ctrl.initDefaultValue = async function () { - switch (ctrl.field.dataType) { - case "datetime": - case "date": - case "time": - if (ctrl.field.defaultValue) { - ctrl.model[ctrl.field.name] = new Date( - ctrl.mixDatabaseDataValue.field.defaultValue - ); - } - break; - case "double": - if (ctrl.field.defaultValue) { - ctrl.model[ctrl.field.name] = parseFloat( - ctrl.mixDatabaseDataValue.field.defaultValue - ); - } - break; - case "boolean": - if (ctrl.field.defaultValue) { - ctrl.model[ctrl.field.name] = - ctrl.mixDatabaseDataValue.field.defaultValue == "true"; - } - break; - - default: - if (ctrl.field.defaultValue) { - ctrl.model[ctrl.field.name] = ctrl.field.defaultValue; - } - break; - } - }; - }, - ], -}); - -modules.component("mixFieldPreview", { - templateUrl: "/mix-app/views/app-shared/components/mix-field-preview/view.html", - bindings: { - model: "=", - field: "=", - isShowTitle: "=?", - inputClass: "=?", - }, - controller: [ - "$rootScope", - "$sce", - function ($rootScope, $sce) { - var ctrl = this; - ctrl.previousId = null; - ctrl.$onInit = function () { - ctrl.uuid = $rootScope.generateUUID(); - if (ctrl.field.isEncrypt) { - var obj = $rootScope.testJSON(ctrl.model); - if (obj) { - ctrl.encryptedData = obj; - ctrl.model = ctrl.encryptedData.data; - ctrl.decrypted = $rootScope.decrypt(ctrl.encryptedData); - } - } - if (ctrl.field.dataType == 20 && ctrl.model) { - // youtube video - ctrl.model = $sce.trustAsResourceUrl( - "https://www.youtube.com/embed/" + - ctrl.model + - "?rel=0&showinfo=0&autoplay=0" - ); - } - // if(ctrl.field.dataType == 24 && ctrl.model) // youtube video - // { - // ctrl.generateQRCode(); - // } - }; - - ctrl.generateQRCode = function () { - setTimeout(() => { - $("#" + ctrl.uuid).empty(); - $("#" + ctrl.uuid).qrcode(ctrl.model); - }, 200); - }; - }, - ], -}); - - -modules.component('mixLoader', { - templateUrl: '/mix-app/views/app-shared/components/mix-loader/view.html', - controller: ['$rootScope', '$location', function ($rootScope, $location) { - var ctrl = this; - ctrl.imageDataArray = []; - ctrl.canvasCount = 10; - ctrl.duration = 500; - ctrl.bgDuration = 2500; - ctrl.canvas = null; - ctrl.init = function () { - html2canvas($(".mix-loader-container .content")[0]).then(canvas => { - ctrl.canvas = canvas; - }); - }; - ctrl.swap = function () { - var temp = document.createElement('canvas'); - var buffer = temp.getContext('2d'); - var scale = 0.5; - //capture all div data as image - // ctx = ctrl.canvas.getContext("2d"); - temp.width = ctrl.canvas.width * scale; - temp.height = ctrl.canvas.height * scale; - buffer.drawImage(ctrl.canvas, 0, 0, ctrl.canvas.width * scale, ctrl.canvas.height * scale); - var imageData = buffer.getImageData(0, 0, temp.width, temp.height); - var pixelArr = imageData.data; - ctrl.createBlankImageData(imageData); - //put pixel info to ctrl.imageDataArray (Weighted Distributed) - for (let i = 0; i < pixelArr.length; i += 4) { - //find the highest probability canvas the pixel should be in - let p = Math.floor((i / pixelArr.length) * ctrl.canvasCount); - let a = ctrl.imageDataArray[ctrl.weightedRandomDistrib(p)]; - a[i] = pixelArr[i]; - a[i + 1] = pixelArr[i + 1]; - a[i + 2] = pixelArr[i + 2]; - a[i + 3] = pixelArr[i + 3]; - } - //create canvas for each imageData and append to target element - for (let i = 0; i < ctrl.canvasCount; i++) { - let c = ctrl.newCanvasFromImageData(ctrl.imageDataArray[i], temp.width, temp.height); - c.classList.add("dust"); - $(".mix-loader-container").append(c); - } - //clear all children except the canvas - $(".mix-loader-container .content").children().not(".dust").fadeOut(ctrl.bgDuration); - //apply animation - $(".dust").each(function (index) { - ctrl.animateBlur($(this), 0.8, ctrl.duration); - setTimeout(() => { - ctrl.animateTransform($(this), 100, -100, chance.integer({ min: -15, max: 15 }), ctrl.duration + (110 * index)); - }, 70 * index); - //remove the canvas from DOM tree when faded - $(this).delay(70 * index).fadeOut((110 * index) + ctrl.duration, "swing", () => { $(this).remove(); }); - }); - - }; - ctrl.weightedRandomDistrib = function (peak) { - var prob = [], seq = []; - for (let i = 0; i < ctrl.canvasCount; i++) { - prob.push(Math.pow(ctrl.canvasCount - Math.abs(peak - i), 3)); - seq.push(i); - } - return chance.weighted(seq, prob); - }; - ctrl.animateBlur = function (elem, radius, duration) { - var r = 0; - $({ rad: 0 }).animate({ rad: radius }, { - duration: duration, - easing: "swing", - step: function (now) { - elem.css({ - filter: 'blur(' + now + 'px)' - }); - } - }); - } - ctrl.animateTransform = function (elem, sx, sy, angle, duration) { - var td = tx = ty = 0; - $({ x: 0, y: 0, deg: 0 }).animate({ x: sx, y: sy, deg: angle }, { - duration: duration, - easing: "swing", - step: function (now, fx) { - if (fx.prop == "x") - tx = now; - else if (fx.prop == "y") - ty = now; - else if (fx.prop == "deg") - td = now; - elem.css({ - transform: 'rotate(' + td + 'deg)' + 'translate(' + tx + 'px,' + ty + 'px)' - }); - } - }); - } - ctrl.createBlankImageData = function (imageData) { - for (let i = 0; i < ctrl.canvasCount; i++) { - let arr = new Uint8ClampedArray(imageData.data); - for (let j = 0; j < arr.length; j++) { - arr[j] = 0; - } - ctrl.imageDataArray.push(arr); - } - } - ctrl.newCanvasFromImageData = function (imageDataArray, w, h) { - var canvas = document.createElement('canvas'); - canvas.width = w; - canvas.height = h; - tempCtx = canvas.getContext("2d"); - tempCtx.putImageData(new ImageData(imageDataArray, w, h), 0, 0); - - return canvas; - } - }], - - bindings: { - isShow: '=', - } -}); -modules.component("mixModuleDataTable", { - templateUrl: - "/mix-app/views/app-shared/components/mix-module-data-table/mix-module-data-table.html", - controller: [ - "$rootScope", - "$scope", - "$location", - "ngAppSettings", - "SharedModuleDataService", - function ($rootScope, $scope, $location, ngAppSettings, dataService) { - var ctrl = this; - ctrl.colWidth = 3; - ctrl.init = function () { - ctrl.editUrl = "/portal/module-data/details/" + ctrl.moduleId; - ctrl.visible = $rootScope.visible; - if (ctrl.data.items.length) { - ctrl.min = ctrl.data.items[0].priority; - if (!ctrl.min) { - ctrl.min = 0; - } - } - ctrl.colWidth = parseInt(9 / ctrl.columns.length); - ctrl.lastColWidth = 9 % ctrl.columns.length > 0 ? 2 : 1; - }; - ctrl.translate = $rootScope.translate; - ctrl.selected = null; - ctrl.updateOrders = function (index, items) { - items.splice(index, 1); - for (var i = 0; i < items.length; i++) { - items[i].priority = ctrl.min + i; - } - ctrl.updateDataInfos(items); - }; - ctrl.updateDataInfos = async function (items) { - $rootScope.isBusy = true; - var resp = await dataService.updateInfos(items); - if (resp && resp.isSucceed) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.dragoverCallback = function (index, item, external, type) { - //console.log('drop ', index, item, external, type); - }; - ctrl.insertCallback = function (index, item, external, type) { - //console.log('insert ', index, item, external, type); - }; - ctrl.delete = function (id) { - ctrl.onDelete({ id: id }); - }; - ctrl.goTo = function (id) { - $location.path(ctrl.editUrl + "/" + id); - }; - ctrl.toggleChildNavs = function (nav) { - nav.showChildNavs = nav.childNavs.length > 0 && !nav.showChildNavs; - }; - ctrl.view = function (moduleId, contentId) { - var obj = { - moduleId: moduleId, - id: contentId, - }; - $rootScope.preview("module-data", obj, null, "modal-lg"); - }; - }, - ], - bindings: { - moduleId: "=", - data: "=", - childName: "=", - canDrag: "=", - editUrl: "=", - columns: "=", - onDelete: "&", - // onUpdateInfos: '&', - onUpdateChildInfos: "&", - }, -}); - -'use strict'; -app.controller('ModalPostController', [ - '$scope', '$rootScope', '$location', 'ngAppSettings', '$routeParams', 'PostRestService', - function ( - $scope, $rootScope, $location, ngAppSettings, $routeParams, service) { - BaseCtrl.call(this, $scope, $rootScope, $routeParams, ngAppSettings, service); - $scope.columns = [{ - title: 'Title', - name: 'title', - filter: true, - type: 'string' - }, - { - title: 'Url', - name: 'imageUrl', - filter: true, - type: 'upload' - }, - ]; - } -]); -'use strict'; -app.factory('ModalPostRestService', ['$rootScope', 'CommonService', 'BaseService', - function ($rootScope, commonService, baseService) { - - var serviceFactory = Object.create(baseService); - serviceFactory.init('page-post'); - return serviceFactory; - - } -]); -modules.component('modalPosts', { - templateUrl: '/mix-app/views/app-shared/components/modal-posts/modal-posts.html', - controller: 'ModalPostController', - bindings: { - data: '=', - childName: '=', - canDrag: '=', - editUrl: '=', - columns: '=', - onDelete: '&', - onUpdateInfos: '&', - onUpdateChildInfos: '&', - } -}); -// modules.component('modalConfirm', { -// templateUrl: '/mix-app/views/app-shared/components/modal-confirm/modal-confirm.html', -// controller: ModalConfirmController, -// bindings: { -// message: '=' -// } -// }); -function ModalConfirmController($rootScope, $scope, $mdDialog, message) { - $scope.message = message; - $scope.executeFunctionByName = async function (functionName, args, context) { - var result = await $rootScope.executeFunctionByName(functionName, args, context); - if (result) { - $scope.$apply(); - } - $mdDialog.hide(); - } - $scope.closeDialog = function () { - $mdDialog.hide(); - }; -} -modules.controller( - "ModalCroppieController", - function ( - $rootScope, - $scope, - $http, - $uibModalInstance, - mediaService, - file, - w, - h, - rto - ) { - var ctrl = this; - ctrl.file = file; - ctrl.w = w; - ctrl.h = h; - ctrl.rto = rto; - ctrl.isAdmin = $rootScope.isAdmin; - ctrl.postedFile = {}; - ctrl.isImage = false; - ctrl.mediaNavs = []; - ctrl.media = { - title: "", - mediaFile: { - file: null, - }, - }; - ctrl.image_placeholder = "/mix-app/assets/img/image_placeholder.jpg"; - ctrl.options = null; - ctrl.init = function () { - ctrl.srcUrl = ctrl.srcUrl || ctrl.image_placeholder; - ctrl.maxHeight = ctrl.maxHeight || "2000px"; - ctrl.id = Math.floor(Math.random() * 100); - ctrl.canvas = document.getElementById(`canvas-${ctrl.id}`); - ctrl.cropped = { - source: null, - }; - if (ctrl.frameUrl) { - ctrl.frame = ctrl.loadImage(frameUrl); - } - - if (ctrl.srcUrl) { - ctrl.loadBase64(ctrl.srcUrl); - } - - if (ctrl.file) { - setTimeout(() => { - ctrl.selectFile([ctrl.file]); - }, 500); - } - - // Assign blob to component when selecting a image - }; - - ctrl.loadFromUrl = function () { - if (ctrl.src !== ctrl.srcUrl && ctrl.srcUrl != ctrl.image_placeholder) { - ctrl.src = ctrl.srcUrl; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - if (ctrl.isImage) { - ctrl.loadBase64(ctrl.srcUrl); - } - } - }; - - ctrl.ok = async function () { - ctrl.media.mediaFile.fileStream = ctrl.cropped.image; - var result = await mediaService.save(ctrl.media); - if (result.isSucceed) { - $uibModalInstance.close(result.data); - } - }; - - ctrl.cancel = function () { - $uibModalInstance.dismiss("cancel"); - }; - ctrl.combineImage = function () { - ctrl.canvas = document.getElementById(`canvas-${ctrl.id}`); - if (ctrl.canvas) { - var img = document.getElementById("croppie-src"); - var w = ctrl.options.boundary.width; - var h = ctrl.options.boundary.height; - // var rto = w / h; - var newW = ctrl.options.output.width; - var newH = ctrl.options.output.height; - var ctx = ctrl.canvas.getContext("2d"); - ctx.imageSmoothingEnabled = true; - ctx.drawImage(img, 0, 0, newW, newH); - if (ctrl.frame) { - // combine with frame - ctx.drawImage(ctrl.frame, 0, 0, w, h); - } - - $scope.$apply(function () { - ctrl.postedFile.fileStream = ctrl.canvas.toDataURL(); //ctx.getImageData(0, 0, 300, 350); - ctrl.imgUrl = ctrl.postedFile.fileStream.replace( - "image/png", - "image/octet-stream" - ); - }); - } - }; - ctrl.saveCanvas = function () { - var link = document.createElement("a"); - link.download = ctrl.postedFile.fileName + ctrl.postedFile.extension; - $rootScope.isBusy = true; - ctrl.canvas.toBlob(function (blob) { - link.href = URL.createObjectURL(blob); - link.click(); - $rootScope.isBusy = false; - $scope.$apply(); - }, "image/png"); - }; - ctrl._arrayBufferToBase64 = function (buffer) { - var binary = ""; - var bytes = new Uint8Array(buffer); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]); - } - return window.btoa(binary); - }; - - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.media.folder = ctrl.folder ? ctrl.folder : "Media"; - ctrl.media.title = ctrl.title ? ctrl.title : file.name; - ctrl.media.description = ctrl.description ? ctrl.description : ""; - ctrl.media.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.media.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - ctrl.getBase64(file); - // if (file.size < 100000) { - // var msg = "Please choose a better photo (larger than 100kb)!"; - // $rootScope.showConfirm(ctrl, null, [], null, null, msg); - // } else { - // } - } - }; - ctrl.loadBase64 = function (url) { - var ext = url.substring(url.lastIndexOf(".") + 1); - $http({ - method: "GET", - url: url, - responseType: "arraybuffer", - }).then(function (resp) { - var base64 = `data:image/${ext};base64,${ctrl._arrayBufferToBase64( - resp.data - )}`; - var image = new Image(); - image.src = base64; - image.onload = function () { - // access image size here - ctrl.loadImageSize(this.width, this.height); - ctrl.cropped.source = base64; - $scope.$apply(); - }; - return base64; - }); - }; - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - // ctrl.cropped.source = null; - reader.onload = function () { - if (ctrl.media.mediaFile) { - ctrl.media.mediaFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.media.mediaFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - // ctrl.postedFile.fileStream = reader.result; - } - var image = new Image(); - image.src = reader.result; - - image.onload = function () { - // access image size here - ctrl.loadImageSize(this.width, this.height); - ctrl.cropped.source = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - ctrl.loadImageSize = function (w, h) { - // const maxW = ctrl.w + 100; - const maxW = 600; - var rto = w / h; - ctrl.w = ctrl.w || w; - ctrl.h = ctrl.h || h; - ctrl.rto = ctrl.rto || rto; - ctrl.options = { - boundary: { height: maxW / rto, width: maxW }, - render: { height: maxW / rto, width: maxW }, - output: { height: ctrl.h, width: ctrl.h * ctrl.rto }, - }; - ctrl.loadViewport(); - }; - ctrl.loadViewport = function () { - if (ctrl.w && ctrl.h) { - const maxW = 600; - ctrl.rto = ctrl.w / ctrl.h; - let w = ctrl.w > maxW ? maxW * 0.6 : ctrl.w * 0.6; - let h = w / ctrl.rto; - if (w > ctrl.options.boundary.width) { - w = ctrl.options.boundary.width; - h = w / ctrl.rto; - } - ctrl.options.viewport = { - height: h, - width: w, - }; - } - }; - } -); - -'use strict'; -app.controller('SharedModuleDataController', ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'AuthService', 'SharedModuleDataService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, authService, moduleDataService) { - $scope.request = { - pageSize: '10', - pageIndex: 0, - status: 'Published', - orderBy: 'CreatedDateTime', - direction: 'Desc', - fromDate: null, - toDate: null, - keyword: '' - }; - $scope.moduleDataFile = { - file: null, - fullPath: '', - folder: 'ModuleData', - title: '', - description: '' - }; - $scope.activedModuleData = null; - $scope.relatedModuleDatas = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - }; - $scope.errors = []; - - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; - }; - - $scope.getModuleData = async function (id) { - $rootScope.isBusy = true; - var resp = await moduleDataService.getModuleData(id, 'portal'); - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.initModuleForm = async function (name) { - var resp = null; - $scope.name = name; - if ($scope.id) { - resp = await moduleDataService.getModuleData($scope.id, $scope.dataId, 'portal'); - } - else { - resp = await moduleDataService.initModuleForm($scope.name); - } - - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.loadParams = async function () { - $scope.dataId = $routeParams.id; - $scope.backUrl = '/portal/module-data/list/' + $routeParams.moduleId; - $scope.moduleId = $routeParams.moduleId; - }; - - $scope.loadModuleData = async function () { - $rootScope.isBusy = true; - var moduleId = $routeParams.moduleId; - var id = $routeParams.id; - var response = await moduleDataService.getModuleData(moduleId, id, 'portal'); - if (response.isSucceed) { - $scope.activedModuleData = response.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.loadModuleDatas = async function (moduleId, pageIndex) { - $scope.request.key = moduleId; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); - } - var resp = await moduleDataService.getModuleDatas($scope.request); - if (resp && resp.isSucceed) { - - $scope.data = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeModuleData = async function (id) { - if (confirm("Are you sure!")) { - var resp = await moduleDataService.removeModuleData(id); - if (resp && resp.isSucceed) { - $scope.loadModuleDatas(); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - } - } - }; - - $scope.saveModuleData = async function () { - - var resp = await moduleDataService.saveModuleData($scope.activedModuleData); - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.showMessage('Update successfully!', 'success'); - $rootScope.isBusy = false; - $scope.initModuleForm($scope.name); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/portal/moduleData/details/' + resp.data.id); - } - else { - if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - }]); - -'use strict'; -app.factory('SharedModuleDataService', ['$http', '$rootScope', 'CommonService', function ($http, $rootScope, commonService) { - - - var moduleDatasServiceFactory = {}; - - var _updateInfos = async function (pages) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data'; - var req = { - method: 'POST', - url: apiUrl + '/update-infos', - data: JSON.stringify(pages) - }; - return await commonService.getApiResult(req); - }; - - var _getModuleData = async function (moduleId, id, type) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var url = apiUrl + 'details/' + type; - if (id) { - url += '/' + moduleId + '/' + id; - } else { - url += '/' + moduleId; - } - var req = { - method: 'GET', - url: url - }; - return await commonService.getApiResult(req) - }; - - - var _getModuleDatas = async function (request) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var req = { - method: 'POST', - url: apiUrl + 'list', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _exportModuleData = async function (request) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var req = { - method: 'POST', - url: apiUrl + 'export', - data: JSON.stringify(request) - }; - - return await commonService.getApiResult(req); - }; - - var _initModuleForm = async function (name) { - - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var req = { - method: 'GET', - url: apiUrl + 'init-by-name/' + name, - }; - - return await commonService.getApiResult(req); - }; - - var _removeModuleData = async function (id) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var req = { - method: 'GET', - url: apiUrl + 'delete/' + id - }; - return await commonService.getApiResult(req); - }; - - var _saveModuleData = async function (moduleData) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var req = { - method: 'POST', - url: apiUrl + 'save', - data: JSON.stringify(moduleData) - }; - return await commonService.getApiResult(req); - }; - var _saveFields = async function (id, propertyName, propertyValue) { - var apiUrl = '/' + $rootScope.settings.lang + '/module-data/'; - var field = [ - { - propertyName: propertyName, - propertyValue: propertyValue - } - ] - var req = { - method: 'POST', - url: apiUrl + 'save/' + id, - data: JSON.stringify(field) - }; - return await commonService.getApiResult(req) - }; - moduleDatasServiceFactory.getModuleData = _getModuleData; - moduleDatasServiceFactory.getModuleDatas = _getModuleDatas; - moduleDatasServiceFactory.exportModuleData = _exportModuleData; - moduleDatasServiceFactory.removeModuleData = _removeModuleData; - moduleDatasServiceFactory.saveModuleData = _saveModuleData; - moduleDatasServiceFactory.initModuleForm = _initModuleForm; - moduleDatasServiceFactory.saveFields = _saveFields; - moduleDatasServiceFactory.updateInfos = _updateInfos; - return moduleDatasServiceFactory; -}]); - -modules.component("moduleDataPreview", { - templateUrl: - "/mix-app/views/app-shared/components/module-data-preview/module-data-preview.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - - ctrl.translate = $rootScope.translate; - ctrl.$onInit = () => { - if (!ctrl.datatype) { - ctrl.datatype = ctrl.data.dataType; - } - }; - }, - ], - bindings: { - data: "=", - datatype: "=?", - width: "=", - header: "=", - }, -}); - -modules.component('moduleForm', { - templateUrl: '/mix-app/views/app-shared/components/module-form/view.html', - bindings: { - moduleId: '=', - categoryId: '=', - productId: '=', - postId: '=', - d: '=', - title: '=', - name: '=', - submitText: '=', - isShowTitle: '=', - backUrl: '=?', - saveCallback: '&?', - failedCallback: '&?', - }, - controller: ['$scope', '$rootScope', 'ngAppSettings', '$routeParams', '$timeout', '$location', 'AuthService', 'ModuleDataRestService', - function ($scope, $rootScope, ngAppSettings, $routeParams, $timeout, $location, authService, moduleDataService) { - var ctrl = this; - $rootScope.isBusy = false; - - ctrl.initModuleForm = async function () { - var resp = null; - if (!$rootScope.isInit) { - setTimeout(function () { - ctrl.initModuleForm(); - }, 500); - } else { - if (!ctrl.moduleId) { - resp = await moduleDataService.initModuleForm(ctrl.name); - } else { - if (ctrl.d) { - resp = await moduleDataService.getSingle([ctrl.d]); - } - else { - resp = await moduleDataService.initForm(ctrl.moduleId); - } - } - if (resp && resp.isSucceed) { - ctrl.data = resp.data; - ctrl.data.postId = ctrl.postId; - ctrl.data.productId = ctrl.productId; - ctrl.data.categoryId = ctrl.categoryId; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - - ctrl.loadModuleData = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var response = await moduleDataService.getModuleData(ctrl.moduleId, ctrl.d, 'portal'); - if (response.isSucceed) { - ctrl.data = response.data; - //$rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - ctrl.submitFormData = async function () { - if ($('.g-recaptcha').length > 0) { - - } else { - ctrl.saveModuleData(); - } - } - ctrl.saveModuleData = async function () { - var form = $('#module-' + ctrl.data.moduleId); - - $.each(ctrl.data.dataProperties, function (i, e) { - switch (e.dataType) { - case 5: - e.value = $(form).find('.' + e.name).val(); - break; - default: - e.value = e.value ? e.value.toString() : null; - break; - } - }); - var resp = await moduleDataService.save(ctrl.data); - if (resp && resp.isSucceed) { - ctrl.data = resp.data; - if (ctrl.saveSuccessCallback) { - ctrl.saveSuccessCallback({ - data: ctrl.data - }); - } else { - var msg = $rootScope.translate('success'); - $rootScope.showMessage(msg, 'success'); - ctrl.initModuleForm(); - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - if (resp) { - // if(ctrl.failedCallback){ - // ctrl.failedCallback({ response: resp }); - // } - // else{ - // $rootScope.showErrors(resp.errors); - // } - $rootScope.showErrors(resp.errors); - } - - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - } - ] -}); -modules.component("moduleFormEditor", { - templateUrl: "/mix-app/views/app-shared/components/module-form-editor/view.html", - bindings: { - data: "=", - datatype: "=?", - inputClass: "=", - isShowTitle: "=", - fieldTitle: "=", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - function ($rootScope, $scope, ngAppSettings) { - var ctrl = this; - ctrl.icons = ngAppSettings.icons; - this.dataTypes = ngAppSettings.dataTypes; - ctrl.$onInit = function () { - ctrl.dataType = ctrl.data.dataType.toLowerCase() || ctrl.dataType.toLowerCase(); - }; - }, - ], -}); - - -modules.component('modulePreview', { - templateUrl: '/mix-app/views/app-shared/components/module-preview/view.html', - controller: ['$scope', '$rootScope', 'SharedModuleDataService', - function ($scope, $rootScope, moduleDataService) { - var ctrl = this; - $rootScope.isBusy = false; - ctrl.previousContentId = undefined; - - this.$onInit = () => { ctrl.previousContentId = angular.copy(ctrl.contentId) }; - - this.$doCheck = () => { - if (ctrl.contentId !== ctrl.previousContentId) { - ctrl.loadModuleData(); - ctrl.previousContentId = ctrl.contentId; - } - }; - - ctrl.loadModuleData = async function () { - $rootScope.isBusy = true; - var response = await moduleDataService.getModuleData(ctrl.moduleId, ctrl.contentId, 'portal'); - if (response.isSucceed) { - ctrl.data = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } - else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }], - bindings: { - moduleId: '=', - contentId: '=' - } -}); - - -modules.component('mixPaging', { - templateUrl: '/mix-app/views/app-shared/components/paging/paging.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.loadData = function (index) { - ctrl.pagingAction({ pageIndex: index }); - }; - ctrl.range = $rootScope.range; - }], - bindings: { - data: '=', - activeClass: '=', - ulClass: '=', - page: '=', - pageSize: '=', - total: '=', - totalPage: '=', - pagingAction: '&' - } -}); - -modules.component('portalSearch', { - templateUrl: 'portal-search.html', - bindings: { - previewUrl: '=', - backUrl: '=' - } -}); -modules.component('previewImage', { - templateUrl: '/mix-app/views/app-shared/components/preview-image/preview-image.html', - controller: ['$rootScope', '$scope', 'ngAppSettings', function ($rootScope, $scope) { - var ctrl = this; - ctrl.isImage = false; - ctrl.init = function () { - if (ctrl.imgSrc) { - ctrl.isImage = ctrl.imgSrc.toLowerCase().match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - // check if facebook avatar Url - ctrl.isImage = ctrl.isImage || ctrl.imgSrc.toLowerCase().match(/(?:(?:http|https):\/\/)?(?:www.)?(graph.facebook.com)\/([A-Za-z0-9.]{0,})\/(picture)(\?)?([A-Za-z0-9.=&]{0,})?/g); - - } - }; - ctrl.showImage = async function (functionName, args, context) { - $rootScope.preview('img', ctrl.imgSrc); - }; - }], - bindings: { - imgWidth: '=', - imgHeight: '=', - imgSrc: '=' - } -}); -modules.component('previewPopup', { - templateUrl: '/mix-app/views/app-shared/components/preview-popup/preview-popup.html', - controller: ['$location', function ($location) { - var ctrl = this; - ctrl.goToLink = async function (link) { - $('#dlg-preview-popup').modal('hide'); - $location.path(link); - }; - }], - bindings: { - previewObject: '=' - } -}); - -modules.component('qrCode', { - templateUrl: '/mix-app/views/app-shared/components/qr-code/view.html', - controller: ['$location', function ($location) { - var ctrl = this; - ctrl.$onInit = function () { - if (ctrl.model) { - ctrl.generate(); - } - } - ctrl.generate = function () { - $('#qr-output').empty(); - $('#qr-output').qrcode(ctrl.model); - }; - }], - bindings: { - model: '=' - } -}); -modules.component('quillEditor', { - templateUrl: '/mix-app/views/app-shared/components/quill-editor/view.html', - controller: ['$rootScope', '$scope', '$element', 'ngAppSettings', - function ($rootScope, $scope, $element, ngAppSettings) { - var ctrl = this; - ctrl.previousId = null; - ctrl.editor = null; - ctrl.init = function () { - ctrl.guid = $rootScope.generateUUID(); - setTimeout(() => { - - var toolbarOptions = { - container: [ - ['bold', 'italic', 'underline', 'strike'], // toggled buttons - ['blockquote', 'image', 'link', 'code-block'], - - [{ 'header': 1 }, { 'header': 2 }], // custom button values - [{ 'list': 'ordered' }, { 'list': 'bullet' }], - [{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript - [{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent - [{ 'direction': 'rtl' }], // text direction - - [{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown - [{ 'header': [1, 2, 3, 4, 5, 6, false] }], - - [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme - [{ 'font': [] }], - [{ 'align': [] }], - - ['clean'] // remove formatting button - ], - handlers: { - // handlers object will be merged with default handlers object - 'link': function (value) { - if (value) { - var href = prompt('Enter the URL'); - this.quill.format('link', href); - } else { - this.quill.format('link', false); - } - }, - 'image': function () { - var range = this.quill.getSelection(); - var value = prompt('Enter the image URL'); - this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER); - } - } - }; - - ctrl.editor = new Quill('#quill-editor-' + ctrl.guid, { - modules: { - toolbar: toolbarOptions, - imageResize: {} - }, - placeholder: 'Compose an epic...', - theme: 'snow' - }); - - // Init content - ctrl.editor.clipboard.dangerouslyPasteHTML(0, ctrl.content); - - ctrl.editor.on('text-change', function (delta, oldDelta, source) { - if (source == 'api') { - console.log("An API call triggered this change."); - } else if (source == 'user') { - console.log("A user action triggered this change."); - } - ctrl.updateContent(); - }); - - - }, 100); - }; - window.fsClick = function () { - $(".quill-editor-defaultUI").toggleClass("fs"); - }; - ctrl.updateContent = function () { - // ctrl.content = JSON.stringify(ctrl.editor.getContents()); - ctrl.content = ctrl.editor.root.innerHTML; - $scope.$apply(); - // console.log(ctrl.content); - }; - - - } - ], - bindings: { - content: '=' - } -}); - -modules.component('recaptcha', { - templateUrl: '/mix-app/views/app-shared/components/recaptcha/recaptcha.html', - controller: ['$rootScope', 'CommonService', - function ($rootScope, commonService) { - var ctrl = this; - ctrl.shortenString = ''; - ctrl.previousContentId = undefined; - ctrl.recaptcha_key = null; - ctrl.token = null; - this.$onInit = () => { - ctrl.recaptcha_key = $rootScope.globalSettings.data.Recaptcha_Key; - ctrl.recaptcha_secret = $rootScope.globalSettings.data.Recaptcha_Secret; - grecaptcha.ready(function () { - grecaptcha.execute(ctrl.recaptcha_key, { action: ctrl.action }) - .then(function (token) { - ctrl.token = token; - }); - }); - }; - ctrl.verify = function () { - var url = 'https://www.google.com/recaptcha/api/siteverify'; - var data = { - secret: ctrl.recaptcha_secret, - response: ctrl.token - }; - var req = { - method: 'POST', - url: url, - data: data - }; - return commonService.getApiResult(req).then(function (response) { - if (response.success) { - ctrl.callback(); - } - else { - angular.forEach(response.error - codes, function (err) { - commonService.showAlertMsg('Recaptcha Error', err); - }); - - } - }); - } - }], - bindings: { - action: '=', - callback: '&', - } -}); -modules.component('serviceHub', { - templateUrl: '/mix-app/views/app-shared/components/service-hub/view.html', - bindings: { - hubName: '=' - }, - controller: ['$rootScope', '$scope', function ($rootScope, $scope) { - var ctrl = this; - BaseHub.call(this, ctrl); - - ctrl.user = { - loggedIn: false, - connection: {} - }; - ctrl.isHide = true; - ctrl.hideContact = true; - ctrl.members = []; - ctrl.messages = []; - ctrl.message = { connection: {}, content: '' }; - ctrl.request = { - uid: '', - action: '', - objectType: null, - data: {}, - room: '', - isMyself: false - }; - ctrl.loadMsgButton = function () { - - } - ctrl.init = function () { - ctrl.user.connection.name = Math.random() * 100; - ctrl.user.connection.id = 'abc'; - ctrl.user.connection.avatar = ''; - ctrl.startConnection('serviceHub', ctrl.join); - }; - ctrl.logout = function () { - FB.logout(function (response) { - // user is now logged out - ctrl.user.loggedIn = false; - }); - }; - ctrl.login = function () { - FB.login(function (response) { - if (response.authResponse) { - FB.api('/me', function (response) { - - ctrl.user.info.name = response.name; - ctrl.user.info.id = response.id; - ctrl.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - ctrl.join(); - $scope.$apply(); - }); - } else { - console.log('User cancelled login or did not fully authorize.'); - } - }); - }; - ctrl.join = function () { - // var obj = {name: 'tinku', message: 'test'}; - // ctrl.connection.invoke("SendMessage", JSON.stringify(obj) ).catch(err => console.error(err.toString())); - ctrl.request.action = "join_group"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.user.connection; - ctrl.message.connection = ctrl.user.connection; - ctrl.connection.invoke('HandleRequest', JSON.stringify(ctrl.request)); - - }; - ctrl.toggle = function () { - ctrl.isHide = !ctrl.isHide; - } - ctrl.toggleContact = function () { - ctrl.hideContact = !ctrl.hideContact; - }; - ctrl.sendMessage = function () { - // if (ctrl.user.loggedIn) { - ctrl.request.data = ctrl.message; - ctrl.request.action = "send_message"; - ctrl.connection.invoke('sendMessage', JSON.stringify(ctrl.request)); - ctrl.message.content = ''; - // } - }; - ctrl.receiveMessage = function (msg) { - switch (msg.responseKey) { - case 'NewMember': - ctrl.newMember(msg.data); - $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - - case 'NewMessage': - ctrl.newMessage(msg.data); - break; - case 'ConnectSuccess': - ctrl.user.loggedIn = true; - ctrl.initList(msg.data); - $scope.$apply(); - break; - - case 'MemberOffline': - ctrl.removeMember(msg.data); - break; - case 'Error': - console.error(msg.data) - break; - - } - - }; - ctrl.checkLoginStatus = function () { - FB.getLoginStatus(function (response) { - if (response.status === 'connected') { - // The user is logged in and has authenticated your - // app, and response.authResponse supplies - // the user's ID, a valid access token, a signed - // request, and the time the access token - // and signed request each expire. - FB.api('/me', function (response) { - ctrl.user.info.name = response.name; - ctrl.user.info.id = response.id; - ctrl.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - ctrl.join(); - $scope.$apply(); - }); - } else if (response.status === 'authorization_expired') { - // The user has signed into your application with - // Facebook Login but must go through the login flow - // again to renew data authorization. You might remind - // the user they've used Facebook, or hide other options - // to avoid duplicate account creation, but you should - // collect a user gesture (e.g. click/touch) to launch the - // login dialog so popup blocking is not triggered. - } else if (response.status === 'not_authorized') { - // The user hasn't authorized your application. They - // must click the Login button, or you must call FB.login - // in response to a user gesture, to launch a login dialog. - } else { - // The user isn't logged in to Facebook. You can launch a - // login dialog with a user gesture, but the user may have - // to log in to Facebook before authorizing your application. - } - }); - }; - ctrl.newMember = function (member) { - var m = $rootScope.findObjectByKey(ctrl.members, 'id', member.id); - if (!m) { - ctrl.members.push(member); - } - $scope.$apply(); - }; - - ctrl.initList = function (data) { - data.forEach(member => { - var index = ctrl.members.findIndex(x => x.id === member.id); - if (index < 0) { - ctrl.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - } - - ctrl.removeMember = function (memberId) { - - var index = ctrl.members.findIndex(x => x.id === memberId); - if (index >= 0) { - ctrl.members.splice(index, 1); - } - $scope.$apply(); - } - - ctrl.newMessage = function (msg) { - ctrl.messages.push(msg); - $scope.$apply(); - // var objDiv = document.getElementsByClassName("widget-conversation")[0]; - // objDiv.scrollTop = objDiv.scrollHeight + 20; - } - - - }] -}); - -modules.component('codeEditor', { - templateUrl: 'codeEditor.html', - bindings: { - product: '=', - onDelete: '&', - onUpdate: '&' - } -}); -modules.component('snowy', { - templateUrl: '/mix-app/views/app-shared/components/snowy/index.html', - controller: ['$scope', function ($scope) { - var ctrl = this; - this.init = function () { - var Snowflake = (function () { - - var flakes; - var flakesTotal = 250; - var wind = 0; - var mouseX; - var mouseY; - - function Snowflake(size, x, y, vx, vy) { - this.size = size; - this.x = x; - this.y = y; - this.vx = vx; - this.vy = vy; - this.hit = false; - this.melt = false; - this.div = document.createElement('div'); - this.div.classList.add('snowflake'); - this.div.style.width = this.size + 'px'; - this.div.style.height = this.size + 'px'; - } - - Snowflake.prototype.move = function () { - if (this.hit) { - if (Math.random() > 0.995) this.melt = true; - } else { - this.x += this.vx + Math.min(Math.max(wind, -10), 10); - this.y += this.vy; - } - - // Wrap the snowflake to within the bounds of the page - if (this.x > window.innerWidth + this.size) { - this.x -= window.innerWidth + this.size; - } - - if (this.x < -this.size) { - this.x += window.innerWidth + this.size; - } - - if (this.y > window.innerHeight + this.size) { - this.x = Math.random() * window.innerWidth; - this.y -= window.innerHeight + this.size * 2; - this.melt = false; - } - - var dx = mouseX - this.x; - var dy = mouseY - this.y; - this.hit = !this.melt && this.y < mouseY && dx * dx + dy * dy < 2400; - }; - - Snowflake.prototype.draw = function () { - this.div.style.transform = - this.div.style.MozTransform = - this.div.style.webkitTransform = - 'translate3d(' + this.x + 'px' + ',' + this.y + 'px,0)'; - }; - - function update() { - for (var i = flakes.length; i--;) { - var flake = flakes[i]; - flake.move(); - flake.draw(); - } - requestAnimationFrame(update); - } - - Snowflake.init = function (container) { - flakes = []; - - for (var i = flakesTotal; i--;) { - var size = (Math.random() + 0.2) * 2 + 1; - var flake = new Snowflake( - size, - Math.random() * window.innerWidth, - Math.random() * window.innerHeight, - Math.random() - 0.5, - size * 0.3 - ); - container.appendChild(flake.div); - flakes.push(flake); - } - - container.onmousemove = function (event) { - mouseX = event.clientX; - mouseY = event.clientY; - wind = (mouseX - window.innerWidth / 2) / window.innerWidth * 6; - }; - - container.ontouchstart = function (event) { - mouseX = event.targetTouches[0].clientX; - mouseY = event.targetTouches[0].clientY; - event.preventDefault(); - }; - - window.ondeviceorientation = function (event) { - if (event) { - wind = event.gamma / 10; - } - }; - - update(); - }; - - return Snowflake; - - }()); - - window.onload = function () { - setTimeout(function () { - Snowflake.init(document.getElementById('snow')); - }, 500); - } - - }; - }], - bindings: { - } -}); -modules.component('starRating', { - templateUrl: '/mix-app/views/app-shared/components/star-rating/star-rating.html', - controller: ['$rootScope', function ($rootScope) { - var ctrl = this; - ctrl.translate = function (keyword) { - return $rootScope.translate(keyword); - }; - ctrl.readonly = true; - ctrl.rateFunction = function (rating) { - console.log('Rating selected: ' + rating); - }; - ctrl.init = function () { - ctrl.stars = []; - ctrl.max = ctrl.max || 5; - for (var i = 0; i < ctrl.max; i++) { - ctrl.stars.push({ - filled: i < ctrl.ratingValue - }); - } - }; - ctrl.toggle = function (index) { - if (ctrl.readonly === undefined || ctrl.readonly === false) { - ctrl.ratingValue = index + 1; - } - }; - - }], - bindings: { - ratingValue: '=', - max: '=?', // optional (default is 5) - onRatingSelect: '&?', - isReadonly: '=?' - } -}); - -modules.component('statuses', { - templateUrl: '/mix-app/views/app-shared/components/statuses/statuses.html', - controller: ['$rootScope', 'ngAppSettings', function ($rootScope, ngAppSettings) { - this.contentStatuses = ngAppSettings.contentStatuses; - }], - bindings: { - status: '=' - } -}); -'use trick'; -modules.directive('paneH', function () { - return { - require: '^tabs-h', - restrict: 'E', - transclude: true, - scope: { header: '@', id: '@' }, - link: function (scope, element, attrs, tabsController) { - tabsController.addPane(scope); - }, - template: - '
    ' + - '
    ', - replace: true - }; -}) -modules.directive('tabsH', function () { - return { - restrict: 'E', - transclude: true, - scope: { - selectCallback: '&' - }, - controller: function ($scope, $element) { - var panes = $scope.panes = []; - - $scope.select = function (pane) { - angular.forEach(panes, function (pane) { - pane.selected = false; - }); - pane.selected = true; - this.selectCallback({ pane: pane }); - }; - - this.addPane = function (pane) { - if (panes.length === 0) $scope.select(pane); - panes.push(pane); - }; - }, - templateUrl: '/mix-app/views/app-shared/components/tabs-horizontal/tabs.html', - replace: true - }; -}); -'use trick'; -modules.directive('paneV', function () { - return { - require: '^tabs-v', - restrict: 'E', - transclude: true, - scope: { header: '@', id: '@' }, - link: function (scope, element, attrs, tabsController) { - tabsController.addPane(scope); - }, - template: - '
    ' + - '
    ', - replace: true - }; -}) - -modules.directive('tabsV', function () { - return { - restrict: 'E', - transclude: true, - scope: { - selectCallback: '&' - }, - controller: function ($scope, $element) { - var panes = $scope.panes = []; - - $scope.select = function (pane) { - angular.forEach(panes, function (pane) { - pane.selected = false; - }); - pane.selected = true; - this.selectCallback({ pane: pane }); - }; - - this.addPane = function (pane) { - if (panes.length === 0) $scope.select(pane); - panes.push(pane); - }; - }, - templateUrl: '/mix-app/views/app-shared/components/tabs-verticle/tabs.html', - replace: true - }; -}); - -modules.component('tags', { - templateUrl: '/mix-app/views/app-shared/components/tags/tags.html', - controller: ['$scope', function ($scope) { - - var ctrl = this; - }], - bindings: { - input: '=' - } -}); - -modules.component('tagsView', { - templateUrl: '/mix-app/views/app-shared/components/tags-view/view.html', - controller: ['$rootScope', '$scope', function ($rootScope, $scope) { - var ctrl = this; - ctrl.$onInit = function () { - if (ctrl.tags) { - ctrl.data = angular.fromJson(ctrl.tags); - } - else { - ctrl.data = []; - } - angular.forEach(ctrl.data, function (e, i) { - e.url = $rootScope.globalSettings.domain + '/' - + $rootScope.settings.lang + '/tag/' + e.text; - }); - $scope.$apply(); - } - }], - bindings: { - tags: '=' - } -}); -modules.component('trumbowyg', { - templateUrl: '/mix-app/views/app-shared/components/trumbowyg/trumbowyg.html', - bindings: { - options: ' { - $scope.$applyAsync(() => { - const value = ctrl.getEditorReference().trumbowyg('html'); - ctrl.ngModel.$setViewValue(value) - }); - } - - ctrl.emitEvent = (event) => { - const attr = $attrs.$normalize(`on-${event}`); - if (angular.isFunction(this[attr])) { - $scope.$applyAsync(() => this[attr]()); - } - } - - ctrl.initializeEditor = (element, options) => { - if (ctrl.removeformatPasted) { - ctrl.editorConfigurations.plugins.removeformatPasted = ctrl.removeformatPasted == 'true'; - } - element.trumbowyg(ctrl.editorConfigurations.plugins) - .on('tbwchange', () => ctrl.updateModelValue()) - .on('tbwpaste', () => ctrl.updateModelValue()); - angular.forEach(TBW_EVENTS, (event) => { - element.on(`${EVENTS_PREFIX}${event}`, () => ctrl.emitEvent(event)); - }) - ctrl.ngModel.$render(); - } - - ctrl.$onDestroy = () => { - ctrl.getElementReference().trumbowyg('destroy'); - }; - - ctrl.$onChanges = (changes) => { - const element = ctrl.getElementReference(); - - if (changes.options && !changes.options.isFirstChange()) { - element.trumbowyg('destroy'); - } - - if (changes.options) { - ctrl.initializeEditor(element, angular.extend({}, ctrl.options)); - } - - if (changes.ngDisabled) { - element.trumbowyg(ctrl.ngDisabled ? 'disable' : 'enable'); - } - - if (changes.placeholder) { - ctrl.getEditorReference().attr('placeholder', ctrl.placeholder); - } - }; - - ctrl.$onInit = () => { - ctrl.ngModel.$render = () => { - const element = ctrl.getEditorReference(); - element.trumbowyg('html', ctrl.ngModel.$modelValue); - }; - }; - } - ] -}); - -modules.component('tuiEditor', { - templateUrl: '/mix-app/views/app-shared/components/tui-editor/view.html', - controller: ['$rootScope', '$scope', '$element', 'ngAppSettings', - function ($rootScope, $scope, $element, ngAppSettings) { - var ctrl = this; - ctrl.previousId = null; - ctrl.editor = null; - ctrl.init = function () { - ctrl.guid = $rootScope.generateUUID(); - setTimeout(() => { - ctrl.editor = new tui.Editor({ - el: document.querySelector('#tui-' + ctrl.guid), - initialEditType: 'markdown', - previewStyle: 'vertical', - height: '300px', - initialValue: ctrl.content, - events: { - // change: ctrl.updateContent, - // focus: () => onFocus(), - blur: () => ctrl.updateContent(), - }, - }); - ctrl.toolbar = ctrl.editor.getUI().getToolbar(); - ctrl.toolbar.addButton({ - name: 'fullscreen', - tooltip: 'fullscreen', - $el: $('') - }, 1); - - }, 100); - }; - window.fsClick = function () { - $(".tui-editor-defaultUI").toggleClass("fs"); - }; - ctrl.updateContent = function () { - ctrl.content = ctrl.editor.getMarkdown(); - }; - - } - ], - bindings: { - content: '=' - } -}); -modules.component("uploadCroppie", { - templateUrl: "/mix-app/views/app-shared/components/upload-croppie/view.html?v=1", - bindings: { - header: "=", - description: "=", - src: "=", - srcUrl: "=", - h: "=?", - w: "=?", - isCrop: "=?", - frameUrl: "=?", - type: "=", - folder: "=", - auto: "=", - onDelete: "&", - onUpdate: "&", - }, - controller: [ - "$rootScope", - "$scope", - "$modal", - "$http", - "ngAppSettings", - function ($rootScope, $scope, $modal, $http, ngAppSettings) { - var ctrl = this; - ctrl.options = { - boundary: { height: 250 }, - render: { width: 1000, height: 1000 }, - output: { width: 1000, height: 1000 }, - }; - ctrl.rto = 1; - ctrl.isAdmin = $rootScope.isAdmin; - ctrl.postedFile = {}; - ctrl.isImage = false; - ctrl.mediaNavs = []; - ctrl.image_placeholder = "/mix-app/assets/img/image_placeholder.jpg"; - // `https://via.placeholder.com/${ctrl.options.render.width}x${ctrl.options.render.height}.png`; - ctrl.$onInit = function () { - ctrl.loadViewport(); - ctrl.srcUrl = ctrl.srcUrl || ctrl.image_placeholder; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - ctrl.maxHeight = ctrl.maxHeight || "2000px"; - ctrl.id = Math.floor(Math.random() * 100); - ctrl.canvas = document.getElementById(`canvas-${ctrl.id}`); - ctrl.cropped = { - source: ctrl.image_placeholder, - }; - // var frameUrl = '/content/templates/tsets/uploads/2019-10/730149275529721421464195891692074859757568n0037047f8f6f4adab55211aee3538155.png';//$rootScope.settings.data['frame_url'] - if (ctrl.frameUrl) { - ctrl.frame = ctrl.loadImage(frameUrl); - } - if (ctrl.isImage) { - ctrl.loadBase64(ctrl.srcUrl); - } - // Assign blob to component when selecting a image - }; - ctrl.$doCheck = function () { - if (ctrl.src !== ctrl.srcUrl && ctrl.srcUrl != ctrl.image_placeholder) { - ctrl.src = ctrl.srcUrl; - ctrl.isImage = ctrl.srcUrl - .toLowerCase() - .match(/([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|svg)/g); - if (ctrl.isImage) { - ctrl.loadBase64(ctrl.srcUrl); - } - } - }.bind(ctrl); - ctrl.combineImage = function () { - ctrl.canvas = document.getElementById(`canvas-${ctrl.id}`); - if (ctrl.canvas) { - var img = document.getElementById("croppie-src"); - var w = ctrl.options.boundary.width; - var h = ctrl.options.boundary.height; - // var rto = w / h; - var newW = ctrl.options.output.width; - var newH = ctrl.options.output.height; - var ctx = ctrl.canvas.getContext("2d"); - ctx.imageSmoothingEnabled = true; - ctx.drawImage(img, 0, 0, newW, newH); - if (ctrl.frame) { - // combine with frame - ctx.drawImage(ctrl.frame, 0, 0, w, h); - } - - $scope.$apply(function () { - ctrl.postedFile.fileStream = ctrl.canvas.toDataURL(); //ctx.getImageData(0, 0, 300, 350); - ctrl.imgUrl = ctrl.postedFile.fileStream.replace( - "image/png", - "image/octet-stream" - ); - }); - } - }; - ctrl.saveCanvas = function () { - var link = document.createElement("a"); - link.download = ctrl.postedFile.fileName + ctrl.postedFile.extension; - $rootScope.isBusy = true; - ctrl.canvas.toBlob(function (blob) { - link.href = URL.createObjectURL(blob); - link.click(); - $rootScope.isBusy = false; - $scope.$apply(); - }, "image/png"); - }; - ctrl.loadBase64 = function (url) { - var ext = url.substring(url.lastIndexOf(".") + 1); - $http({ - method: "GET", - url: url, - responseType: "arraybuffer", - }).then(function (resp) { - var base64 = `data:image/${ext};base64,${ctrl._arrayBufferToBase64( - resp.data - )}`; - var image = new Image(); - image.src = base64; - image.onload = function () { - // access image size here - ctrl.loadImageSize(this.width, this.height); - }; - ctrl.cropped.source = base64; - return base64; - }); - }; - ctrl.loadImage = function (src) { - // http://www.thefutureoftheweb.com/blog/image-onload-isnt-being-called - var img = new Image(); - // img.onload = onload; - img.src = src; - return img; - }; - ctrl._arrayBufferToBase64 = function (buffer) { - var binary = ""; - var bytes = new Uint8Array(buffer); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]); - } - return window.btoa(binary); - }; - ctrl.mediaFile = { - file: null, - fullPath: "", - folder: ctrl.folder, - title: ctrl.title, - description: ctrl.description, - }; - ctrl.media = null; - - ctrl.selectFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - ctrl.mediaFile.folder = ctrl.folder ? ctrl.folder : "Media"; - ctrl.mediaFile.title = ctrl.title ? ctrl.title : ""; - ctrl.mediaFile.description = ctrl.description ? ctrl.description : ""; - ctrl.mediaFile.file = file; - ctrl.getBase64(file); - // if (file.size < 100000) { - // var msg = "Please choose a better photo (larger than 100kb)!"; - // $rootScope.showConfirm(ctrl, null, [], null, null, msg); - // } else { - // } - } - }; - - ctrl.getBase64 = function (file) { - if (file !== null) { - $rootScope.isBusy = true; - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { - ctrl.cropped.source = null; - var index = reader.result.indexOf(",") + 1; - var base64 = reader.result.substring(index); - if (ctrl.postedFile) { - ctrl.postedFile.fileName = file.name.substring( - 0, - file.name.lastIndexOf(".") - ); - ctrl.postedFile.extension = file.name.substring( - file.name.lastIndexOf(".") - ); - // ctrl.postedFile.fileStream = reader.result; - } - var image = new Image(); - image.src = reader.result; - - image.onload = function () { - // access image size here - ctrl.loadImageSize(this.width, this.height); - }; - - ctrl.cropped.source = reader.result; - $rootScope.isBusy = false; - $scope.$apply(); - }; - reader.onerror = function (error) { - $rootScope.isBusy = false; - $rootScope.showErrors([error]); - }; - } else { - return null; - } - }; - ctrl.loadImageSize = function (w, h) { - var rto = w / h; - // ctrl.options.boundary.width = ctrl.options.boundary.height * rto; - ctrl.options.render.width = ctrl.options.render.height * rto; - if (!ctrl.rto) { - ctrl.rto = rto; - ctrl.w = w; - ctrl.h = h; - ctrl.loadViewport(); - } - $scope.$apply(); - ctrl.image_placeholder = `https://via.placeholder.com/${ctrl.options.render.width}x${ctrl.options.render.height}.png`; - }; - ctrl.loadViewport = function () { - if (ctrl.w && ctrl.h) { - ctrl.rto = ctrl.w / ctrl.h; - ctrl.options.viewport.height = ctrl.h; - ctrl.options.viewport.width = ctrl.options.viewport.height * ctrl.rto; - } - // ctrl.image_placeholder = "/mix-app/assets/img/image_placeholder.jpg"; // `https://via.placeholder.com/${ctrl.options.render.width}x${ctrl.options.render.height}.png`; - }; - }, - ], -}); - -'use strict'; -app.controller('VideoCallController', ['$scope', function ($scope) { - BaseHub.call(this, $scope); - $scope.user = { - loggedIn: false, - info: {} - }; - $scope.isHide = true; - $scope.hideContact = true; - $scope.members = []; - $scope.messages = []; - $scope.message = { connection: {}, content: '' }; - $scope.request = { - uid: '', - objectType: null, - action: '', - data: {}, - room: '', - isMyself: false - }; - $scope.loadMsgButton = function () { - - } - $scope.init = function () { - $scope.startConnection('MixChatHub', $scope.checkLoginStatus); - - $("button").on("click", function () { - var text = $("#message").val(); - var hnow = new Date().getHours(); - var mnow = new Date().getMinutes(); - mnow = mnow < 10 ? "0" + mnow : mnow; - var d = hnow + ":" + mnow; - - if (text.length > 0) { - $("#message").css("border", "1px solid #f4f5f9"); - $("#conversation").append( - "
  • You
    " + - text + - "
    " + - d + - "
  • " - ); - $("#message").val(""); - $(".widget-conversation").scrollTop( - $("ul li") - .last() - .position().top + - $("ul li") - .last() - .height() - ); - } else { - $("#message").css("border", "1px solid #eb9f9f"); - $("#message").animate({ opacity: "0.1" }, "slow"); - $("#message").animate({ opacity: "1" }, "slow"); - $("#message").animate({ opacity: "0.1" }, "slow"); - $("#message").animate({ opacity: "1" }, "slow"); - } - }); - - - - // var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var HoverButton = function () { - // function HoverButton(el) {_classCallCheck(this, HoverButton); - // this.el = el; - // this.hover = false; - // this.calculatePosition(); - // this.attachEventsListener(); - // }_createClass(HoverButton, [{ key: 'attachEventsListener', value: function attachEventsListener() - - // {var _this = this; - // window.addEventListener('mousemove', function (e) {return _this.onMouseMove(e);}); - // window.addEventListener('resize', function (e) {return _this.calculatePosition(e);}); - // } }, { key: 'calculatePosition', value: function calculatePosition() - - // { - - - // var box = this.el.getBoundingClientRect(); - // this.x = box.left + box.width * 0.5; - // this.y = box.top + box.height * 0.5; - // this.width = box.width; - // this.height = box.height; - // } }, { key: 'onMouseMove', value: function onMouseMove( - - // e) { - // var hover = false; - // var hoverArea = this.hover ? 0.7 : 0.5; - // var x = e.clientX - this.x; - // var y = e.clientY - this.y; - // var distance = Math.sqrt(x * x + y * y); - // if (distance < this.width * hoverArea) { - // hover = true; - // if (!this.hover) { - // this.hover = true; - // } - // this.onHover(e.clientX, e.clientY); - // } - - // if (!hover && this.hover) { - // this.onLeave(); - // this.hover = false; - // } - // } }, { key: 'onHover', value: function onHover( - - // x, y) { - // TweenMax.to(this.el, 0.4, { - // x: (x - this.x) * 0.4, - // y: (y - this.y) * 0.4, - // scale: 1.15, - // ease: Power2.easeOut }); - - // this.el.style.zIndex = 10; - // } }, { key: 'onLeave', value: function onLeave() - // { - // TweenMax.to(this.el, 0.7, { - // x: 0, - // y: 0, - // scale: 1, - // ease: Elastic.easeOut.config(1.2, 0.4) }); - - // this.el.style.zIndex = 1; - // } }]);return HoverButton;}(); - - - // var btn1 = document.querySelector('#quest'); - // new HoverButton(btn1); - }; - $scope.logout = function () { - FB.logout(function (response) { - // user is now logged out - $scope.user.loggedIn = false; - }); - }; - $scope.login = function () { - FB.login(function (response) { - if (response.authResponse) { - FB.api('/me', function (response) { - - $scope.user.info.name = response.name; - $scope.user.info.id = response.id; - $scope.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - $scope.join(); - $scope.$apply(); - }); - } else { - console.log('User cancelled login or did not fully authorize.'); - } - }); - }; - $scope.join = function () { - $scope.request.uid = $scope.user.info.id; - $scope.request.data = $scope.user.info; - $scope.message.connection = $scope.user.info; - $scope.connection.invoke('join', $scope.request); - - }; - $scope.toggle = function () { - $scope.isHide = !$scope.isHide; - } - $scope.toggleContact = function () { - $scope.hideContact = !$scope.hideContact; - } - $scope.sendMessage = function () { - if ($scope.user.loggedIn) { - $scope.request.data = $scope.message; - $scope.connection.invoke('sendMessage', $scope.request); - $scope.message.content = ''; - } - }; - $scope.receiveMessage = function (msg) { - //$scope.responses.splice(0, 0, msg); - switch (msg.responseKey) { - case 'NewMember': - $scope.newMember(msg.data); - $('.widget-conversation').scrollTop = $('.widget-conversation')[0].scrollHeight; - break; - - case 'NewMessage': - $scope.newMessage(msg.data); - break; - case 'ConnectSuccess': - $scope.user.loggedIn = true; - $scope.initList(msg.data); - $scope.$apply(); - break; - - case 'MemberOffline': - $scope.removeMember(msg.data); - break; - - } - - }; - $scope.checkLoginStatus = function () { - FB.getLoginStatus(function (response) { - if (response.status === 'connected') { - // The user is logged in and has authenticated your - // app, and response.authResponse supplies - // the user's ID, a valid access token, a signed - // request, and the time the access token - // and signed request each expire. - FB.api('/me', function (response) { - $scope.user.info.name = response.name; - $scope.user.info.id = response.id; - $scope.user.info.avatar = '//graph.facebook.com/' + response.id + '/picture?width=32&height=32'; - $scope.join(); - $scope.$apply(); - }); - } else if (response.status === 'authorization_expired') { - // The user has signed into your application with - // Facebook Login but must go through the login flow - // again to renew data authorization. You might remind - // the user they've used Facebook, or hide other options - // to avoid duplicate account creation, but you should - // collect a user gesture (e.g. click/touch) to launch the - // login dialog so popup blocking is not triggered. - } else if (response.status === 'not_authorized') { - // The user hasn't authorized your application. They - // must click the Login button, or you must call FB.login - // in response to a user gesture, to launch a login dialog. - } else { - // The user isn't logged in to Facebook. You can launch a - // login dialog with a user gesture, but the user may have - // to log in to Facebook before authorizing your application. - } - }); - }; - $scope.newMember = function (member) { - - var index = $scope.members.findIndex(x => x.id === member.id); - if (index < 0) { - $scope.members.splice(0, 0, member); - } - $scope.$apply(); - } - - $scope.initList = function (data) { - data.forEach(member => { - var index = $scope.members.findIndex(x => x.id === member.id); - if (index < 0) { - $scope.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - } - - $scope.removeMember = function (memberId) { - - var index = $scope.members.findIndex(x => x.id === memberId); - if (index >= 0) { - $scope.members.splice(index, 1); - } - $scope.$apply(); - } - - $scope.newMessage = function (msg) { - $scope.messages.push(msg); - $scope.$apply(); - var objDiv = document.getElementsByClassName("widget-conversation")[0]; - objDiv.scrollTop = objDiv.scrollHeight + 20; - } - - -}]); - - -modules.component('videoCall', { - templateUrl: '/mix-app/views/app-shared/components/video-call/index.html', - controller: [ - function () { - var ctrl = this; - ctrl.constraints = { - audio: { - - }, - video: { - - } - }; - ctrl.isPlayed = false; - ctrl.videoElement = document.querySelector('video'); - ctrl.audioSelect = document.querySelector('select#audioSource'); - ctrl.videoSelect = document.querySelector('select#videoSource'); - ctrl.init = function () { - navigator.mediaDevices.enumerateDevices() - .then(ctrl.gotDevices).then(ctrl.getStream).catch(ctrl.handleError); - }; - ctrl.gotDevices = function (deviceInfos) { - for (let i = 0; i !== deviceInfos.length; ++i) { - const deviceInfo = deviceInfos[i]; - const option = document.createElement('option'); - option.value = deviceInfo.deviceId; - if (deviceInfo.kind === 'audioinput') { - option.text = deviceInfo.label || - 'microphone ' + (ctrl.audioSelect.length + 1); - ctrl.audioSelect.appendChild(option); - } else if (deviceInfo.kind === 'videoinput') { - option.text = deviceInfo.label || 'camera ' + - (ctrl.videoSelect.length + 1); - ctrl.videoSelect.appendChild(option); - } else { - console.log('Found another kind of device: ', deviceInfo); - } - } - }; - ctrl.getStream = function () { - if (window.stream) { - window.stream.getTracks().forEach(function (track) { - track.stop(); - }); - } - ctrl.constraints.audio.deviceId = { exact: ctrl.audioSelect.value }; - ctrl.constraints.video.deviceId = { exact: ctrl.videoSelect.value }; - navigator.mediaDevices.getUserMedia(ctrl.constraints). - then(ctrl.gotStream).catch(ctrl.handleError); - }; - ctrl.gotStream = function (stream) { - window.stream = stream; // make stream available to console - ctrl.videoElement.srcObject = stream; - }; - - ctrl.handleError = function (error) { - console.error('Error: ', error); - }; - ctrl.play = function () { - ctrl.video.play(); - ctrl.isPlayed = true; - }; - ctrl.stop = function () { - ctrl.video.stop(); - ctrl.isPlayed = false; - }; - }], - bindings: { - message: '=' - } -}); -modules.component('youtubeEditor', { - templateUrl: '/mix-app/views/app-shared/components/youtube-editor/youtube-editor.html', - controller: ['$rootScope', '$scope', '$sce', - function ($rootScope, $scope, $sce) { - var ctrl = this; - ctrl.isPlay = false; - ctrl.loadVideo = function () { - ctrl.isPlay = false; - ctrl.src = ''; - if (ctrl.code) { - ctrl.img = "https://img.youtube.com/vi/" + ctrl.code + "/sddefault.jpg"; - } - }; - ctrl.playVideo = function () { - ctrl.isPlay = true; - ctrl.src = $sce.trustAsResourceUrl("https://www.youtube.com/embed/" + ctrl.code + "?rel=0&showinfo=0&autoplay=1"); - }; - ctrl.searchVideo = function () { - // search - $rootScope.preview( - 'message', - 'ToDo: Integrate youtube search (https://developers.google.com/youtube/v3/docs/search/list) \r\n PATH: portal-app/app/app-shared/components/youtube-editor/youtube-editor.js' - ); - }; - } - ], - bindings: { - code: '=', - hideInput: '=?' - } -}); -app.controller("MixDatabaseFormController", [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestRelatedAttributeDataPortalService", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, navService, dataService) { - $scope.defaultData = null; - $scope.formData = null; - $scope.formRecords = null; - $scope.formName = null; - $scope.navRequest = angular.copy(ngAppSettings.request); - $scope.successMsg = "Thành công"; - $scope.init = async function ( - formName, - parentId, - parentType, - validateHandler, - loadingHandler, - successHandler, - failHandler - ) { - $scope.successMsg = "Thành công"; - $scope.validateHandler = validateHandler; - $scope.loadingHandler = loadingHandler; - $scope.successHandler = successHandler; - $scope.failHandler = failHandler; - $scope.formName = formName; - $scope.navRequest.mixDatabaseName = formName; - $scope.navRequest.parentType = parentType; - $scope.navRequest.parentId = parentId; - dataService.init("mix-database-data/portal"); - var getDefault = await dataService.initData($scope.formName); - $scope.defaultData = getDefault.data; - if ($scope.defaultData) { - $scope.defaultData.mixDatabaseName = $scope.formName; - $scope.defaultData.parentType = parentType || "Set"; - $scope.defaultData.parentId = parentId; - $scope.formData = angular.copy($scope.defaultData); - } - - $scope.$apply(); - }; - $scope.loadData = function () { - navService.getList($scope.navRequest).then((resp) => { - if (resp) { - $scope.formRecords = resp.data; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors("Failed"); - } - $scope.$apply(); - } - }); - }; - $scope.submit = async (data) => { - $rootScope.isBusy = true; - if ($scope.loadingHandler) { - $rootScope.executeFunctionByName($scope.loadingHandler, [true]); - } - if ( - !$scope.validateHandler || - $rootScope.executeFunctionByName($scope.validateHandler, [data]) - ) { - var saveResult = await dataService.save(data); - if (saveResult.isSucceed) { - if ($scope.successHandler) { - $rootScope.executeFunctionByName($scope.successHandler, [ - saveResult, - ]); - } else { - alert($scope.successMsg); - } - $scope.formData = angular.copy($scope.defaultData); - $rootScope.isBusy = false; - $scope.loadData(); - if ($scope.loadingHandler) { - $rootScope.executeFunctionByName($scope.loadingHandler, [false]); - } - $scope.$apply(); - } else { - if (saveResult.errors && saveResult.errors.length) { - if ($scope.failHandler) { - $rootScope.executeFunctionByName($scope.failHandler, [ - data, - saveResult, - ]); - } else { - alert(errMsg); - } - } - if ($scope.loadingHandler) { - $rootScope.executeFunctionByName($scope.loadingHandler, [false]); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - }, -]); - -"use strict"; -app.controller("MvcModuleDataController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "RestMvcModuleDataService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.orderBy = "Priority"; - $scope.request.direction = "Asc"; - $scope.settings = $rootScope.globalSettings; - $scope.moduleId = null; - $scope.module = null; - $scope.allData = []; - $scope.editDataUrl = null; - $scope.canLoadMore = false; - $scope.init = async function (moduleId, pageSize) { - $scope.moduleId = moduleId; - $scope.request.module_id = $scope.moduleId; - $scope.request.pageSize = pageSize || $scope.request.pageSize; - $scope.loadMore(0); - }; - - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var resp = await service.getSingle($scope.id, "mvc"); - if (resp && resp.isSucceed) { - $scope.activedModuleData = resp.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.activeItem = function (arr, item) { - angular.forEach(arr, function (e) { - if (e.id != item.id) { - e.expanded = false; - } else { - e.expanded = !e.expanded; - } - }); - }; - $scope.loadMore = async function (pageIndex) { - $scope.request.pageIndex = pageIndex || $scope.request.pageIndex + 1; - $rootScope.isBusy = true; - var response = await service.getList($scope.request); - if (response.isSucceed) { - $scope.allData = $scope.allData.concat(response.data.items); - $rootScope.isBusy = false; - $scope.canLoadMore = response.data.totalItems > $scope.allData.length; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -"use strict"; -app.controller("MvcPostController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "BaseService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - baseService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.service = null; - $scope.request.orderBy = "Priority"; - $scope.request.direction = "Asc"; - $scope.settings = $rootScope.globalSettings; - $scope.moduleId = null; - $scope.module = null; - $scope.allData = []; - $scope.editDataUrl = null; - $scope.canLoadMore = false; - $scope.init = async function (type, parentId, pageSize) { - $scope.parentId = parentId; // page / post - $scope.service = Object.create(baseService); - if (type.toLowerCase() === "page") { - $scope.service.init("page-post/mvc"); - } else if (type.toLowerCase() === "page") { - $scope.service.init("module-post/mvc"); - } - - $scope.request.module_id = $scope.moduleId; - $scope.request.pageSize = pageSize || $scope.request.pageSize; - $scope.loadMore(0); - }; - - $scope.loadMore = async function (pageIndex) { - $scope.request.pageIndex = pageIndex || $scope.request.pageIndex + 1; - $rootScope.isBusy = true; - var response = await service.getList($scope.request); - if (response.isSucceed) { - $scope.allData = $scope.allData.concat(response.data.items); - $rootScope.isBusy = false; - $scope.canLoadMore = - response.data.totalItems > - response.data.page * response.data.pageSize; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -/* -CryptoJS v3.1.2 -code.google.com/p/crypto-js -(c) 2009-2013 by Jeff Mott. All rights reserved. -code.google.com/p/crypto-js/wiki/License -*/ -var CryptoJS = CryptoJS || function (u, p) { - var d = {}, l = d.lib = {}, s = function () { }, t = l.Base = { extend: function (a) { s.prototype = this; var c = new s; a && c.mixIn(a); c.hasOwnProperty("init") || (c.init = function () { c.$super.init.apply(this, arguments) }); c.init.prototype = c; c.$super = this; return c }, create: function () { var a = this.extend(); a.init.apply(a, arguments); return a }, init: function () { }, mixIn: function (a) { for (var c in a) a.hasOwnProperty(c) && (this[c] = a[c]); a.hasOwnProperty("toString") && (this.toString = a.toString) }, clone: function () { return this.init.prototype.extend(this) } }, - r = l.WordArray = t.extend({ - init: function (a, c) { a = this.words = a || []; this.sigBytes = c != p ? c : 4 * a.length }, toString: function (a) { return (a || v).stringify(this) }, concat: function (a) { var c = this.words, e = a.words, j = this.sigBytes; a = a.sigBytes; this.clamp(); if (j % 4) for (var k = 0; k < a; k++)c[j + k >>> 2] |= (e[k >>> 2] >>> 24 - 8 * (k % 4) & 255) << 24 - 8 * ((j + k) % 4); else if (65535 < e.length) for (k = 0; k < a; k += 4)c[j + k >>> 2] = e[k >>> 2]; else c.push.apply(c, e); this.sigBytes += a; return this }, clamp: function () { - var a = this.words, c = this.sigBytes; a[c >>> 2] &= 4294967295 << - 32 - 8 * (c % 4); a.length = u.ceil(c / 4) - }, clone: function () { var a = t.clone.call(this); a.words = this.words.slice(0); return a }, random: function (a) { for (var c = [], e = 0; e < a; e += 4)c.push(4294967296 * u.random() | 0); return new r.init(c, a) } - }), w = d.enc = {}, v = w.Hex = { - stringify: function (a) { var c = a.words; a = a.sigBytes; for (var e = [], j = 0; j < a; j++) { var k = c[j >>> 2] >>> 24 - 8 * (j % 4) & 255; e.push((k >>> 4).toString(16)); e.push((k & 15).toString(16)) } return e.join("") }, parse: function (a) { - for (var c = a.length, e = [], j = 0; j < c; j += 2)e[j >>> 3] |= parseInt(a.substr(j, - 2), 16) << 24 - 4 * (j % 8); return new r.init(e, c / 2) - } - }, b = w.Latin1 = { stringify: function (a) { var c = a.words; a = a.sigBytes; for (var e = [], j = 0; j < a; j++)e.push(String.fromCharCode(c[j >>> 2] >>> 24 - 8 * (j % 4) & 255)); return e.join("") }, parse: function (a) { for (var c = a.length, e = [], j = 0; j < c; j++)e[j >>> 2] |= (a.charCodeAt(j) & 255) << 24 - 8 * (j % 4); return new r.init(e, c) } }, x = w.Utf8 = { stringify: function (a) { try { return decodeURIComponent(escape(b.stringify(a))) } catch (c) { throw Error("Malformed UTF-8 data"); } }, parse: function (a) { return b.parse(unescape(encodeURIComponent(a))) } }, - q = l.BufferedBlockAlgorithm = t.extend({ - reset: function () { this._data = new r.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = x.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var c = this._data, e = c.words, j = c.sigBytes, k = this.blockSize, b = j / (4 * k), b = a ? u.ceil(b) : u.max((b | 0) - this._minBufferSize, 0); a = b * k; j = u.min(4 * a, j); if (a) { for (var q = 0; q < a; q += k)this._doProcessBlock(e, q); q = e.splice(0, a); c.sigBytes -= j } return new r.init(q, j) }, clone: function () { - var a = t.clone.call(this); - a._data = this._data.clone(); return a - }, _minBufferSize: 0 - }); l.Hasher = q.extend({ - cfg: t.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { q.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (b, e) { return (new a.init(e)).finalize(b) } }, _createHmacHelper: function (a) { - return function (b, e) { - return (new n.HMAC.init(a, - e)).finalize(b) - } - } - }); var n = d.algo = {}; return d -}(Math); -(function () { - var u = CryptoJS, p = u.lib.WordArray; u.enc.Base64 = { - stringify: function (d) { var l = d.words, p = d.sigBytes, t = this._map; d.clamp(); d = []; for (var r = 0; r < p; r += 3)for (var w = (l[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (l[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | l[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, v = 0; 4 > v && r + 0.75 * v < p; v++)d.push(t.charAt(w >>> 6 * (3 - v) & 63)); if (l = t.charAt(64)) for (; d.length % 4;)d.push(l); return d.join("") }, parse: function (d) { - var l = d.length, s = this._map, t = s.charAt(64); t && (t = d.indexOf(t), -1 != t && (l = t)); for (var t = [], r = 0, w = 0; w < - l; w++)if (w % 4) { var v = s.indexOf(d.charAt(w - 1)) << 2 * (w % 4), b = s.indexOf(d.charAt(w)) >>> 6 - 2 * (w % 4); t[r >>> 2] |= (v | b) << 24 - 8 * (r % 4); r++ } return p.create(t, r) - }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" - } -})(); -(function (u) { - function p(b, n, a, c, e, j, k) { b = b + (n & a | ~n & c) + e + k; return (b << j | b >>> 32 - j) + n } function d(b, n, a, c, e, j, k) { b = b + (n & c | a & ~c) + e + k; return (b << j | b >>> 32 - j) + n } function l(b, n, a, c, e, j, k) { b = b + (n ^ a ^ c) + e + k; return (b << j | b >>> 32 - j) + n } function s(b, n, a, c, e, j, k) { b = b + (a ^ (n | ~c)) + e + k; return (b << j | b >>> 32 - j) + n } for (var t = CryptoJS, r = t.lib, w = r.WordArray, v = r.Hasher, r = t.algo, b = [], x = 0; 64 > x; x++)b[x] = 4294967296 * u.abs(u.sin(x + 1)) | 0; r = r.MD5 = v.extend({ - _doReset: function () { this._hash = new w.init([1732584193, 4023233417, 2562383102, 271733878]) }, - _doProcessBlock: function (q, n) { - for (var a = 0; 16 > a; a++) { var c = n + a, e = q[c]; q[c] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360 } var a = this._hash.words, c = q[n + 0], e = q[n + 1], j = q[n + 2], k = q[n + 3], z = q[n + 4], r = q[n + 5], t = q[n + 6], w = q[n + 7], v = q[n + 8], A = q[n + 9], B = q[n + 10], C = q[n + 11], u = q[n + 12], D = q[n + 13], E = q[n + 14], x = q[n + 15], f = a[0], m = a[1], g = a[2], h = a[3], f = p(f, m, g, h, c, 7, b[0]), h = p(h, f, m, g, e, 12, b[1]), g = p(g, h, f, m, j, 17, b[2]), m = p(m, g, h, f, k, 22, b[3]), f = p(f, m, g, h, z, 7, b[4]), h = p(h, f, m, g, r, 12, b[5]), g = p(g, h, f, m, t, 17, b[6]), m = p(m, g, h, f, w, 22, b[7]), - f = p(f, m, g, h, v, 7, b[8]), h = p(h, f, m, g, A, 12, b[9]), g = p(g, h, f, m, B, 17, b[10]), m = p(m, g, h, f, C, 22, b[11]), f = p(f, m, g, h, u, 7, b[12]), h = p(h, f, m, g, D, 12, b[13]), g = p(g, h, f, m, E, 17, b[14]), m = p(m, g, h, f, x, 22, b[15]), f = d(f, m, g, h, e, 5, b[16]), h = d(h, f, m, g, t, 9, b[17]), g = d(g, h, f, m, C, 14, b[18]), m = d(m, g, h, f, c, 20, b[19]), f = d(f, m, g, h, r, 5, b[20]), h = d(h, f, m, g, B, 9, b[21]), g = d(g, h, f, m, x, 14, b[22]), m = d(m, g, h, f, z, 20, b[23]), f = d(f, m, g, h, A, 5, b[24]), h = d(h, f, m, g, E, 9, b[25]), g = d(g, h, f, m, k, 14, b[26]), m = d(m, g, h, f, v, 20, b[27]), f = d(f, m, g, h, D, 5, b[28]), h = d(h, f, - m, g, j, 9, b[29]), g = d(g, h, f, m, w, 14, b[30]), m = d(m, g, h, f, u, 20, b[31]), f = l(f, m, g, h, r, 4, b[32]), h = l(h, f, m, g, v, 11, b[33]), g = l(g, h, f, m, C, 16, b[34]), m = l(m, g, h, f, E, 23, b[35]), f = l(f, m, g, h, e, 4, b[36]), h = l(h, f, m, g, z, 11, b[37]), g = l(g, h, f, m, w, 16, b[38]), m = l(m, g, h, f, B, 23, b[39]), f = l(f, m, g, h, D, 4, b[40]), h = l(h, f, m, g, c, 11, b[41]), g = l(g, h, f, m, k, 16, b[42]), m = l(m, g, h, f, t, 23, b[43]), f = l(f, m, g, h, A, 4, b[44]), h = l(h, f, m, g, u, 11, b[45]), g = l(g, h, f, m, x, 16, b[46]), m = l(m, g, h, f, j, 23, b[47]), f = s(f, m, g, h, c, 6, b[48]), h = s(h, f, m, g, w, 10, b[49]), g = s(g, h, f, m, - E, 15, b[50]), m = s(m, g, h, f, r, 21, b[51]), f = s(f, m, g, h, u, 6, b[52]), h = s(h, f, m, g, k, 10, b[53]), g = s(g, h, f, m, B, 15, b[54]), m = s(m, g, h, f, e, 21, b[55]), f = s(f, m, g, h, v, 6, b[56]), h = s(h, f, m, g, x, 10, b[57]), g = s(g, h, f, m, t, 15, b[58]), m = s(m, g, h, f, D, 21, b[59]), f = s(f, m, g, h, z, 6, b[60]), h = s(h, f, m, g, C, 10, b[61]), g = s(g, h, f, m, j, 15, b[62]), m = s(m, g, h, f, A, 21, b[63]); a[0] = a[0] + f | 0; a[1] = a[1] + m | 0; a[2] = a[2] + g | 0; a[3] = a[3] + h | 0 - }, _doFinalize: function () { - var b = this._data, n = b.words, a = 8 * this._nDataBytes, c = 8 * b.sigBytes; n[c >>> 5] |= 128 << 24 - c % 32; var e = u.floor(a / - 4294967296); n[(c + 64 >>> 9 << 4) + 15] = (e << 8 | e >>> 24) & 16711935 | (e << 24 | e >>> 8) & 4278255360; n[(c + 64 >>> 9 << 4) + 14] = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360; b.sigBytes = 4 * (n.length + 1); this._process(); b = this._hash; n = b.words; for (a = 0; 4 > a; a++)c = n[a], n[a] = (c << 8 | c >>> 24) & 16711935 | (c << 24 | c >>> 8) & 4278255360; return b - }, clone: function () { var b = v.clone.call(this); b._hash = this._hash.clone(); return b } - }); t.MD5 = v._createHelper(r); t.HmacMD5 = v._createHmacHelper(r) -})(Math); -(function () { - var u = CryptoJS, p = u.lib, d = p.Base, l = p.WordArray, p = u.algo, s = p.EvpKDF = d.extend({ cfg: d.extend({ keySize: 4, hasher: p.MD5, iterations: 1 }), init: function (d) { this.cfg = this.cfg.extend(d) }, compute: function (d, r) { for (var p = this.cfg, s = p.hasher.create(), b = l.create(), u = b.words, q = p.keySize, p = p.iterations; u.length < q;) { n && s.update(n); var n = s.update(d).finalize(r); s.reset(); for (var a = 1; a < p; a++)n = s.finalize(n), s.reset(); b.concat(n) } b.sigBytes = 4 * q; return b } }); u.EvpKDF = function (d, l, p) { - return s.create(p).compute(d, - l) - } -})(); -CryptoJS.lib.Cipher || function (u) { - var p = CryptoJS, d = p.lib, l = d.Base, s = d.WordArray, t = d.BufferedBlockAlgorithm, r = p.enc.Base64, w = p.algo.EvpKDF, v = d.Cipher = t.extend({ - cfg: l.extend(), createEncryptor: function (e, a) { return this.create(this._ENC_XFORM_MODE, e, a) }, createDecryptor: function (e, a) { return this.create(this._DEC_XFORM_MODE, e, a) }, init: function (e, a, b) { this.cfg = this.cfg.extend(b); this._xformMode = e; this._key = a; this.reset() }, reset: function () { t.reset.call(this); this._doReset() }, process: function (e) { this._append(e); return this._process() }, - finalize: function (e) { e && this._append(e); return this._doFinalize() }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function (e) { return { encrypt: function (b, k, d) { return ("string" == typeof k ? c : a).encrypt(e, b, k, d) }, decrypt: function (b, k, d) { return ("string" == typeof k ? c : a).decrypt(e, b, k, d) } } } - }); d.StreamCipher = v.extend({ _doFinalize: function () { return this._process(!0) }, blockSize: 1 }); var b = p.mode = {}, x = function (e, a, b) { - var c = this._iv; c ? this._iv = u : c = this._prevBlock; for (var d = 0; d < b; d++)e[a + d] ^= - c[d] - }, q = (d.BlockCipherMode = l.extend({ createEncryptor: function (e, a) { return this.Encryptor.create(e, a) }, createDecryptor: function (e, a) { return this.Decryptor.create(e, a) }, init: function (e, a) { this._cipher = e; this._iv = a } })).extend(); q.Encryptor = q.extend({ processBlock: function (e, a) { var b = this._cipher, c = b.blockSize; x.call(this, e, a, c); b.encryptBlock(e, a); this._prevBlock = e.slice(a, a + c) } }); q.Decryptor = q.extend({ - processBlock: function (e, a) { - var b = this._cipher, c = b.blockSize, d = e.slice(a, a + c); b.decryptBlock(e, a); x.call(this, - e, a, c); this._prevBlock = d - } - }); b = b.CBC = q; q = (p.pad = {}).Pkcs7 = { pad: function (a, b) { for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, l = [], n = 0; n < c; n += 4)l.push(d); c = s.create(l, c); a.concat(c) }, unpad: function (a) { a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255 } }; d.BlockCipher = v.extend({ - cfg: v.cfg.extend({ mode: b, padding: q }), reset: function () { - v.reset.call(this); var a = this.cfg, b = a.iv, a = a.mode; if (this._xformMode == this._ENC_XFORM_MODE) var c = a.createEncryptor; else c = a.createDecryptor, this._minBufferSize = 1; this._mode = c.call(a, - this, b && b.words) - }, _doProcessBlock: function (a, b) { this._mode.processBlock(a, b) }, _doFinalize: function () { var a = this.cfg.padding; if (this._xformMode == this._ENC_XFORM_MODE) { a.pad(this._data, this.blockSize); var b = this._process(!0) } else b = this._process(!0), a.unpad(b); return b }, blockSize: 4 - }); var n = d.CipherParams = l.extend({ init: function (a) { this.mixIn(a) }, toString: function (a) { return (a || this.formatter).stringify(this) } }), b = (p.format = {}).OpenSSL = { - stringify: function (a) { - var b = a.ciphertext; a = a.salt; return (a ? s.create([1398893684, - 1701076831]).concat(a).concat(b) : b).toString(r) - }, parse: function (a) { a = r.parse(a); var b = a.words; if (1398893684 == b[0] && 1701076831 == b[1]) { var c = s.create(b.slice(2, 4)); b.splice(0, 4); a.sigBytes -= 16 } return n.create({ ciphertext: a, salt: c }) } - }, a = d.SerializableCipher = l.extend({ - cfg: l.extend({ format: b }), encrypt: function (a, b, c, d) { d = this.cfg.extend(d); var l = a.createEncryptor(c, d); b = l.finalize(b); l = l.cfg; return n.create({ ciphertext: b, key: c, iv: l.iv, algorithm: a, mode: l.mode, padding: l.padding, blockSize: a.blockSize, formatter: d.format }) }, - decrypt: function (a, b, c, d) { d = this.cfg.extend(d); b = this._parse(b, d.format); return a.createDecryptor(c, d).finalize(b.ciphertext) }, _parse: function (a, b) { return "string" == typeof a ? b.parse(a, this) : a } - }), p = (p.kdf = {}).OpenSSL = { execute: function (a, b, c, d) { d || (d = s.random(8)); a = w.create({ keySize: b + c }).compute(a, d); c = s.create(a.words.slice(b), 4 * c); a.sigBytes = 4 * b; return n.create({ key: a, iv: c, salt: d }) } }, c = d.PasswordBasedCipher = a.extend({ - cfg: a.cfg.extend({ kdf: p }), encrypt: function (b, c, d, l) { - l = this.cfg.extend(l); d = l.kdf.execute(d, - b.keySize, b.ivSize); l.iv = d.iv; b = a.encrypt.call(this, b, c, d.key, l); b.mixIn(d); return b - }, decrypt: function (b, c, d, l) { l = this.cfg.extend(l); c = this._parse(c, l.format); d = l.kdf.execute(d, b.keySize, b.ivSize, c.salt); l.iv = d.iv; return a.decrypt.call(this, b, c, d.key, l) } - }) -}(); -(function () { - for (var u = CryptoJS, p = u.lib.BlockCipher, d = u.algo, l = [], s = [], t = [], r = [], w = [], v = [], b = [], x = [], q = [], n = [], a = [], c = 0; 256 > c; c++)a[c] = 128 > c ? c << 1 : c << 1 ^ 283; for (var e = 0, j = 0, c = 0; 256 > c; c++) { var k = j ^ j << 1 ^ j << 2 ^ j << 3 ^ j << 4, k = k >>> 8 ^ k & 255 ^ 99; l[e] = k; s[k] = e; var z = a[e], F = a[z], G = a[F], y = 257 * a[k] ^ 16843008 * k; t[e] = y << 24 | y >>> 8; r[e] = y << 16 | y >>> 16; w[e] = y << 8 | y >>> 24; v[e] = y; y = 16843009 * G ^ 65537 * F ^ 257 * z ^ 16843008 * e; b[k] = y << 24 | y >>> 8; x[k] = y << 16 | y >>> 16; q[k] = y << 8 | y >>> 24; n[k] = y; e ? (e = z ^ a[a[a[G ^ z]]], j ^= a[a[j]]) : e = j = 1 } var H = [0, 1, 2, 4, 8, - 16, 32, 64, 128, 27, 54], d = d.AES = p.extend({ - _doReset: function () { - for (var a = this._key, c = a.words, d = a.sigBytes / 4, a = 4 * ((this._nRounds = d + 6) + 1), e = this._keySchedule = [], j = 0; j < a; j++)if (j < d) e[j] = c[j]; else { var k = e[j - 1]; j % d ? 6 < d && 4 == j % d && (k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255]) : (k = k << 8 | k >>> 24, k = l[k >>> 24] << 24 | l[k >>> 16 & 255] << 16 | l[k >>> 8 & 255] << 8 | l[k & 255], k ^= H[j / d | 0] << 24); e[j] = e[j - d] ^ k } c = this._invKeySchedule = []; for (d = 0; d < a; d++)j = a - d, k = d % 4 ? e[j] : e[j - 4], c[d] = 4 > d || 4 >= j ? k : b[l[k >>> 24]] ^ x[l[k >>> 16 & 255]] ^ q[l[k >>> - 8 & 255]] ^ n[l[k & 255]] - }, encryptBlock: function (a, b) { this._doCryptBlock(a, b, this._keySchedule, t, r, w, v, l) }, decryptBlock: function (a, c) { var d = a[c + 1]; a[c + 1] = a[c + 3]; a[c + 3] = d; this._doCryptBlock(a, c, this._invKeySchedule, b, x, q, n, s); d = a[c + 1]; a[c + 1] = a[c + 3]; a[c + 3] = d }, _doCryptBlock: function (a, b, c, d, e, j, l, f) { - for (var m = this._nRounds, g = a[b] ^ c[0], h = a[b + 1] ^ c[1], k = a[b + 2] ^ c[2], n = a[b + 3] ^ c[3], p = 4, r = 1; r < m; r++)var q = d[g >>> 24] ^ e[h >>> 16 & 255] ^ j[k >>> 8 & 255] ^ l[n & 255] ^ c[p++], s = d[h >>> 24] ^ e[k >>> 16 & 255] ^ j[n >>> 8 & 255] ^ l[g & 255] ^ c[p++], t = - d[k >>> 24] ^ e[n >>> 16 & 255] ^ j[g >>> 8 & 255] ^ l[h & 255] ^ c[p++], n = d[n >>> 24] ^ e[g >>> 16 & 255] ^ j[h >>> 8 & 255] ^ l[k & 255] ^ c[p++], g = q, h = s, k = t; q = (f[g >>> 24] << 24 | f[h >>> 16 & 255] << 16 | f[k >>> 8 & 255] << 8 | f[n & 255]) ^ c[p++]; s = (f[h >>> 24] << 24 | f[k >>> 16 & 255] << 16 | f[n >>> 8 & 255] << 8 | f[g & 255]) ^ c[p++]; t = (f[k >>> 24] << 24 | f[n >>> 16 & 255] << 16 | f[g >>> 8 & 255] << 8 | f[h & 255]) ^ c[p++]; n = (f[n >>> 24] << 24 | f[g >>> 16 & 255] << 16 | f[h >>> 8 & 255] << 8 | f[k & 255]) ^ c[p++]; a[b] = q; a[b + 1] = s; a[b + 2] = t; a[b + 3] = n - }, keySize: 8 - }); u.AES = p._createHelper(d) -})(); -; (function (root, factory) { - if (typeof exports === "object") { - // CommonJS - module.exports = exports = factory(); - } - else if (typeof define === "function" && define.amd) { - // AMD - define([], factory); - } - else { - // Global (browser) - root.CryptoJS = factory(); - } -}(this, function () { - - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined) { - /* - * Local polyfil of Object.create - */ - var create = Object.create || (function () { - function F() { }; - - return function (obj) { - var subtype; - - F.prototype = obj; - - subtype = new F(); - - F.prototype = null; - - return subtype; - }; - }()) - - /** - * CryptoJS namespace. - */ - var C = {}; - - /** - * Library namespace. - */ - var C_lib = C.lib = {}; - - /** - * Base object for prototypal inheritance. - */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); - - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } - - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; - - // Reference supertype - subtype.$super = this; - - return subtype; - }, - - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); - - return instance; - }, - - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, - - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } - } - - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; - } - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); - } - }; - }()); - - /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes !== undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } - }, - - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, - - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; - - // Clamp excess bits - this.clamp(); - - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var i = 0; i < thatSigBytes; i += 4) { - thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - var r = (function (m_w) { - var m_w = m_w; - var m_z = 0x3ade68b1; - var mask = 0xffffffff; - - return function () { - m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; - m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; - var result = ((m_z << 0x10) + m_w) & mask; - result /= 0x100000000; - result += 0.5; - return result * (Math.random() > .5 ? 1 : -1); - } - }); - - for (var i = 0, rcache; i < nBytes; i += 4) { - var _r = r((rcache || Math.random()) * 0x100000000); - - rcache = _r() * 0x3ade67b7; - words.push((_r() * 0x100000000) | 0); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data === 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - var processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512 / 32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64 encoding strategy. - */ - var Base64 = C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); - */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); - - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; - - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); - - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); - - /** - * MD5 hash algorithm. - */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working varialbes - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); - - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); - - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); - - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); - - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; - - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); - */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Reusable object - var W = []; - - /** - * SHA-1 hash algorithm. - */ - var SHA1 = C_algo.SHA1 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476, - 0xc3d2e1f0 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - // Computation - for (var i = 0; i < 80; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = (n << 1) | (n >>> 31); - } - - var t = ((a << 5) | (a >>> 27)) + e + W[i]; - if (i < 20) { - t += ((b & c) | (~b & d)) + 0x5a827999; - } else if (i < 40) { - t += (b ^ c ^ d) + 0x6ed9eba1; - } else if (i < 60) { - t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; - } else /* if (i < 80) */ { - t += (b ^ c ^ d) - 0x359d3e2a; - } - - e = d; - d = c; - c = (b << 30) | (b >>> 2); - b = a; - a = t; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA1('message'); - * var hash = CryptoJS.SHA1(wordArray); - */ - C.SHA1 = Hasher._createHelper(SHA1); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA1(message, key); - */ - C.HmacSHA1 = Hasher._createHmacHelper(SHA1); - }()); - - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Initialization and round constants tables - var H = []; - var K = []; - - // Compute constants - (function () { - function isPrime(n) { - var sqrtN = Math.sqrt(n); - for (var factor = 2; factor <= sqrtN; factor++) { - if (!(n % factor)) { - return false; - } - } - - return true; - } - - function getFractionalBits(n) { - return ((n - (n | 0)) * 0x100000000) | 0; - } - - var n = 2; - var nPrime = 0; - while (nPrime < 64) { - if (isPrime(n)) { - if (nPrime < 8) { - H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); - } - K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); - - nPrime++; - } - - n++; - } - }()); - - // Reusable object - var W = []; - - /** - * SHA-256 hash algorithm. - */ - var SHA256 = C_algo.SHA256 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init(H.slice(0)); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - var f = H[5]; - var g = H[6]; - var h = H[7]; - - // Computation - for (var i = 0; i < 64; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var gamma0x = W[i - 15]; - var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ - ((gamma0x << 14) | (gamma0x >>> 18)) ^ - (gamma0x >>> 3); - - var gamma1x = W[i - 2]; - var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ - ((gamma1x << 13) | (gamma1x >>> 19)) ^ - (gamma1x >>> 10); - - W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; - } - - var ch = (e & f) ^ (~e & g); - var maj = (a & b) ^ (a & c) ^ (b & c); - - var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); - var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); - - var t1 = h + sigma1 + ch + K[i] + W[i]; - var t2 = sigma0 + maj; - - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - H[5] = (H[5] + f) | 0; - H[6] = (H[6] + g) | 0; - H[7] = (H[7] + h) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA256('message'); - * var hash = CryptoJS.SHA256(wordArray); - */ - C.SHA256 = Hasher._createHelper(SHA256); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA256(message, key); - */ - C.HmacSHA256 = Hasher._createHmacHelper(SHA256); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * UTF-16 BE encoding strategy. - */ - var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { - /** - * Converts a word array to a UTF-16 BE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 BE string. - * - * @static - * - * @example - * - * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 BE string to a word array. - * - * @param {string} utf16Str The UTF-16 BE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - /** - * UTF-16 LE encoding strategy. - */ - C_enc.Utf16LE = { - /** - * Converts a word array to a UTF-16 LE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 LE string. - * - * @static - * - * @example - * - * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 LE string to a word array. - * - * @param {string} utf16Str The UTF-16 LE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - function swapEndian(word) { - return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); - } - }()); - - - (function () { - // Check if typed arrays are supported - if (typeof ArrayBuffer !== 'function') { - return; - } - - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - - // Reference original init - var superInit = WordArray.init; - - // Augment WordArray.init to handle typed arrays - var subInit = WordArray.init = function (typedArray) { - // Convert buffers to uint8 - if (typedArray instanceof ArrayBuffer) { - typedArray = new Uint8Array(typedArray); - } - - // Convert other array views to uint8 - if ( - typedArray instanceof Int8Array || - (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || - typedArray instanceof Int16Array || - typedArray instanceof Uint16Array || - typedArray instanceof Int32Array || - typedArray instanceof Uint32Array || - typedArray instanceof Float32Array || - typedArray instanceof Float64Array - ) { - typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); - } - - // Handle Uint8Array - if (typedArray instanceof Uint8Array) { - // Shortcut - var typedArrayByteLength = typedArray.byteLength; - - // Extract bytes - var words = []; - for (var i = 0; i < typedArrayByteLength; i++) { - words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); - } - - // Initialize this word array - superInit.call(this, words, typedArrayByteLength); - } else { - // Else call normal init - superInit.apply(this, arguments); - } - }; - - subInit.prototype = WordArray; - }()); - - - /** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var _zl = WordArray.create([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); - var _zr = WordArray.create([ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); - var _sl = WordArray.create([ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]); - var _sr = WordArray.create([ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]); - - var _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); - var _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); - - /** - * RIPEMD160 hash algorithm. - */ - var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ - _doReset: function () { - this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); - }, - - _doProcessBlock: function (M, offset) { - - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - // Swap - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - // Shortcut - var H = this._hash.words; - var hl = _hl.words; - var hr = _hr.words; - var zl = _zl.words; - var zr = _zr.words; - var sl = _sl.words; - var sr = _sr.words; - - // Working variables - var al, bl, cl, dl, el; - var ar, br, cr, dr, er; - - ar = al = H[0]; - br = bl = H[1]; - cr = cl = H[2]; - dr = dl = H[3]; - er = el = H[4]; - // Computation - var t; - for (var i = 0; i < 80; i += 1) { - t = (al + M[offset + zl[i]]) | 0; - if (i < 16) { - t += f1(bl, cl, dl) + hl[0]; - } else if (i < 32) { - t += f2(bl, cl, dl) + hl[1]; - } else if (i < 48) { - t += f3(bl, cl, dl) + hl[2]; - } else if (i < 64) { - t += f4(bl, cl, dl) + hl[3]; - } else {// if (i<80) { - t += f5(bl, cl, dl) + hl[4]; - } - t = t | 0; - t = rotl(t, sl[i]); - t = (t + el) | 0; - al = el; - el = dl; - dl = rotl(cl, 10); - cl = bl; - bl = t; - - t = (ar + M[offset + zr[i]]) | 0; - if (i < 16) { - t += f5(br, cr, dr) + hr[0]; - } else if (i < 32) { - t += f4(br, cr, dr) + hr[1]; - } else if (i < 48) { - t += f3(br, cr, dr) + hr[2]; - } else if (i < 64) { - t += f2(br, cr, dr) + hr[3]; - } else {// if (i<80) { - t += f1(br, cr, dr) + hr[4]; - } - t = t | 0; - t = rotl(t, sr[i]); - t = (t + er) | 0; - ar = er; - er = dr; - dr = rotl(cr, 10); - cr = br; - br = t; - } - // Intermediate hash value - t = (H[1] + cl + dr) | 0; - H[1] = (H[2] + dl + er) | 0; - H[2] = (H[3] + el + ar) | 0; - H[3] = (H[4] + al + br) | 0; - H[4] = (H[0] + bl + cr) | 0; - H[0] = t; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | - (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) - ); - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 5; i++) { - // Shortcut - var H_i = H[i]; - - // Swap - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - - function f1(x, y, z) { - return ((x) ^ (y) ^ (z)); - - } - - function f2(x, y, z) { - return (((x) & (y)) | ((~x) & (z))); - } - - function f3(x, y, z) { - return (((x) | (~(y))) ^ (z)); - } - - function f4(x, y, z) { - return (((x) & (z)) | ((y) & (~(z)))); - } - - function f5(x, y, z) { - return ((x) ^ ((y) | (~(z)))); - - } - - function rotl(x, n) { - return (x << n) | (x >>> (32 - n)); - } - - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.RIPEMD160('message'); - * var hash = CryptoJS.RIPEMD160(wordArray); - */ - C.RIPEMD160 = Hasher._createHelper(RIPEMD160); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacRIPEMD160(message, key); - */ - C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var C_algo = C.algo; - - /** - * HMAC algorithm. - */ - var HMAC = C_algo.HMAC = Base.extend({ - /** - * Initializes a newly created HMAC. - * - * @param {Hasher} hasher The hash algorithm to use. - * @param {WordArray|string} key The secret key. - * - * @example - * - * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); - */ - init: function (hasher, key) { - // Init hasher - hasher = this._hasher = new hasher.init(); - - // Convert string to WordArray, else assume WordArray already - if (typeof key === 'string') { - key = Utf8.parse(key); - } - - // Shortcuts - var hasherBlockSize = hasher.blockSize; - var hasherBlockSizeBytes = hasherBlockSize * 4; - - // Allow arbitrary length keys - if (key.sigBytes > hasherBlockSizeBytes) { - key = hasher.finalize(key); - } - - // Clamp excess bits - key.clamp(); - - // Clone key for inner and outer pads - var oKey = this._oKey = key.clone(); - var iKey = this._iKey = key.clone(); - - // Shortcuts - var oKeyWords = oKey.words; - var iKeyWords = iKey.words; - - // XOR keys with pad constants - for (var i = 0; i < hasherBlockSize; i++) { - oKeyWords[i] ^= 0x5c5c5c5c; - iKeyWords[i] ^= 0x36363636; - } - oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; - - // Set initial values - this.reset(); - }, - - /** - * Resets this HMAC to its initial state. - * - * @example - * - * hmacHasher.reset(); - */ - reset: function () { - // Shortcut - var hasher = this._hasher; - - // Reset - hasher.reset(); - hasher.update(this._iKey); - }, - - /** - * Updates this HMAC with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {HMAC} This HMAC instance. - * - * @example - * - * hmacHasher.update('message'); - * hmacHasher.update(wordArray); - */ - update: function (messageUpdate) { - this._hasher.update(messageUpdate); - - // Chainable - return this; - }, - - /** - * Finalizes the HMAC computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The HMAC. - * - * @example - * - * var hmac = hmacHasher.finalize(); - * var hmac = hmacHasher.finalize('message'); - * var hmac = hmacHasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Shortcut - var hasher = this._hasher; - - // Compute HMAC - var innerHash = hasher.finalize(messageUpdate); - hasher.reset(); - var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); - - return hmac; - } - }); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; - - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128 / 32, - hasher: SHA1, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); - - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); - - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; - - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); - - // Shortcut - var intermediateWords = intermediate.words; - - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } - - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var MD5 = C_algo.MD5; - - /** - * This key derivation function is meant to conform with EVP_BytesToKey. - * www.openssl.org/docs/crypto/EVP_BytesToKey.html - */ - var EvpKDF = C_algo.EvpKDF = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hash algorithm to use. Default: MD5 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128 / 32, - hasher: MD5, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.EvpKDF.create(); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init hasher - var hasher = cfg.hasher.create(); - - // Initial values - var derivedKey = WordArray.create(); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - if (block) { - hasher.update(block); - } - var block = hasher.update(password).finalize(salt); - hasher.reset(); - - // Iterations - for (var i = 1; i < iterations; i++) { - block = hasher.finalize(block); - hasher.reset(); - } - - derivedKey.concat(block); - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.EvpKDF(password, salt); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.EvpKDF = function (password, salt, cfg) { - return EvpKDF.create(cfg).compute(password, salt); - }; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA256 = C_algo.SHA256; - - /** - * SHA-224 hash algorithm. - */ - var SHA224 = C_algo.SHA224 = SHA256.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - ]); - }, - - _doFinalize: function () { - var hash = SHA256._doFinalize.call(this); - - hash.sigBytes -= 4; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA224('message'); - * var hash = CryptoJS.SHA224(wordArray); - */ - C.SHA224 = SHA256._createHelper(SHA224); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA224(message, key); - */ - C.HmacSHA224 = SHA256._createHmacHelper(SHA224); - }()); - - - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; - - /** - * x64 namespace. - */ - var C_x64 = C.x64 = {}; - - /** - * A 64-bit word. - */ - var X64Word = C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } - - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, - - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, - - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; - - // return X64Word.create(high, low); - // } - }); - - /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var X64WordArray = C_x64.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes !== undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; - } - }, - - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { - // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, - - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - - // Clone "words" array - var words = clone.words = this.words.slice(0); - - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); - } - - return clone; - } - }); - }()); - - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; - - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; - - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } - - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; - } - } - - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } - - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } - } - - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); - - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); - } - }()); - - /** - * SHA-3 hash algorithm. - */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ - /** - * Configuration options. - * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 - */ - cfg: Hasher.cfg.extend({ - outputLength: 512 - }), - - _doReset: function () { - var state = this._state = [] - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; - - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; - - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); - - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } - - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } - - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; - - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } - - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; - - // Rotate lanes - if (rhoOffset < 32) { - var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } - - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } - - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; - - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } - - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low;; - } - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; - - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; - - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); - - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } - - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, - - clone: function () { - var clone = Hasher.clone.call(this); - - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - - function X64Word_create() { - return X64Word.create.apply(X64Word, arguments); - } - - // Constants - var K = [ - X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), - X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), - X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), - X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), - X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), - X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), - X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), - X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), - X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), - X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), - X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), - X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), - X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), - X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), - X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), - X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), - X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), - X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), - X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), - X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), - X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), - X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), - X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), - X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), - X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), - X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), - X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), - X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), - X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), - X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), - X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), - X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), - X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), - X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), - X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), - X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), - X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), - X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), - X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), - X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) - ]; - - // Reusable objects - var W = []; - (function () { - for (var i = 0; i < 80; i++) { - W[i] = X64Word_create(); - } - }()); - - /** - * SHA-512 hash algorithm. - */ - var SHA512 = C_algo.SHA512 = Hasher.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), - new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), - new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), - new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var H = this._hash.words; - - var H0 = H[0]; - var H1 = H[1]; - var H2 = H[2]; - var H3 = H[3]; - var H4 = H[4]; - var H5 = H[5]; - var H6 = H[6]; - var H7 = H[7]; - - var H0h = H0.high; - var H0l = H0.low; - var H1h = H1.high; - var H1l = H1.low; - var H2h = H2.high; - var H2l = H2.low; - var H3h = H3.high; - var H3l = H3.low; - var H4h = H4.high; - var H4l = H4.low; - var H5h = H5.high; - var H5l = H5.low; - var H6h = H6.high; - var H6l = H6.low; - var H7h = H7.high; - var H7l = H7.low; - - // Working variables - var ah = H0h; - var al = H0l; - var bh = H1h; - var bl = H1l; - var ch = H2h; - var cl = H2l; - var dh = H3h; - var dl = H3l; - var eh = H4h; - var el = H4l; - var fh = H5h; - var fl = H5l; - var gh = H6h; - var gl = H6l; - var hh = H7h; - var hl = H7l; - - // Rounds - for (var i = 0; i < 80; i++) { - // Shortcut - var Wi = W[i]; - - // Extend message - if (i < 16) { - var Wih = Wi.high = M[offset + i * 2] | 0; - var Wil = Wi.low = M[offset + i * 2 + 1] | 0; - } else { - // Gamma0 - var gamma0x = W[i - 15]; - var gamma0xh = gamma0x.high; - var gamma0xl = gamma0x.low; - var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); - var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); - - // Gamma1 - var gamma1x = W[i - 2]; - var gamma1xh = gamma1x.high; - var gamma1xl = gamma1x.low; - var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); - var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); - - // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] - var Wi7 = W[i - 7]; - var Wi7h = Wi7.high; - var Wi7l = Wi7.low; - - var Wi16 = W[i - 16]; - var Wi16h = Wi16.high; - var Wi16l = Wi16.low; - - var Wil = gamma0l + Wi7l; - var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); - var Wil = Wil + gamma1l; - var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); - var Wil = Wil + Wi16l; - var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); - - Wi.high = Wih; - Wi.low = Wil; - } - - var chh = (eh & fh) ^ (~eh & gh); - var chl = (el & fl) ^ (~el & gl); - var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); - var majl = (al & bl) ^ (al & cl) ^ (bl & cl); - - var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); - var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); - var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); - var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); - - // t1 = h + sigma1 + ch + K[i] + W[i] - var Ki = K[i]; - var Kih = Ki.high; - var Kil = Ki.low; - - var t1l = hl + sigma1l; - var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); - var t1l = t1l + chl; - var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); - var t1l = t1l + Kil; - var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); - var t1l = t1l + Wil; - var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - - // t2 = sigma0 + maj - var t2l = sigma0l + majl; - var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); - - // Update working variables - hh = gh; - hl = gl; - gh = fh; - gl = fl; - fh = eh; - fl = el; - el = (dl + t1l) | 0; - eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; - dh = ch; - dl = cl; - ch = bh; - cl = bl; - bh = ah; - bl = al; - al = (t1l + t2l) | 0; - ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; - } - - // Intermediate hash value - H0l = H0.low = (H0l + al); - H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); - H1l = H1.low = (H1l + bl); - H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); - H2l = H2.low = (H2l + cl); - H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); - H3l = H3.low = (H3l + dl); - H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); - H4l = H4.low = (H4l + el); - H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); - H5l = H5.low = (H5l + fl); - H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); - H6l = H6.low = (H6l + gl); - H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); - H7l = H7.low = (H7l + hl); - H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Convert hash to 32-bit word array before returning - var hash = this._hash.toX32(); - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - }, - - blockSize: 1024 / 32 - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA512('message'); - * var hash = CryptoJS.SHA512(wordArray); - */ - C.SHA512 = Hasher._createHelper(SHA512); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA512(message, key); - */ - C.HmacSHA512 = Hasher._createHmacHelper(SHA512); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - var SHA512 = C_algo.SHA512; - - /** - * SHA-384 hash algorithm. - */ - var SHA384 = C_algo.SHA384 = SHA512.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), - new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), - new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), - new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) - ]); - }, - - _doFinalize: function () { - var hash = SHA512._doFinalize.call(this); - - hash.sigBytes -= 16; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA384('message'); - * var hash = CryptoJS.SHA384(wordArray); - */ - C.SHA384 = SHA512._createHelper(SHA384); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA384(message, key); - */ - C.HmacSHA384 = SHA512._createHmacHelper(SHA384); - }()); - - - /** - * Cipher core components. - */ - CryptoJS.lib.Cipher || (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var Base64 = C_enc.Base64; - var C_algo = C.algo; - var EvpKDF = C_algo.EvpKDF; - - /** - * Abstract base cipher template. - * - * @property {number} keySize This cipher's key size. Default: 4 (128 bits) - * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) - * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. - * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. - */ - var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - * - * @property {WordArray} iv The IV to use for this operation. - */ - cfg: Base.extend(), - - /** - * Creates this cipher in encryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); - */ - createEncryptor: function (key, cfg) { - return this.create(this._ENC_XFORM_MODE, key, cfg); - }, - - /** - * Creates this cipher in decryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); - */ - createDecryptor: function (key, cfg) { - return this.create(this._DEC_XFORM_MODE, key, cfg); - }, - - /** - * Initializes a newly created cipher. - * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @example - * - * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); - */ - init: function (xformMode, key, cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Store transform mode and key - this._xformMode = xformMode; - this._key = key; - - // Set initial values - this.reset(); - }, - - /** - * Resets this cipher to its initial state. - * - * @example - * - * cipher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-cipher logic - this._doReset(); - }, - - /** - * Adds data to be encrypted or decrypted. - * - * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. - * - * @return {WordArray} The data after processing. - * - * @example - * - * var encrypted = cipher.process('data'); - * var encrypted = cipher.process(wordArray); - */ - process: function (dataUpdate) { - // Append - this._append(dataUpdate); - - // Process available blocks - return this._process(); - }, - - /** - * Finalizes the encryption or decryption process. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. - * - * @return {WordArray} The data after final processing. - * - * @example - * - * var encrypted = cipher.finalize(); - * var encrypted = cipher.finalize('data'); - * var encrypted = cipher.finalize(wordArray); - */ - finalize: function (dataUpdate) { - // Final data update - if (dataUpdate) { - this._append(dataUpdate); - } - - // Perform concrete-cipher logic - var finalProcessedData = this._doFinalize(); - - return finalProcessedData; - }, - - keySize: 128 / 32, - - ivSize: 128 / 32, - - _ENC_XFORM_MODE: 1, - - _DEC_XFORM_MODE: 2, - - /** - * Creates shortcut functions to a cipher's object interface. - * - * @param {Cipher} cipher The cipher to create a helper for. - * - * @return {Object} An object with encrypt and decrypt shortcut functions. - * - * @static - * - * @example - * - * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); - */ - _createHelper: (function () { - function selectCipherStrategy(key) { - if (typeof key === 'string') { - return PasswordBasedCipher; - } else { - return SerializableCipher; - } - } - - return function (cipher) { - return { - encrypt: function (message, key, cfg) { - return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); - }, - - decrypt: function (ciphertext, key, cfg) { - return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); - } - }; - }; - }()) - }); - - /** - * Abstract base stream cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) - */ - var StreamCipher = C_lib.StreamCipher = Cipher.extend({ - _doFinalize: function () { - // Process partial blocks - var finalProcessedBlocks = this._process(!!'flush'); - - return finalProcessedBlocks; - }, - - blockSize: 1 - }); - - /** - * Mode namespace. - */ - var C_mode = C.mode = {}; - - /** - * Abstract base block cipher mode template. - */ - var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ - /** - * Creates this mode for encryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); - */ - createEncryptor: function (cipher, iv) { - return this.Encryptor.create(cipher, iv); - }, - - /** - * Creates this mode for decryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); - */ - createDecryptor: function (cipher, iv) { - return this.Decryptor.create(cipher, iv); - }, - - /** - * Initializes a newly created mode. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @example - * - * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); - */ - init: function (cipher, iv) { - this._cipher = cipher; - this._iv = iv; - } - }); - - /** - * Cipher Block Chaining mode. - */ - var CBC = C_mode.CBC = (function () { - /** - * Abstract base CBC mode. - */ - var CBC = BlockCipherMode.extend(); - - /** - * CBC encryptor. - */ - CBC.Encryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // XOR and encrypt - xorBlock.call(this, words, offset, blockSize); - cipher.encryptBlock(words, offset); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - /** - * CBC decryptor. - */ - CBC.Decryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - // Decrypt and XOR - cipher.decryptBlock(words, offset); - xorBlock.call(this, words, offset, blockSize); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function xorBlock(words, offset, blockSize) { - // Shortcut - var iv = this._iv; - - // Choose mixing block - if (iv) { - var block = iv; - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var block = this._prevBlock; - } - - // XOR blocks - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= block[i]; - } - } - - return CBC; - }()); - - /** - * Padding namespace. - */ - var C_pad = C.pad = {}; - - /** - * PKCS #5/7 padding strategy. - */ - var Pkcs7 = C_pad.Pkcs7 = { - /** - * Pads data using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to pad. - * @param {number} blockSize The multiple that the data should be padded to. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.pad(wordArray, 4); - */ - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Create padding word - var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; - - // Create padding - var paddingWords = []; - for (var i = 0; i < nPaddingBytes; i += 4) { - paddingWords.push(paddingWord); - } - var padding = WordArray.create(paddingWords, nPaddingBytes); - - // Add padding - data.concat(padding); - }, - - /** - * Unpads data that had been padded using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to unpad. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.unpad(wordArray); - */ - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - /** - * Abstract base block cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) - */ - var BlockCipher = C_lib.BlockCipher = Cipher.extend({ - /** - * Configuration options. - * - * @property {Mode} mode The block mode to use. Default: CBC - * @property {Padding} padding The padding strategy to use. Default: Pkcs7 - */ - cfg: Cipher.cfg.extend({ - mode: CBC, - padding: Pkcs7 - }), - - reset: function () { - // Reset cipher - Cipher.reset.call(this); - - // Shortcuts - var cfg = this.cfg; - var iv = cfg.iv; - var mode = cfg.mode; - - // Reset block mode - if (this._xformMode === this._ENC_XFORM_MODE) { - var modeCreator = mode.createEncryptor; - } else /* if (this._xformMode === this._DEC_XFORM_MODE) */ { - var modeCreator = mode.createDecryptor; - // Keep at least one block in the buffer for unpadding - this._minBufferSize = 1; - } - - if (this._mode && this._mode.__creator === modeCreator) { - this._mode.init(this, iv && iv.words); - } else { - this._mode = modeCreator.call(mode, this, iv && iv.words); - this._mode.__creator = modeCreator; - } - }, - - _doProcessBlock: function (words, offset) { - this._mode.processBlock(words, offset); - }, - - _doFinalize: function () { - // Shortcut - var padding = this.cfg.padding; - - // Finalize - if (this._xformMode === this._ENC_XFORM_MODE) { - // Pad data - padding.pad(this._data, this.blockSize); - - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - } else /* if (this._xformMode === this._DEC_XFORM_MODE) */ { - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - - // Unpad data - padding.unpad(finalProcessedBlocks); - } - - return finalProcessedBlocks; - }, - - blockSize: 128 / 32 - }); - - /** - * A collection of cipher parameters. - * - * @property {WordArray} ciphertext The raw ciphertext. - * @property {WordArray} key The key to this ciphertext. - * @property {WordArray} iv The IV used in the ciphering operation. - * @property {WordArray} salt The salt used with a key derivation function. - * @property {Cipher} algorithm The cipher algorithm. - * @property {Mode} mode The block mode used in the ciphering operation. - * @property {Padding} padding The padding scheme used in the ciphering operation. - * @property {number} blockSize The block size of the cipher. - * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. - */ - var CipherParams = C_lib.CipherParams = Base.extend({ - /** - * Initializes a newly created cipher params object. - * - * @param {Object} cipherParams An object with any of the possible cipher parameters. - * - * @example - * - * var cipherParams = CryptoJS.lib.CipherParams.create({ - * ciphertext: ciphertextWordArray, - * key: keyWordArray, - * iv: ivWordArray, - * salt: saltWordArray, - * algorithm: CryptoJS.algo.AES, - * mode: CryptoJS.mode.CBC, - * padding: CryptoJS.pad.PKCS7, - * blockSize: 4, - * formatter: CryptoJS.format.OpenSSL - * }); - */ - init: function (cipherParams) { - this.mixIn(cipherParams); - }, - - /** - * Converts this cipher params object to a string. - * - * @param {Format} formatter (Optional) The formatting strategy to use. - * - * @return {string} The stringified cipher params. - * - * @throws Error If neither the formatter nor the default formatter is set. - * - * @example - * - * var string = cipherParams + ''; - * var string = cipherParams.toString(); - * var string = cipherParams.toString(CryptoJS.format.OpenSSL); - */ - toString: function (formatter) { - return (formatter || this.formatter).stringify(this); - } - }); - - /** - * Format namespace. - */ - var C_format = C.format = {}; - - /** - * OpenSSL formatting strategy. - */ - var OpenSSLFormatter = C_format.OpenSSL = { - /** - * Converts a cipher params object to an OpenSSL-compatible string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The OpenSSL-compatible string. - * - * @static - * - * @example - * - * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); - */ - stringify: function (cipherParams) { - // Shortcuts - var ciphertext = cipherParams.ciphertext; - var salt = cipherParams.salt; - - // Format - if (salt) { - var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); - } else { - var wordArray = ciphertext; - } - - return wordArray.toString(Base64); - }, - - /** - * Converts an OpenSSL-compatible string to a cipher params object. - * - * @param {string} openSSLStr The OpenSSL-compatible string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); - */ - parse: function (openSSLStr) { - // Parse base64 - var ciphertext = Base64.parse(openSSLStr); - - // Shortcut - var ciphertextWords = ciphertext.words; - - // Test for salt - if (ciphertextWords[0] === 0x53616c74 && ciphertextWords[1] === 0x65645f5f) { - // Extract salt - var salt = WordArray.create(ciphertextWords.slice(2, 4)); - - // Remove salt from ciphertext - ciphertextWords.splice(0, 4); - ciphertext.sigBytes -= 16; - } - - return CipherParams.create({ ciphertext: ciphertext, salt: salt }); - } - }; - - /** - * A cipher wrapper that returns ciphertext as a serializable cipher params object. - */ - var SerializableCipher = C_lib.SerializableCipher = Base.extend({ - /** - * Configuration options. - * - * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL - */ - cfg: Base.extend({ - format: OpenSSLFormatter - }), - - /** - * Encrypts a message. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Encrypt - var encryptor = cipher.createEncryptor(key, cfg); - var ciphertext = encryptor.finalize(message); - - // Shortcut - var cipherCfg = encryptor.cfg; - - // Create and return serializable cipher params - return CipherParams.create({ - ciphertext: ciphertext, - key: key, - iv: cipherCfg.iv, - algorithm: cipher, - mode: cipherCfg.mode, - padding: cipherCfg.padding, - blockSize: cipher.blockSize, - formatter: cfg.format - }); - }, - - /** - * Decrypts serialized ciphertext. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Decrypt - var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - - return plaintext; - }, - - /** - * Converts serialized ciphertext to CipherParams, - * else assumed CipherParams already and returns ciphertext unchanged. - * - * @param {CipherParams|string} ciphertext The ciphertext. - * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. - * - * @return {CipherParams} The unserialized ciphertext. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); - */ - _parse: function (ciphertext, format) { - if (typeof ciphertext === 'string') { - return format.parse(ciphertext, this); - } else { - return ciphertext; - } - } - }); - - /** - * Key derivation function namespace. - */ - var C_kdf = C.kdf = {}; - - /** - * OpenSSL key derivation function. - */ - var OpenSSLKdf = C_kdf.OpenSSL = { - /** - * Derives a key and IV from a password. - * - * @param {string} password The password to derive from. - * @param {number} keySize The size in words of the key to generate. - * @param {number} ivSize The size in words of the IV to generate. - * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. - * - * @return {CipherParams} A cipher params object with the key, IV, and salt. - * - * @static - * - * @example - * - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); - */ - execute: function (password, keySize, ivSize, salt) { - // Generate random salt - if (!salt) { - salt = WordArray.random(64 / 8); - } - - // Derive key and IV - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - - // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; - - // Return params - return CipherParams.create({ key: key, iv: iv, salt: salt }); - } - }; - - /** - * A serializable cipher wrapper that derives the key from a password, - * and returns ciphertext as a serializable cipher params object. - */ - var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ - /** - * Configuration options. - * - * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL - */ - cfg: SerializableCipher.cfg.extend({ - kdf: OpenSSLKdf - }), - - /** - * Encrypts a message using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Encrypt - var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); - - // Mix in derived params - ciphertext.mixIn(derivedParams); - - return ciphertext; - }, - - /** - * Decrypts serialized ciphertext using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Decrypt - var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); - - return plaintext; - } - }); - }()); - - - /** - * Cipher Feedback block mode. - */ - CryptoJS.mode.CFB = (function () { - var CFB = CryptoJS.lib.BlockCipherMode.extend(); - - CFB.Encryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - CFB.Decryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { - // Shortcut - var iv = this._iv; - - // Generate keystream - if (iv) { - var keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var keystream = this._prevBlock; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - - return CFB; - }()); - - - /** - * Electronic Codebook block mode. - */ - CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); - - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); - - return ECB; - }()); - - - /** - * ANSI X.923 padding strategy. - */ - CryptoJS.pad.AnsiX923 = { - pad: function (data, blockSize) { - // Shortcuts - var dataSigBytes = data.sigBytes; - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; - - // Compute last byte position - var lastBytePos = dataSigBytes + nPaddingBytes - 1; - - // Pad - data.clamp(); - data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); - data.sigBytes += nPaddingBytes; - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - /** - * ISO 10126 padding strategy. - */ - CryptoJS.pad.Iso10126 = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Pad - data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). - concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - /** - * ISO/IEC 9797-1 Padding Method 2. - */ - CryptoJS.pad.Iso97971 = { - pad: function (data, blockSize) { - // Add 0x80 byte - data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); - - // Zero pad the rest - CryptoJS.pad.ZeroPadding.pad(data, blockSize); - }, - - unpad: function (data) { - // Remove zero padding - CryptoJS.pad.ZeroPadding.unpad(data); - - // Remove one more byte -- the 0x80 byte - data.sigBytes--; - } - }; - - - /** - * Output Feedback block mode. - */ - CryptoJS.mode.OFB = (function () { - var OFB = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = OFB.Encryptor = OFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var keystream = this._keystream; - - // Generate keystream - if (iv) { - keystream = this._keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - OFB.Decryptor = Encryptor; - - return OFB; - }()); - - - /** - * A noop padding strategy. - */ - CryptoJS.pad.NoPadding = { - pad: function () { - }, - - unpad: function () { - } - }; - - - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var CipherParams = C_lib.CipherParams; - var C_enc = C.enc; - var Hex = C_enc.Hex; - var C_format = C.format; - - var HexFormatter = C_format.Hex = { - /** - * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The hexadecimally encoded string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.format.Hex.stringify(cipherParams); - */ - stringify: function (cipherParams) { - return cipherParams.ciphertext.toString(Hex); - }, - - /** - * Converts a hexadecimally encoded ciphertext string to a cipher params object. - * - * @param {string} input The hexadecimally encoded string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.Hex.parse(hexString); - */ - parse: function (input) { - var ciphertext = Hex.parse(input); - return CipherParams.create({ ciphertext: ciphertext }); - } - }; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Lookup tables - var SBOX = []; - var INV_SBOX = []; - var SUB_MIX_0 = []; - var SUB_MIX_1 = []; - var SUB_MIX_2 = []; - var SUB_MIX_3 = []; - var INV_SUB_MIX_0 = []; - var INV_SUB_MIX_1 = []; - var INV_SUB_MIX_2 = []; - var INV_SUB_MIX_3 = []; - - // Compute lookup tables - (function () { - // Compute double table - var d = []; - for (var i = 0; i < 256; i++) { - if (i < 128) { - d[i] = i << 1; - } else { - d[i] = (i << 1) ^ 0x11b; - } - } - - // Walk GF(2^8) - var x = 0; - var xi = 0; - for (var i = 0; i < 256; i++) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; - SBOX[x] = sx; - INV_SBOX[sx] = x; - - // Compute multiplication - var x2 = d[x]; - var x4 = d[x2]; - var x8 = d[x4]; - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100); - SUB_MIX_0[x] = (t << 24) | (t >>> 8); - SUB_MIX_1[x] = (t << 16) | (t >>> 16); - SUB_MIX_2[x] = (t << 8) | (t >>> 24); - SUB_MIX_3[x] = t; - - // Compute inv sub bytes, inv mix columns tables - var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); - INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); - INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); - INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); - INV_SUB_MIX_3[sx] = t; - - // Compute next counter - if (!x) { - x = xi = 1; - } else { - x = x2 ^ d[d[d[x8 ^ x2]]]; - xi ^= d[d[xi]]; - } - } - }()); - - // Precomputed Rcon lookup - var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; - - /** - * AES block cipher algorithm. - */ - var AES = C_algo.AES = BlockCipher.extend({ - _doReset: function () { - // Skip reset of nRounds has been set before and key did not change - if (this._nRounds && this._keyPriorReset === this._key) { - return; - } - - // Shortcuts - var key = this._keyPriorReset = this._key; - var keyWords = key.words; - var keySize = key.sigBytes / 4; - - // Compute number of rounds - var nRounds = this._nRounds = keySize + 6; - - // Compute number of key schedule rows - var ksRows = (nRounds + 1) * 4; - - // Compute key schedule - var keySchedule = this._keySchedule = []; - for (var ksRow = 0; ksRow < ksRows; ksRow++) { - if (ksRow < keySize) { - keySchedule[ksRow] = keyWords[ksRow]; - } else { - var t = keySchedule[ksRow - 1]; - - if (!(ksRow % keySize)) { - // Rot word - t = (t << 8) | (t >>> 24); - - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - - // Mix Rcon - t ^= RCON[(ksRow / keySize) | 0] << 24; - } else if (keySize > 6 && ksRow % keySize === 4) { - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - } - - keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; - } - } - - // Compute inv key schedule - var invKeySchedule = this._invKeySchedule = []; - for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { - var ksRow = ksRows - invKsRow; - - if (invKsRow % 4) { - var t = keySchedule[ksRow]; - } else { - var t = keySchedule[ksRow - 4]; - } - - if (invKsRow < 4 || ksRow <= 4) { - invKeySchedule[invKsRow] = t; - } else { - invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ - INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; - } - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); - }, - - decryptBlock: function (M, offset) { - // Swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - - this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); - - // Inv swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - }, - - _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { - // Shortcut - var nRounds = this._nRounds; - - // Get input, add round key - var s0 = M[offset] ^ keySchedule[0]; - var s1 = M[offset + 1] ^ keySchedule[1]; - var s2 = M[offset + 2] ^ keySchedule[2]; - var s3 = M[offset + 3] ^ keySchedule[3]; - - // Key schedule row counter - var ksRow = 4; - - // Rounds - for (var round = 1; round < nRounds; round++) { - // Shift rows, sub bytes, mix columns, add round key - var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; - var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; - var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; - var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; - - // Update state - s0 = t0; - s1 = t1; - s2 = t2; - s3 = t3; - } - - // Shift rows, sub bytes, add round key - var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; - var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; - var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; - var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; - - // Set output - M[offset] = t0; - M[offset + 1] = t1; - M[offset + 2] = t2; - M[offset + 3] = t3; - }, - - keySize: 256 / 32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); - */ - C.AES = BlockCipher._createHelper(AES); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Permuted Choice 1 constants - var PC1 = [ - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, 27, 19, 11, 3, - 60, 52, 44, 36, 63, 55, 47, 39, - 31, 23, 15, 7, 62, 54, 46, 38, - 30, 22, 14, 6, 61, 53, 45, 37, - 29, 21, 13, 5, 28, 20, 12, 4 - ]; - - // Permuted Choice 2 constants - var PC2 = [ - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 - ]; - - // Cumulative bit shift constants - var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; - - // SBOXes and round permutation constants - var SBOX_P = [ - { - 0x0: 0x808200, - 0x10000000: 0x8000, - 0x20000000: 0x808002, - 0x30000000: 0x2, - 0x40000000: 0x200, - 0x50000000: 0x808202, - 0x60000000: 0x800202, - 0x70000000: 0x800000, - 0x80000000: 0x202, - 0x90000000: 0x800200, - 0xa0000000: 0x8200, - 0xb0000000: 0x808000, - 0xc0000000: 0x8002, - 0xd0000000: 0x800002, - 0xe0000000: 0x0, - 0xf0000000: 0x8202, - 0x8000000: 0x0, - 0x18000000: 0x808202, - 0x28000000: 0x8202, - 0x38000000: 0x8000, - 0x48000000: 0x808200, - 0x58000000: 0x200, - 0x68000000: 0x808002, - 0x78000000: 0x2, - 0x88000000: 0x800200, - 0x98000000: 0x8200, - 0xa8000000: 0x808000, - 0xb8000000: 0x800202, - 0xc8000000: 0x800002, - 0xd8000000: 0x8002, - 0xe8000000: 0x202, - 0xf8000000: 0x800000, - 0x1: 0x8000, - 0x10000001: 0x2, - 0x20000001: 0x808200, - 0x30000001: 0x800000, - 0x40000001: 0x808002, - 0x50000001: 0x8200, - 0x60000001: 0x200, - 0x70000001: 0x800202, - 0x80000001: 0x808202, - 0x90000001: 0x808000, - 0xa0000001: 0x800002, - 0xb0000001: 0x8202, - 0xc0000001: 0x202, - 0xd0000001: 0x800200, - 0xe0000001: 0x8002, - 0xf0000001: 0x0, - 0x8000001: 0x808202, - 0x18000001: 0x808000, - 0x28000001: 0x800000, - 0x38000001: 0x200, - 0x48000001: 0x8000, - 0x58000001: 0x800002, - 0x68000001: 0x2, - 0x78000001: 0x8202, - 0x88000001: 0x8002, - 0x98000001: 0x800202, - 0xa8000001: 0x202, - 0xb8000001: 0x808200, - 0xc8000001: 0x800200, - 0xd8000001: 0x0, - 0xe8000001: 0x8200, - 0xf8000001: 0x808002 - }, - { - 0x0: 0x40084010, - 0x1000000: 0x4000, - 0x2000000: 0x80000, - 0x3000000: 0x40080010, - 0x4000000: 0x40000010, - 0x5000000: 0x40084000, - 0x6000000: 0x40004000, - 0x7000000: 0x10, - 0x8000000: 0x84000, - 0x9000000: 0x40004010, - 0xa000000: 0x40000000, - 0xb000000: 0x84010, - 0xc000000: 0x80010, - 0xd000000: 0x0, - 0xe000000: 0x4010, - 0xf000000: 0x40080000, - 0x800000: 0x40004000, - 0x1800000: 0x84010, - 0x2800000: 0x10, - 0x3800000: 0x40004010, - 0x4800000: 0x40084010, - 0x5800000: 0x40000000, - 0x6800000: 0x80000, - 0x7800000: 0x40080010, - 0x8800000: 0x80010, - 0x9800000: 0x0, - 0xa800000: 0x4000, - 0xb800000: 0x40080000, - 0xc800000: 0x40000010, - 0xd800000: 0x84000, - 0xe800000: 0x40084000, - 0xf800000: 0x4010, - 0x10000000: 0x0, - 0x11000000: 0x40080010, - 0x12000000: 0x40004010, - 0x13000000: 0x40084000, - 0x14000000: 0x40080000, - 0x15000000: 0x10, - 0x16000000: 0x84010, - 0x17000000: 0x4000, - 0x18000000: 0x4010, - 0x19000000: 0x80000, - 0x1a000000: 0x80010, - 0x1b000000: 0x40000010, - 0x1c000000: 0x84000, - 0x1d000000: 0x40004000, - 0x1e000000: 0x40000000, - 0x1f000000: 0x40084010, - 0x10800000: 0x84010, - 0x11800000: 0x80000, - 0x12800000: 0x40080000, - 0x13800000: 0x4000, - 0x14800000: 0x40004000, - 0x15800000: 0x40084010, - 0x16800000: 0x10, - 0x17800000: 0x40000000, - 0x18800000: 0x40084000, - 0x19800000: 0x40000010, - 0x1a800000: 0x40004010, - 0x1b800000: 0x80010, - 0x1c800000: 0x0, - 0x1d800000: 0x4010, - 0x1e800000: 0x40080010, - 0x1f800000: 0x84000 - }, - { - 0x0: 0x104, - 0x100000: 0x0, - 0x200000: 0x4000100, - 0x300000: 0x10104, - 0x400000: 0x10004, - 0x500000: 0x4000004, - 0x600000: 0x4010104, - 0x700000: 0x4010000, - 0x800000: 0x4000000, - 0x900000: 0x4010100, - 0xa00000: 0x10100, - 0xb00000: 0x4010004, - 0xc00000: 0x4000104, - 0xd00000: 0x10000, - 0xe00000: 0x4, - 0xf00000: 0x100, - 0x80000: 0x4010100, - 0x180000: 0x4010004, - 0x280000: 0x0, - 0x380000: 0x4000100, - 0x480000: 0x4000004, - 0x580000: 0x10000, - 0x680000: 0x10004, - 0x780000: 0x104, - 0x880000: 0x4, - 0x980000: 0x100, - 0xa80000: 0x4010000, - 0xb80000: 0x10104, - 0xc80000: 0x10100, - 0xd80000: 0x4000104, - 0xe80000: 0x4010104, - 0xf80000: 0x4000000, - 0x1000000: 0x4010100, - 0x1100000: 0x10004, - 0x1200000: 0x10000, - 0x1300000: 0x4000100, - 0x1400000: 0x100, - 0x1500000: 0x4010104, - 0x1600000: 0x4000004, - 0x1700000: 0x0, - 0x1800000: 0x4000104, - 0x1900000: 0x4000000, - 0x1a00000: 0x4, - 0x1b00000: 0x10100, - 0x1c00000: 0x4010000, - 0x1d00000: 0x104, - 0x1e00000: 0x10104, - 0x1f00000: 0x4010004, - 0x1080000: 0x4000000, - 0x1180000: 0x104, - 0x1280000: 0x4010100, - 0x1380000: 0x0, - 0x1480000: 0x10004, - 0x1580000: 0x4000100, - 0x1680000: 0x100, - 0x1780000: 0x4010004, - 0x1880000: 0x10000, - 0x1980000: 0x4010104, - 0x1a80000: 0x10104, - 0x1b80000: 0x4000004, - 0x1c80000: 0x4000104, - 0x1d80000: 0x4010000, - 0x1e80000: 0x4, - 0x1f80000: 0x10100 - }, - { - 0x0: 0x80401000, - 0x10000: 0x80001040, - 0x20000: 0x401040, - 0x30000: 0x80400000, - 0x40000: 0x0, - 0x50000: 0x401000, - 0x60000: 0x80000040, - 0x70000: 0x400040, - 0x80000: 0x80000000, - 0x90000: 0x400000, - 0xa0000: 0x40, - 0xb0000: 0x80001000, - 0xc0000: 0x80400040, - 0xd0000: 0x1040, - 0xe0000: 0x1000, - 0xf0000: 0x80401040, - 0x8000: 0x80001040, - 0x18000: 0x40, - 0x28000: 0x80400040, - 0x38000: 0x80001000, - 0x48000: 0x401000, - 0x58000: 0x80401040, - 0x68000: 0x0, - 0x78000: 0x80400000, - 0x88000: 0x1000, - 0x98000: 0x80401000, - 0xa8000: 0x400000, - 0xb8000: 0x1040, - 0xc8000: 0x80000000, - 0xd8000: 0x400040, - 0xe8000: 0x401040, - 0xf8000: 0x80000040, - 0x100000: 0x400040, - 0x110000: 0x401000, - 0x120000: 0x80000040, - 0x130000: 0x0, - 0x140000: 0x1040, - 0x150000: 0x80400040, - 0x160000: 0x80401000, - 0x170000: 0x80001040, - 0x180000: 0x80401040, - 0x190000: 0x80000000, - 0x1a0000: 0x80400000, - 0x1b0000: 0x401040, - 0x1c0000: 0x80001000, - 0x1d0000: 0x400000, - 0x1e0000: 0x40, - 0x1f0000: 0x1000, - 0x108000: 0x80400000, - 0x118000: 0x80401040, - 0x128000: 0x0, - 0x138000: 0x401000, - 0x148000: 0x400040, - 0x158000: 0x80000000, - 0x168000: 0x80001040, - 0x178000: 0x40, - 0x188000: 0x80000040, - 0x198000: 0x1000, - 0x1a8000: 0x80001000, - 0x1b8000: 0x80400040, - 0x1c8000: 0x1040, - 0x1d8000: 0x80401000, - 0x1e8000: 0x400000, - 0x1f8000: 0x401040 - }, - { - 0x0: 0x80, - 0x1000: 0x1040000, - 0x2000: 0x40000, - 0x3000: 0x20000000, - 0x4000: 0x20040080, - 0x5000: 0x1000080, - 0x6000: 0x21000080, - 0x7000: 0x40080, - 0x8000: 0x1000000, - 0x9000: 0x20040000, - 0xa000: 0x20000080, - 0xb000: 0x21040080, - 0xc000: 0x21040000, - 0xd000: 0x0, - 0xe000: 0x1040080, - 0xf000: 0x21000000, - 0x800: 0x1040080, - 0x1800: 0x21000080, - 0x2800: 0x80, - 0x3800: 0x1040000, - 0x4800: 0x40000, - 0x5800: 0x20040080, - 0x6800: 0x21040000, - 0x7800: 0x20000000, - 0x8800: 0x20040000, - 0x9800: 0x0, - 0xa800: 0x21040080, - 0xb800: 0x1000080, - 0xc800: 0x20000080, - 0xd800: 0x21000000, - 0xe800: 0x1000000, - 0xf800: 0x40080, - 0x10000: 0x40000, - 0x11000: 0x80, - 0x12000: 0x20000000, - 0x13000: 0x21000080, - 0x14000: 0x1000080, - 0x15000: 0x21040000, - 0x16000: 0x20040080, - 0x17000: 0x1000000, - 0x18000: 0x21040080, - 0x19000: 0x21000000, - 0x1a000: 0x1040000, - 0x1b000: 0x20040000, - 0x1c000: 0x40080, - 0x1d000: 0x20000080, - 0x1e000: 0x0, - 0x1f000: 0x1040080, - 0x10800: 0x21000080, - 0x11800: 0x1000000, - 0x12800: 0x1040000, - 0x13800: 0x20040080, - 0x14800: 0x20000000, - 0x15800: 0x1040080, - 0x16800: 0x80, - 0x17800: 0x21040000, - 0x18800: 0x40080, - 0x19800: 0x21040080, - 0x1a800: 0x0, - 0x1b800: 0x21000000, - 0x1c800: 0x1000080, - 0x1d800: 0x40000, - 0x1e800: 0x20040000, - 0x1f800: 0x20000080 - }, - { - 0x0: 0x10000008, - 0x100: 0x2000, - 0x200: 0x10200000, - 0x300: 0x10202008, - 0x400: 0x10002000, - 0x500: 0x200000, - 0x600: 0x200008, - 0x700: 0x10000000, - 0x800: 0x0, - 0x900: 0x10002008, - 0xa00: 0x202000, - 0xb00: 0x8, - 0xc00: 0x10200008, - 0xd00: 0x202008, - 0xe00: 0x2008, - 0xf00: 0x10202000, - 0x80: 0x10200000, - 0x180: 0x10202008, - 0x280: 0x8, - 0x380: 0x200000, - 0x480: 0x202008, - 0x580: 0x10000008, - 0x680: 0x10002000, - 0x780: 0x2008, - 0x880: 0x200008, - 0x980: 0x2000, - 0xa80: 0x10002008, - 0xb80: 0x10200008, - 0xc80: 0x0, - 0xd80: 0x10202000, - 0xe80: 0x202000, - 0xf80: 0x10000000, - 0x1000: 0x10002000, - 0x1100: 0x10200008, - 0x1200: 0x10202008, - 0x1300: 0x2008, - 0x1400: 0x200000, - 0x1500: 0x10000000, - 0x1600: 0x10000008, - 0x1700: 0x202000, - 0x1800: 0x202008, - 0x1900: 0x0, - 0x1a00: 0x8, - 0x1b00: 0x10200000, - 0x1c00: 0x2000, - 0x1d00: 0x10002008, - 0x1e00: 0x10202000, - 0x1f00: 0x200008, - 0x1080: 0x8, - 0x1180: 0x202000, - 0x1280: 0x200000, - 0x1380: 0x10000008, - 0x1480: 0x10002000, - 0x1580: 0x2008, - 0x1680: 0x10202008, - 0x1780: 0x10200000, - 0x1880: 0x10202000, - 0x1980: 0x10200008, - 0x1a80: 0x2000, - 0x1b80: 0x202008, - 0x1c80: 0x200008, - 0x1d80: 0x0, - 0x1e80: 0x10000000, - 0x1f80: 0x10002008 - }, - { - 0x0: 0x100000, - 0x10: 0x2000401, - 0x20: 0x400, - 0x30: 0x100401, - 0x40: 0x2100401, - 0x50: 0x0, - 0x60: 0x1, - 0x70: 0x2100001, - 0x80: 0x2000400, - 0x90: 0x100001, - 0xa0: 0x2000001, - 0xb0: 0x2100400, - 0xc0: 0x2100000, - 0xd0: 0x401, - 0xe0: 0x100400, - 0xf0: 0x2000000, - 0x8: 0x2100001, - 0x18: 0x0, - 0x28: 0x2000401, - 0x38: 0x2100400, - 0x48: 0x100000, - 0x58: 0x2000001, - 0x68: 0x2000000, - 0x78: 0x401, - 0x88: 0x100401, - 0x98: 0x2000400, - 0xa8: 0x2100000, - 0xb8: 0x100001, - 0xc8: 0x400, - 0xd8: 0x2100401, - 0xe8: 0x1, - 0xf8: 0x100400, - 0x100: 0x2000000, - 0x110: 0x100000, - 0x120: 0x2000401, - 0x130: 0x2100001, - 0x140: 0x100001, - 0x150: 0x2000400, - 0x160: 0x2100400, - 0x170: 0x100401, - 0x180: 0x401, - 0x190: 0x2100401, - 0x1a0: 0x100400, - 0x1b0: 0x1, - 0x1c0: 0x0, - 0x1d0: 0x2100000, - 0x1e0: 0x2000001, - 0x1f0: 0x400, - 0x108: 0x100400, - 0x118: 0x2000401, - 0x128: 0x2100001, - 0x138: 0x1, - 0x148: 0x2000000, - 0x158: 0x100000, - 0x168: 0x401, - 0x178: 0x2100400, - 0x188: 0x2000001, - 0x198: 0x2100000, - 0x1a8: 0x0, - 0x1b8: 0x2100401, - 0x1c8: 0x100401, - 0x1d8: 0x400, - 0x1e8: 0x2000400, - 0x1f8: 0x100001 - }, - { - 0x0: 0x8000820, - 0x1: 0x20000, - 0x2: 0x8000000, - 0x3: 0x20, - 0x4: 0x20020, - 0x5: 0x8020820, - 0x6: 0x8020800, - 0x7: 0x800, - 0x8: 0x8020000, - 0x9: 0x8000800, - 0xa: 0x20800, - 0xb: 0x8020020, - 0xc: 0x820, - 0xd: 0x0, - 0xe: 0x8000020, - 0xf: 0x20820, - 0x80000000: 0x800, - 0x80000001: 0x8020820, - 0x80000002: 0x8000820, - 0x80000003: 0x8000000, - 0x80000004: 0x8020000, - 0x80000005: 0x20800, - 0x80000006: 0x20820, - 0x80000007: 0x20, - 0x80000008: 0x8000020, - 0x80000009: 0x820, - 0x8000000a: 0x20020, - 0x8000000b: 0x8020800, - 0x8000000c: 0x0, - 0x8000000d: 0x8020020, - 0x8000000e: 0x8000800, - 0x8000000f: 0x20000, - 0x10: 0x20820, - 0x11: 0x8020800, - 0x12: 0x20, - 0x13: 0x800, - 0x14: 0x8000800, - 0x15: 0x8000020, - 0x16: 0x8020020, - 0x17: 0x20000, - 0x18: 0x0, - 0x19: 0x20020, - 0x1a: 0x8020000, - 0x1b: 0x8000820, - 0x1c: 0x8020820, - 0x1d: 0x20800, - 0x1e: 0x820, - 0x1f: 0x8000000, - 0x80000010: 0x20000, - 0x80000011: 0x800, - 0x80000012: 0x8020020, - 0x80000013: 0x20820, - 0x80000014: 0x20, - 0x80000015: 0x8020000, - 0x80000016: 0x8000000, - 0x80000017: 0x8000820, - 0x80000018: 0x8020820, - 0x80000019: 0x8000020, - 0x8000001a: 0x8000800, - 0x8000001b: 0x0, - 0x8000001c: 0x20800, - 0x8000001d: 0x820, - 0x8000001e: 0x20020, - 0x8000001f: 0x8020800 - } - ]; - - // Masks that select the SBOX input - var SBOX_MASK = [ - 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, - 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f - ]; - - /** - * DES block cipher algorithm. - */ - var DES = C_algo.DES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Select 56 bits according to PC1 - var keyBits = []; - for (var i = 0; i < 56; i++) { - var keyBitPos = PC1[i] - 1; - keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; - } - - // Assemble 16 subkeys - var subKeys = this._subKeys = []; - for (var nSubKey = 0; nSubKey < 16; nSubKey++) { - // Create subkey - var subKey = subKeys[nSubKey] = []; - - // Shortcut - var bitShift = BIT_SHIFTS[nSubKey]; - - // Select 48 bits according to PC2 - for (var i = 0; i < 24; i++) { - // Select from the left 28 key bits - subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); - - // Select from the right 28 key bits - subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); - } - - // Since each subkey is applied to an expanded 32-bit input, - // the subkey can be broken into 8 values scaled to 32-bits, - // which allows the key to be used without expansion - subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); - for (var i = 1; i < 7; i++) { - subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); - } - subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); - } - - // Compute inverse subkeys - var invSubKeys = this._invSubKeys = []; - for (var i = 0; i < 16; i++) { - invSubKeys[i] = subKeys[15 - i]; - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._subKeys); - }, - - decryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._invSubKeys); - }, - - _doCryptBlock: function (M, offset, subKeys) { - // Get input - this._lBlock = M[offset]; - this._rBlock = M[offset + 1]; - - // Initial permutation - exchangeLR.call(this, 4, 0x0f0f0f0f); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeRL.call(this, 2, 0x33333333); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeLR.call(this, 1, 0x55555555); - - // Rounds - for (var round = 0; round < 16; round++) { - // Shortcuts - var subKey = subKeys[round]; - var lBlock = this._lBlock; - var rBlock = this._rBlock; - - // Feistel function - var f = 0; - for (var i = 0; i < 8; i++) { - f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; - } - this._lBlock = rBlock; - this._rBlock = lBlock ^ f; - } - - // Undo swap from last round - var t = this._lBlock; - this._lBlock = this._rBlock; - this._rBlock = t; - - // Final permutation - exchangeLR.call(this, 1, 0x55555555); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeRL.call(this, 2, 0x33333333); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeLR.call(this, 4, 0x0f0f0f0f); - - // Set output - M[offset] = this._lBlock; - M[offset + 1] = this._rBlock; - }, - - keySize: 64 / 32, - - ivSize: 64 / 32, - - blockSize: 64 / 32 - }); - - // Swap bits across the left and right words - function exchangeLR(offset, mask) { - var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; - this._rBlock ^= t; - this._lBlock ^= t << offset; - } - - function exchangeRL(offset, mask) { - var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; - this._lBlock ^= t; - this._rBlock ^= t << offset; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); - */ - C.DES = BlockCipher._createHelper(DES); - - /** - * Triple-DES block cipher algorithm. - */ - var TripleDES = C_algo.TripleDES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Create DES instances - this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); - this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); - this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); - }, - - encryptBlock: function (M, offset) { - this._des1.encryptBlock(M, offset); - this._des2.decryptBlock(M, offset); - this._des3.encryptBlock(M, offset); - }, - - decryptBlock: function (M, offset) { - this._des3.decryptBlock(M, offset); - this._des2.encryptBlock(M, offset); - this._des1.decryptBlock(M, offset); - }, - - keySize: 192 / 32, - - ivSize: 64 / 32, - - blockSize: 64 / 32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); - */ - C.TripleDES = BlockCipher._createHelper(TripleDES); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - /** - * RC4 stream cipher algorithm. - */ - var RC4 = C_algo.RC4 = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - var keySigBytes = key.sigBytes; - - // Init sbox - var S = this._S = []; - for (var i = 0; i < 256; i++) { - S[i] = i; - } - - // Key setup - for (var i = 0, j = 0; i < 256; i++) { - var keyByteIndex = i % keySigBytes; - var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; - - j = (j + S[i] + keyByte) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - } - - // Counters - this._i = this._j = 0; - }, - - _doProcessBlock: function (M, offset) { - M[offset] ^= generateKeystreamWord.call(this); - }, - - keySize: 256 / 32, - - ivSize: 0 - }); - - function generateKeystreamWord() { - // Shortcuts - var S = this._S; - var i = this._i; - var j = this._j; - - // Generate keystream word - var keystreamWord = 0; - for (var n = 0; n < 4; n++) { - i = (i + 1) % 256; - j = (j + S[i]) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - - keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); - } - - // Update counters - this._i = i; - this._j = j; - - return keystreamWord; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); - */ - C.RC4 = StreamCipher._createHelper(RC4); - - /** - * Modified RC4 stream cipher algorithm. - */ - var RC4Drop = C_algo.RC4Drop = RC4.extend({ - /** - * Configuration options. - * - * @property {number} drop The number of keystream words to drop. Default 192 - */ - cfg: RC4.cfg.extend({ - drop: 192 - }), - - _doReset: function () { - RC4._doReset.call(this); - - // Drop - for (var i = this.cfg.drop; i > 0; i--) { - generateKeystreamWord.call(this); - } - } - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); - */ - C.RC4Drop = StreamCipher._createHelper(RC4Drop); - }()); - - - /** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - */ - CryptoJS.mode.CTRGladman = (function () { - var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - - function incWord(word) { - if (((word >> 24) & 0xff) === 0xff) { //overflow - var b1 = (word >> 16) & 0xff; - var b2 = (word >> 8) & 0xff; - var b3 = word & 0xff; - - if (b1 === 0xff) // overflow b1 - { - b1 = 0; - if (b2 === 0xff) { - b2 = 0; - if (b3 === 0xff) { - b3 = 0; - } - else { - ++b3; - } - } - else { - ++b2; - } - } - else { - ++b1; - } - - word = 0; - word += (b1 << 16); - word += (b2 << 8); - word += b3; - } - else { - word += (0x01 << 24); - } - return word; - } - - function incCounter(counter) { - if ((counter[0] = incWord(counter[0])) === 0) { - // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 - counter[1] = incWord(counter[1]); - } - return counter; - } - - var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - - incCounter(counter); - - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTRGladman.Decryptor = Encryptor; - - return CTRGladman; - }()); - - - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm - */ - var Rabbit = C_algo.Rabbit = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Swap endian - for (var i = 0; i < 4; i++) { - K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | - (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); - } - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128 / 32, - - ivSize: 64 / 32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); - * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); - */ - C.Rabbit = StreamCipher._createHelper(Rabbit); - }()); - - - /** - * Counter block mode. - */ - CryptoJS.mode.CTR = (function () { - var CTR = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = CTR.Encryptor = CTR.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Increment counter - counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTR.Decryptor = Encryptor; - - return CTR; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm. - * - * This is a legacy version that neglected to convert the key to little-endian. - * This error doesn't affect the cipher's security, - * but it does affect its compatibility with other implementations. - */ - var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128 / 32, - - ivSize: 64 / 32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); - */ - C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); - }()); - - - /** - * Zero padding strategy. - */ - CryptoJS.pad.ZeroPadding = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Pad - data.clamp(); - data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); - }, - - unpad: function (data) { - // Shortcut - var dataWords = data.words; - - // Unpad - var i = data.sigBytes - 1; - while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { - i--; - } - data.sigBytes = i + 1; - } - }; - - - return CryptoJS; - -})); -/* -CryptoJS v3.1.2 -code.google.com/p/crypto-js -(c) 2009-2013 by Jeff Mott. All rights reserved. -code.google.com/p/crypto-js/wiki/License -*/ -/** - * Electronic Codebook block mode. - */ -CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); - - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); - - return ECB; -}()); -; (function (root, factory, undef) { - if (typeof exports === "object") { - // CommonJS - module.exports = exports = factory(require("crypto-js/core"), require("crypto-js/sha1"), require("crypto-js/hmac")); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./sha1", "./hmac"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } -}(this, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; - - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128 / 32, - hasher: SHA1, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); - - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); - - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; - - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); - - // Shortcut - var intermediateWords = intermediate.words; - - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } - - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); - - - return CryptoJS.PBKDF2; - -})); -/*! ngTagsInput v3.2.0 License: MIT */!function () { "use strict"; var a = { backspace: 8, tab: 9, enter: 13, escape: 27, space: 32, up: 38, down: 40, left: 37, right: 39, "delete": 46, comma: 188 }, b = 9007199254740991, c = ["text", "email", "url"], d = angular.module("ngTagsInput", []); d.directive("tagsInput", ["$timeout", "$document", "$window", "$q", "tagsInputConfig", "tiUtil", function (d, e, f, g, h, i) { function j(a, b, c, d) { var e, f, h, j, k = {}; return e = function (b) { return i.safeToString(b[a.displayProperty]) }, f = function (b, c) { b[a.displayProperty] = c }, h = function (b) { var d = e(b), f = d && d.length >= a.minLength && d.length <= a.maxLength && a.allowedTagsPattern.test(d) && !i.findInObjectArray(k.items, b, a.keyProperty || a.displayProperty); return g.when(f && c({ $tag: b })).then(i.promisifyValue) }, j = function (a) { return g.when(d({ $tag: a })).then(i.promisifyValue) }, k.items = [], k.addText = function (a) { var b = {}; return f(b, a), k.add(b) }, k.add = function (c) { var d = e(c); return a.replaceSpacesWithDashes && (d = i.replaceSpacesWithDashes(d)), f(c, d), h(c).then(function () { k.items.push(c), b.trigger("tag-added", { $tag: c }) })["catch"](function () { d && b.trigger("invalid-tag", { $tag: c }) }) }, k.remove = function (a) { var c = k.items[a]; return j(c).then(function () { return k.items.splice(a, 1), k.clearSelection(), b.trigger("tag-removed", { $tag: c }), c }) }, k.select = function (a) { 0 > a ? a = k.items.length - 1 : a >= k.items.length && (a = 0), k.index = a, k.selected = k.items[a] }, k.selectPrior = function () { k.select(--k.index) }, k.selectNext = function () { k.select(++k.index) }, k.removeSelected = function () { return k.remove(k.index) }, k.clearSelection = function () { k.selected = null, k.index = -1 }, k.getItems = function () { return a.useStrings ? k.items.map(e) : k.items }, k.clearSelection(), k } function k(a) { return -1 !== c.indexOf(a) } return { restrict: "E", require: "ngModel", scope: { tags: "=ngModel", text: "=?", templateScope: "=?", tagClass: "&", onTagAdding: "&", onTagAdded: "&", onInvalidTag: "&", onTagRemoving: "&", onTagRemoved: "&", onTagClicked: "&" }, replace: !1, transclude: !0, templateUrl: "ngTagsInput/tags-input.html", controller: ["$scope", "$attrs", "$element", function (a, c, d) { a.events = i.simplePubSub(), h.load("tagsInput", a, c, { template: [String, "ngTagsInput/tag-item.html"], type: [String, "text", k], placeholder: [String, "Add a tag"], tabindex: [Number, null], removeTagSymbol: [String, String.fromCharCode(215)], replaceSpacesWithDashes: [Boolean, !0], minLength: [Number, 3], maxLength: [Number, b], addOnEnter: [Boolean, !0], addOnSpace: [Boolean, !1], addOnComma: [Boolean, !0], addOnBlur: [Boolean, !0], addOnPaste: [Boolean, !1], pasteSplitPattern: [RegExp, /,/], allowedTagsPattern: [RegExp, /.+/], enableEditingLastTag: [Boolean, !1], minTags: [Number, 0], maxTags: [Number, b], displayProperty: [String, "text"], keyProperty: [String, ""], allowLeftoverText: [Boolean, !1], addFromAutocompleteOnly: [Boolean, !1], spellcheck: [Boolean, !0], useStrings: [Boolean, !1] }), a.tagList = new j(a.options, a.events, i.handleUndefinedResult(a.onTagAdding, !0), i.handleUndefinedResult(a.onTagRemoving, !0)), this.registerAutocomplete = function () { d.find("input"); return { addTag: function (b) { return a.tagList.add(b) }, getTags: function () { return a.tagList.items }, getCurrentTagText: function () { return a.newTag.text() }, getOptions: function () { return a.options }, getTemplateScope: function () { return a.templateScope }, on: function (b, c) { return a.events.on(b, c, !0), this } } }, this.registerTagItem = function () { return { getOptions: function () { return a.options }, removeTag: function (b) { a.disabled || a.tagList.remove(b) } } } }], link: function (b, c, g, h) { var j, k, l = [a.enter, a.comma, a.space, a.backspace, a["delete"], a.left, a.right], m = b.tagList, n = b.events, o = b.options, p = c.find("input"), q = ["minTags", "maxTags", "allowLeftoverText"]; j = function () { h.$setValidity("maxTags", m.items.length <= o.maxTags), h.$setValidity("minTags", m.items.length >= o.minTags), h.$setValidity("leftoverText", b.hasFocus || o.allowLeftoverText ? !0 : !b.newTag.text()) }, k = function () { d(function () { p[0].focus() }) }, h.$isEmpty = function (a) { return !a || !a.length }, b.newTag = { text: function (a) { return angular.isDefined(a) ? (b.text = a, void n.trigger("input-change", a)) : b.text || "" }, invalid: null }, b.track = function (a) { return a[o.keyProperty || o.displayProperty] }, b.getTagClass = function (a, c) { var d = a === m.selected; return [b.tagClass({ $tag: a, $index: c, $selected: d }), { selected: d }] }, b.$watch("tags", function (a) { if (a) { if (m.items = i.makeObjectArray(a, o.displayProperty), o.useStrings) return; b.tags = m.items } else m.items = [] }), b.$watch("tags.length", function () { j(), h.$validate() }), g.$observe("disabled", function (a) { b.disabled = a }), b.eventHandlers = { input: { keydown: function (a) { n.trigger("input-keydown", a) }, focus: function () { b.hasFocus || (b.hasFocus = !0, n.trigger("input-focus")) }, blur: function () { d(function () { var a = e.prop("activeElement"), d = a === p[0], f = c[0].contains(a); (d || !f) && (b.hasFocus = !1, n.trigger("input-blur")) }) }, paste: function (a) { a.getTextData = function () { var b = a.clipboardData || a.originalEvent && a.originalEvent.clipboardData; return b ? b.getData("text/plain") : f.clipboardData.getData("Text") }, n.trigger("input-paste", a) } }, host: { click: function () { b.disabled || k() } }, tag: { click: function (a) { n.trigger("tag-clicked", { $tag: a }) } } }, n.on("tag-added", b.onTagAdded).on("invalid-tag", b.onInvalidTag).on("tag-removed", b.onTagRemoved).on("tag-clicked", b.onTagClicked).on("tag-added", function () { b.newTag.text("") }).on("tag-added tag-removed", function () { b.tags = m.getItems(), h.$setDirty(), k() }).on("invalid-tag", function () { b.newTag.invalid = !0 }).on("option-change", function (a) { -1 !== q.indexOf(a.name) && j() }).on("input-change", function () { m.clearSelection(), b.newTag.invalid = null }).on("input-focus", function () { c.triggerHandler("focus"), h.$setValidity("leftoverText", !0) }).on("input-blur", function () { o.addOnBlur && !o.addFromAutocompleteOnly && m.addText(b.newTag.text()), c.triggerHandler("blur"), j() }).on("input-keydown", function (c) { var d, e, f, g, h = c.keyCode, j = {}; i.isModifierOn(c) || -1 === l.indexOf(h) || (j[a.enter] = o.addOnEnter, j[a.comma] = o.addOnComma, j[a.space] = o.addOnSpace, d = !o.addFromAutocompleteOnly && j[h], e = (h === a.backspace || h === a["delete"]) && m.selected, g = h === a.backspace && 0 === b.newTag.text().length && o.enableEditingLastTag, f = (h === a.backspace || h === a.left || h === a.right) && 0 === b.newTag.text().length && !o.enableEditingLastTag, d ? m.addText(b.newTag.text()) : g ? (m.selectPrior(), m.removeSelected().then(function (a) { a && b.newTag.text(a[o.displayProperty]) })) : e ? m.removeSelected() : f && (h === a.left || h === a.backspace ? m.selectPrior() : h === a.right && m.selectNext()), (d || f || e || g) && c.preventDefault()) }).on("input-paste", function (a) { if (o.addOnPaste) { var b = a.getTextData(), c = b.split(o.pasteSplitPattern); c.length > 1 && (c.forEach(function (a) { m.addText(a) }), a.preventDefault()) } }) } } }]), d.directive("tiTagItem", ["tiUtil", function (a) { return { restrict: "E", require: "^tagsInput", template: '', scope: { $scope: "=scope", data: "=" }, link: function (b, c, d, e) { var f = e.registerTagItem(), g = f.getOptions(); b.$$template = g.template, b.$$removeTagSymbol = g.removeTagSymbol, b.$getDisplayText = function () { return a.safeToString(b.data[g.displayProperty]) }, b.$removeTag = function () { f.removeTag(b.$index) }, b.$watch("$parent.$index", function (a) { b.$index = a }) } } }]), d.directive("autoComplete", ["$document", "$timeout", "$sce", "$q", "tagsInputConfig", "tiUtil", function (b, c, d, e, f, g) { function h(a, b, c) { var d, f, h, i = {}; return h = function () { return b.tagsInput.keyProperty || b.tagsInput.displayProperty }, d = function (a, c) { return a.filter(function (a) { return !g.findInObjectArray(c, a, h(), function (a, c) { return b.tagsInput.replaceSpacesWithDashes && (a = g.replaceSpacesWithDashes(a), c = g.replaceSpacesWithDashes(c)), g.defaultComparer(a, c) }) }) }, i.reset = function () { f = null, i.items = [], i.visible = !1, i.index = -1, i.selected = null, i.query = null }, i.show = function () { b.selectFirstMatch ? i.select(0) : i.selected = null, i.visible = !0 }, i.load = g.debounce(function (c, j) { i.query = c; var k = e.when(a({ $query: c })); f = k, k.then(function (a) { k === f && (a = g.makeObjectArray(a.data || a, h()), a = d(a, j), i.items = a.slice(0, b.maxResultsToShow), i.items.length > 0 ? i.show() : i.reset()) }) }, b.debounceDelay), i.selectNext = function () { i.select(++i.index) }, i.selectPrior = function () { i.select(--i.index) }, i.select = function (a) { 0 > a ? a = i.items.length - 1 : a >= i.items.length && (a = 0), i.index = a, i.selected = i.items[a], c.trigger("suggestion-selected", a) }, i.reset(), i } function i(a, b) { var c = a.find("li").eq(b), d = c.parent(), e = c.prop("offsetTop"), f = c.prop("offsetHeight"), g = d.prop("clientHeight"), h = d.prop("scrollTop"); h > e ? d.prop("scrollTop", e) : e + f > g + h && d.prop("scrollTop", e + f - g) } return { restrict: "E", require: "^tagsInput", scope: { source: "&", matchClass: "&" }, templateUrl: "ngTagsInput/auto-complete.html", controller: ["$scope", "$element", "$attrs", function (a, b, c) { a.events = g.simplePubSub(), f.load("autoComplete", a, c, { template: [String, "ngTagsInput/auto-complete-match.html"], debounceDelay: [Number, 100], minLength: [Number, 3], highlightMatchedText: [Boolean, !0], maxResultsToShow: [Number, 10], loadOnDownArrow: [Boolean, !1], loadOnEmpty: [Boolean, !1], loadOnFocus: [Boolean, !1], selectFirstMatch: [Boolean, !0], displayProperty: [String, ""] }), a.suggestionList = new h(a.source, a.options, a.events), this.registerAutocompleteMatch = function () { return { getOptions: function () { return a.options }, getQuery: function () { return a.suggestionList.query } } } }], link: function (b, c, d, e) { var f, h = [a.enter, a.tab, a.escape, a.up, a.down], j = b.suggestionList, k = e.registerAutocomplete(), l = b.options, m = b.events; l.tagsInput = k.getOptions(), f = function (a) { return a && a.length >= l.minLength || !a && l.loadOnEmpty }, b.templateScope = k.getTemplateScope(), b.addSuggestionByIndex = function (a) { j.select(a), b.addSuggestion() }, b.addSuggestion = function () { var a = !1; return j.selected && (k.addTag(angular.copy(j.selected)), j.reset(), a = !0), a }, b.track = function (a) { return a[l.tagsInput.keyProperty || l.tagsInput.displayProperty] }, b.getSuggestionClass = function (a, c) { var d = a === j.selected; return [b.matchClass({ $match: a, $index: c, $selected: d }), { selected: d }] }, k.on("tag-added tag-removed invalid-tag input-blur", function () { j.reset() }).on("input-change", function (a) { f(a) ? j.load(a, k.getTags()) : j.reset() }).on("input-focus", function () { var a = k.getCurrentTagText(); l.loadOnFocus && f(a) && j.load(a, k.getTags()) }).on("input-keydown", function (c) { var d = c.keyCode, e = !1; if (!g.isModifierOn(c) && -1 !== h.indexOf(d)) return j.visible ? d === a.down ? (j.selectNext(), e = !0) : d === a.up ? (j.selectPrior(), e = !0) : d === a.escape ? (j.reset(), e = !0) : (d === a.enter || d === a.tab) && (e = b.addSuggestion()) : d === a.down && b.options.loadOnDownArrow && (j.load(k.getCurrentTagText(), k.getTags()), e = !0), e ? (c.preventDefault(), c.stopImmediatePropagation(), !1) : void 0 }), m.on("suggestion-selected", function (a) { i(c, a) }) } } }]), d.directive("tiAutocompleteMatch", ["$sce", "tiUtil", function (a, b) { return { restrict: "E", require: "^autoComplete", template: '', scope: { $scope: "=scope", data: "=" }, link: function (c, d, e, f) { var g = f.registerAutocompleteMatch(), h = g.getOptions(); c.$$template = h.template, c.$index = c.$parent.$index, c.$highlight = function (c) { return h.highlightMatchedText && (c = b.safeHighlight(c, g.getQuery())), a.trustAsHtml(c) }, c.$getDisplayText = function () { return b.safeToString(c.data[h.displayProperty || h.tagsInput.displayProperty]) } } } }]), d.directive("tiTranscludeAppend", function () { return function (a, b, c, d, e) { e(function (a) { b.append(a) }) } }), d.directive("tiAutosize", ["tagsInputConfig", function (a) { return { restrict: "A", require: "ngModel", link: function (b, c, d, e) { var f, g, h = a.getTextAutosizeThreshold(); f = angular.element(''), f.css("display", "none").css("visibility", "hidden").css("width", "auto").css("white-space", "pre"), c.parent().append(f), g = function (a) { var b, e = a; return angular.isString(e) && 0 === e.length && (e = d.placeholder), e && (f.text(e), f.css("display", ""), b = f.prop("offsetWidth"), f.css("display", "none")), c.css("width", b ? b + h + "px" : ""), a }, e.$parsers.unshift(g), e.$formatters.unshift(g), d.$observe("placeholder", function (a) { e.$modelValue || g(a) }) } } }]), d.directive("tiBindAttrs", function () { return function (a, b, c) { a.$watch(c.tiBindAttrs, function (a) { angular.forEach(a, function (a, b) { c.$set(b, a) }) }, !0) } }), d.provider("tagsInputConfig", function () { var a = {}, b = {}, c = 3; this.setDefaults = function (b, c) { return a[b] = c, this }, this.setActiveInterpolation = function (a, c) { return b[a] = c, this }, this.setTextAutosizeThreshold = function (a) { return c = a, this }, this.$get = ["$interpolate", function (d) { var e = {}; return e[String] = function (a) { return a }, e[Number] = function (a) { return parseInt(a, 10) }, e[Boolean] = function (a) { return "true" === a.toLowerCase() }, e[RegExp] = function (a) { return new RegExp(a) }, { load: function (c, f, g, h) { var i = function () { return !0 }; f.options = {}, angular.forEach(h, function (h, j) { var k, l, m, n, o, p; k = h[0], l = h[1], m = h[2] || i, n = e[k], o = function () { var b = a[c] && a[c][j]; return angular.isDefined(b) ? b : l }, p = function (a) { f.options[j] = a && m(a) ? n(a) : o() }, b[c] && b[c][j] ? g.$observe(j, function (a) { p(a), f.events.trigger("option-change", { name: j, newValue: a }) }) : p(g[j] && d(g[j])(f.$parent)) }) }, getTextAutosizeThreshold: function () { return c } } }] }), d.factory("tiUtil", ["$timeout", "$q", function (a, b) { var c = {}; return c.debounce = function (b, c) { var d; return function () { var e = arguments; a.cancel(d), d = a(function () { b.apply(null, e) }, c) } }, c.makeObjectArray = function (a, b) { if (!angular.isArray(a) || 0 === a.length || angular.isObject(a[0])) return a; var c = []; return a.forEach(function (a) { var d = {}; d[b] = a, c.push(d) }), c }, c.findInObjectArray = function (a, b, d, e) { var f = null; return e = e || c.defaultComparer, a.some(function (a) { return e(a[d], b[d]) ? (f = a, !0) : void 0 }), f }, c.defaultComparer = function (a, b) { return c.safeToString(a).toLowerCase() === c.safeToString(b).toLowerCase() }, c.safeHighlight = function (a, b) { function d(a) { return a.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") } if (a = c.encodeHTML(a), b = c.encodeHTML(b), !b) return a; var e = new RegExp("&[^;]+;|" + d(b), "gi"); return a.replace(e, function (a) { return a.toLowerCase() === b.toLowerCase() ? "" + a + "" : a }) }, c.safeToString = function (a) { return angular.isUndefined(a) || null == a ? "" : a.toString().trim() }, c.encodeHTML = function (a) { return c.safeToString(a).replace(/&/g, "&").replace(//g, ">") }, c.handleUndefinedResult = function (a, b) { return function () { var c = a.apply(null, arguments); return angular.isUndefined(c) ? b : c } }, c.replaceSpacesWithDashes = function (a) { return c.safeToString(a).replace(/\s/g, "-") }, c.isModifierOn = function (a) { return a.shiftKey || a.ctrlKey || a.altKey || a.metaKey }, c.promisifyValue = function (a) { return a = angular.isUndefined(a) ? !0 : a, b[a ? "when" : "reject"]() }, c.simplePubSub = function () { var a = {}; return { on: function (b, c, d) { return b.split(" ").forEach(function (b) { a[b] || (a[b] = []); var e = d ? [].unshift : [].push; e.call(a[b], c) }), this }, trigger: function (b, d) { var e = a[b] || []; return e.every(function (a) { return c.handleUndefinedResult(a, !0)(d) }), this } } }, c }]), d.run(["$templateCache", function (a) { a.put("ngTagsInput/tags-input.html", '
    '), a.put("ngTagsInput/tag-item.html", ' '), a.put("ngTagsInput/auto-complete.html", '
    '), a.put("ngTagsInput/auto-complete-match.html", '') }]) }(); -"use strict"; -app.factory("RestMixDatabasePortalService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database/portal", true); - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestMixDatabaseColumnPortalService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database-column/portal", true); - var _initData = async function (attrSetName) { - var url = this.prefixUrl + "/init/" + attrSetName; - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - serviceFactory.initData = _initData; - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestMixDatabaseDataClientService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database-data/client"); - var _initData = async function (attrSetName) { - var url = this.prefixUrl + "/init/" + attrSetName; - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - serviceFactory.initData = _initData; - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestMixDatabaseDataPortalService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = angular.copy(baseService); - serviceFactory.init("mix-database-data/portal"); - - var _saveAdditionalData = async function (objData) { - var url = this.prefixUrl + "/save-additional-data"; - var req = { - method: "POST", - url: url, - data: JSON.stringify(objData), - }; - return await commonService.getRestApiResult(req); - }; - - var _getAdditionalData = async function (data) { - var url = this.prefixUrl + "/additional-data"; - var queries = serviceFactory.parseQuery(data); - if (queries) { - url += "?"; - url = url.concat(queries); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - - var _initData = async function (attrSetName) { - var url = this.prefixUrl + "/init/" + attrSetName; - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - - var _export = async function (objData) { - var data = serviceFactory.parseQuery(objData); - var url = this.prefixUrl; - - if (data) { - url += "/export?"; - url = url.concat(data); - } - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - - var _import = async function (mixDatabaseName, file) { - var url = - (this.prefixUrl || "/" + this.lang + "/" + this.modelName) + - "/import-data/" + - mixDatabaseName; - var frm = new FormData(); - frm.append("file", file); - return serviceFactory.ajaxSubmitForm(frm, url); - }; - - serviceFactory.initData = _initData; - serviceFactory.getAdditionalData = _getAdditionalData; - serviceFactory.saveAdditionalData = _saveAdditionalData; - serviceFactory.export = _export; - serviceFactory.import = _import; - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestMixDatabaseDataValuePortalService", [ - "BaseRestService", - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-database-data-value/portal"); - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestMvcModuleDataService", [ - "BaseRestService", - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("module-data/mvc"); - var _initForm = async function (moduleId) { - var url = `${this.prefixUrl}/init-form/${moduleId}`; - var req = { - method: "GET", - url: url, - }; - return await commonService.getRestApiResult(req); - }; - serviceFactory.initForm = _initForm; - return serviceFactory; - }, -]); - -'use strict'; -app.factory('RestMvcPostService', ['BaseRestService', - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init('post/mvc'); - // Define more service methods here - return serviceFactory; - }]); - -"use strict"; -app.factory("RestRelatedAttributeDataPortalService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = angular.copy(baseService); - serviceFactory.init("mix-database-data-association/portal"); - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestRelatedMixDatabasePortalService", [ - "BaseRestService", - "CommonService", - function (baseService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("related-mix-database/portal"); - return serviceFactory; - }, -]); - -/*! - * html2canvas 1.0.0-rc.7 - * Copyright (c) 2020 Niklas von Hertzen - * Released under MIT License - */ -!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A=A||self).html2canvas=e()}(this,function(){"use strict"; -/*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */var r=function(A,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)};function A(A,e){function t(){this.constructor=A}r(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var K=function(){return(K=Object.assign||function(A){for(var e,t=1,r=arguments.length;ts[0]&&e[1]>10),s%1024+56320)),(n+1===t||16384>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},o);function o(A,e,t,r,n,B){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=n,this.data=B}function C(A,e,t,r){var n=r[t];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var B=t;B<=r.length;){if((i=r[++B])===e)return!0;if(i!==H)break}if(n===H)for(B=t;0>4,c[i++]=(15&r)<<4|n>>2,c[i++]=(3&n)<<6|63&B;return a}("KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"),U=Array.isArray(i)?function(A){for(var e=A.length,t=[],r=0;r=this._value.length?-1:this._value[A]},yA.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();aA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var r=parseInt(l.apply(void 0,A.map(function(A){return 63===A?48:A})),16),n=parseInt(l.apply(void 0,A.map(function(A){return 63===A?70:A})),16);return{type:sA.UNICODE_RANGE_TOKEN,start:r,end:n}}var B=parseInt(l.apply(void 0,A),16);if(45===this.peekCodePoint(0)&&aA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var s=[];aA(e)&&s.length<6;)s.push(e),e=this.consumeCodePoint();return n=parseInt(l.apply(void 0,s),16),{type:sA.UNICODE_RANGE_TOKEN,start:B,end:n}}return{type:sA.UNICODE_RANGE_TOKEN,start:B,end:B}},yA.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:sA.FUNCTION_TOKEN,value:A}):{type:sA.IDENT_TOKEN,value:A}},yA.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:sA.URL_TOKEN,value:""};var e,t=this.peekCodePoint(0);if(39===t||34===t){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===sA.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:sA.URL_TOKEN,value:r.value}):(this.consumeBadUrlRemnants(),IA)}for(;;){var n=this.consumeCodePoint();if(-1===n||41===n)return{type:sA.URL_TOKEN,value:l.apply(void 0,A)};if(cA(n))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:sA.URL_TOKEN,value:l.apply(void 0,A)}):(this.consumeBadUrlRemnants(),IA);if(34===n||39===n||40===n||0<=(e=n)&&e<=8||11===e||14<=e&&e<=31||127===e)return this.consumeBadUrlRemnants(),IA;if(92===n){if(!uA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),IA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},yA.prototype.consumeWhiteSpace=function(){for(;cA(this.peekCodePoint(0));)this.consumeCodePoint()},yA.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||-1===A)return;uA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},yA.prototype.consumeStringSlice=function(A){for(var e="";0>8,r=255&A>>16,n=255&A>>24;return e<255?"rgba("+n+","+r+","+t+","+e/255+")":"rgb("+n+","+r+","+t+")"}function re(A,e){if(A.type===sA.NUMBER_TOKEN)return A.number;if(A.type!==sA.PERCENTAGE_TOKEN)return 0;var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}function ne(A){var e=A.filter(kA);if(3===e.length){var t=e.map(re),r=t[0],n=t[1],B=t[2];return ue(r,n,B,1)}if(4!==e.length)return 0;var s=e.map(re),o=(r=s[0],n=s[1],B=s[2],s[3]);return ue(r,n,B,o)}var Be=function(A,e){return e===sA.LEFT_CURLY_BRACKET_TOKEN&&A.type===sA.RIGHT_CURLY_BRACKET_TOKEN||(e===sA.LEFT_SQUARE_BRACKET_TOKEN&&A.type===sA.RIGHT_SQUARE_BRACKET_TOKEN||e===sA.LEFT_PARENTHESIS_TOKEN&&A.type===sA.RIGHT_PARENTHESIS_TOKEN)},se={type:sA.NUMBER_TOKEN,number:0,flags:4},oe={type:sA.PERCENTAGE_TOKEN,number:50,flags:4},ie={type:sA.PERCENTAGE_TOKEN,number:100,flags:4},ae=function(A,e){if(A.type===sA.PERCENTAGE_TOKEN)return A.number/100*e;if(xA(A))switch(A.unit){case"rem":case"em":return 16*A.number;case"px":default:return A.number}return A.number},ce=function(A){if(A.type===sA.DIMENSION_TOKEN)switch(A.unit){case"deg":return Math.PI*A.number/180;case"grad":return Math.PI/200*A.number;case"rad":return A.number;case"turn":return 2*Math.PI*A.number}throw new Error("Unsupported angle type")},Qe=function(A){return Math.PI*A/180},we=function(A){if(A.type===sA.FUNCTION){var e=he[A.name];if(void 0===e)throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(A.values)}if(A.type===sA.HASH_TOKEN){if(3===A.value.length){var t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);return ue(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),1)}if(4===A.value.length){t=A.value.substring(0,1),r=A.value.substring(1,2),n=A.value.substring(2,3);var B=A.value.substring(3,4);return ue(parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16),parseInt(B+B,16)/255)}if(6===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6);return ue(parseInt(t,16),parseInt(r,16),parseInt(n,16),1)}if(8===A.value.length){t=A.value.substring(0,2),r=A.value.substring(2,4),n=A.value.substring(4,6),B=A.value.substring(6,8);return ue(parseInt(t,16),parseInt(r,16),parseInt(n,16),parseInt(B,16)/255)}}if(A.type===sA.IDENT_TOKEN){var s=He[A.value.toUpperCase()];if(void 0!==s)return s}return He.TRANSPARENT},ue=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0};function Ue(A,e,t){return t<0&&(t+=1),1<=t&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}function le(A){var e=A.filter(kA),t=e[0],r=e[1],n=e[2],B=e[3],s=(t.type===sA.NUMBER_TOKEN?Qe(t.number):ce(t))/(2*Math.PI),o=qA(r)?r.number/100:0,i=qA(n)?n.number/100:0,a=void 0!==B&&qA(B)?ae(B,1):1;if(0==o)return ue(255*i,255*i,255*i,1);var c=i<=.5?i*(1+o):i+o-i*o,Q=2*i-c,w=Ue(Q,c,s+1/3),u=Ue(Q,c,s),U=Ue(Q,c,s-1/3);return ue(255*w,255*u,255*U,a)}var Ce,ge,Ee,Fe,he={hsl:le,hsla:le,rgb:ne,rgba:ne},He={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(ge=Ce||(Ce={}))[ge.VALUE=0]="VALUE",ge[ge.LIST=1]="LIST",ge[ge.IDENT_VALUE=2]="IDENT_VALUE",ge[ge.TYPE_VALUE=3]="TYPE_VALUE",ge[ge.TOKEN_VALUE=4]="TOKEN_VALUE",(Fe=Ee||(Ee={}))[Fe.BORDER_BOX=0]="BORDER_BOX",Fe[Fe.PADDING_BOX=1]="PADDING_BOX";function de(A){var e=we(A[0]),t=A[1];return t&&qA(t)?{color:e,stop:t}:{color:e,stop:null}}function fe(A,t){var e=A[0],r=A[A.length-1];null===e.stop&&(e.stop=se),null===r.stop&&(r.stop=ie);for(var n=[],B=0,s=0;sA.optimumDistance)?{optimumCorner:e,optimumDistance:n}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner}function Ie(A){var n=Qe(180),B=[];return WA(A).forEach(function(A,e){if(0===e){var t=A[0];if(t.type===sA.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(t.value))return void(n=Ae(A));if($A(t))return void(n=(ce(t)+Qe(270))%Qe(360))}var r=de(A);B.push(r)}),{angle:n,stops:B,type:xe.LINEAR_GRADIENT}}function Te(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]}var me={name:"background-clip",initialValue:"border-box",prefix:!(Fe[Fe.CONTENT_BOX=2]="CONTENT_BOX"),type:Ce.LIST,parse:function(A){return A.map(function(A){if(zA(A))switch(A.value){case"padding-box":return Ee.PADDING_BOX;case"content-box":return Ee.CONTENT_BOX}return Ee.BORDER_BOX})}},Re={name:"background-color",initialValue:"transparent",prefix:!1,type:Ce.TYPE_VALUE,format:"color"},Le=function(A,e,t,r,n){var B="http://www.w3.org/2000/svg",s=document.createElementNS(B,"svg"),o=document.createElementNS(B,"foreignObject");return s.setAttributeNS(null,"width",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},ve=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(r))})},Oe={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var r=e.getBoundingClientRect(),n=Math.round(r.height);if(A.body.removeChild(t),123===n)return!0}}return!1}(document);return Object.defineProperty(Oe,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Oe,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(r){var A=r.createElement("canvas"),n=100;A.width=n,A.height=n;var B=A.getContext("2d");if(!B)return Promise.reject(!1);B.fillStyle="rgb(0, 255, 0)",B.fillRect(0,0,n,n);var e=new Image,s=A.toDataURL();e.src=s;var t=Le(n,n,0,0,e);return B.fillStyle="red",B.fillRect(0,0,n,n),ve(t).then(function(A){B.drawImage(A,0,0);var e=B.getImageData(0,0,n,n).data;B.fillStyle="red",B.fillRect(0,0,n,n);var t=r.createElement("div");return t.style.backgroundImage="url("+s+")",t.style.height="100px",Te(e)?ve(Le(n,n,0,0,t)):Promise.reject(!1)}).then(function(A){return B.drawImage(A,0,0),Te(B.getImageData(0,0,n,n).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Oe,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Oe,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Oe,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Oe,"SUPPORT_CORS_XHR",{value:A}),A}},De=(be.prototype.debug=function(){for(var A=[],e=0;eA.height?new I(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width"),WB(this.referenceElement.ownerDocument,n,B),o.replaceChild(o.adoptNode(this.documentElement),o.documentElement),o.close(),i},xB.prototype.createElementClone=function(A){if(FB(A))return this.createCanvasClone(A);if(rB(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return hB(e)&&"lazy"===e.loading&&(e.loading="eager"),e},xB.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(De.getInstance(this.options.id).error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},xB.prototype.createCanvasClone=function(A){if(this.options.inlineImages&&A.ownerDocument){var e=A.ownerDocument.createElement("img");try{return e.src=A.toDataURL(),e}catch(A){De.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var t=A.cloneNode(!1);try{t.width=A.width,t.height=A.height;var r=A.getContext("2d"),n=t.getContext("2d");return n&&(r?n.putImageData(r.getImageData(0,0,A.width,A.height),0,0):n.drawImage(A,0,0)),t}catch(A){}return t},xB.prototype.cloneNode=function(A){if(cB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(e&&QB(A)&&(wB(A)||uB(A))){var t=this.createElementClone(A),r=e.getComputedStyle(A),n=e.getComputedStyle(A,":before"),B=e.getComputedStyle(A,":after");this.referenceElement===A&&wB(t)&&(this.clonedReferenceElement=t),EB(t)&&$B(t);for(var s=this.counters.parse(new wn(r)),o=this.resolvePseudoContent(A,t,n,LB.BEFORE),i=A.firstChild;i;i=i.nextSibling)QB(i)&&("SCRIPT"===i.tagName||i.hasAttribute(_B)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(i))||this.options.copyStyles&&QB(i)&&rB(i)||t.appendChild(this.cloneNode(i));o&&t.insertBefore(o,t.firstChild);var a=this.resolvePseudoContent(A,t,B,LB.AFTER);return a&&t.appendChild(a),this.counters.pop(s),r&&(this.options.copyStyles||uB(A))&&!HB(A)&&GB(r,t),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([t,A.scrollLeft,A.scrollTop]),(dB(A)||fB(A))&&(dB(t)||fB(t))&&(t.value=A.value),t}return A.cloneNode(!1)},xB.prototype.resolvePseudoContent=function(U,A,e,t){var l=this;if(e){var r=e.content,C=A.ownerDocument;if(C&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==e.display){this.counters.parse(new wn(e));var g=new Qn(e),E=C.createElement("html2canvaspseudoelement");GB(e,E),g.content.forEach(function(A){if(A.type===sA.STRING_TOKEN)E.appendChild(C.createTextNode(A.value));else if(A.type===sA.URL_TOKEN){var e=C.createElement("img");e.src=A.value,e.style.opacity="1",E.appendChild(e)}else if(A.type===sA.FUNCTION){if("attr"===A.name){var t=A.values.filter(zA);t.length&&E.appendChild(C.createTextNode(U.getAttribute(t[0].value)||""))}else if("counter"===A.name){var r=A.values.filter(kA),n=r[0],B=r[1];if(n&&zA(n)){var s=l.counters.getCounterValue(n.value),o=B&&zA(B)?ir.parse(B.value):tr.DECIMAL;E.appendChild(C.createTextNode(yB(s,o,!1)))}}else if("counters"===A.name){var i=A.values.filter(kA),a=(n=i[0],i[1]);if(B=i[2],n&&zA(n)){var c=l.counters.getCounterValues(n.value),Q=B&&zA(B)?ir.parse(B.value):tr.DECIMAL,w=a&&a.type===sA.STRING_TOKEN?a.value:"",u=c.map(function(A){return yB(A,Q,!1)}).join(w);E.appendChild(C.createTextNode(u))}}}else if(A.type===sA.IDENT_TOKEN)switch(A.value){case"open-quote":E.appendChild(C.createTextNode(An(g.quotes,l.quoteDepth++,!0)));break;case"close-quote":E.appendChild(C.createTextNode(An(g.quotes,--l.quoteDepth,!1)));break;default:E.appendChild(C.createTextNode(A.value))}}),E.className=qB+" "+ZB;var n=t===LB.BEFORE?" "+qB:" "+ZB;return uB(A)?A.className.baseValue+=n:A.className+=n,E}}},xB.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},xB);function xB(A,e){if(this.options=e,this.scrolledElements=[],this.referenceElement=A,this.counters=new pB,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement)}(vB=LB||(LB={}))[vB.BEFORE=0]="BEFORE",vB[vB.AFTER=1]="AFTER";var VB,zB,XB=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(_B,"true"),A.body.appendChild(t),t},JB=function(n){return new Promise(function(e,A){var t=n.contentWindow;if(!t)return A("No window assigned for iframe");var r=t.document;t.onload=n.onload=r.onreadystatechange=function(){t.onload=n.onload=r.onreadystatechange=null;var A=setInterval(function(){0"),e},WB=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},YB=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},qB="___html2canvas___pseudoelement_before",ZB="___html2canvas___pseudoelement_after",jB='{\n content: "" !important;\n display: none !important;\n}',$B=function(A){As(A,"."+qB+":before"+jB+"\n ."+ZB+":after"+jB)},As=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}};(zB=VB||(VB={}))[zB.VECTOR=0]="VECTOR",zB[zB.BEZIER_CURVE=1]="BEZIER_CURVE";function es(A,t){return A.length===t.length&&A.some(function(A,e){return A===t[e]})}var ts=(rs.prototype.add=function(A,e){return new rs(this.x+A,this.y+e)},rs);function rs(A,e){this.type=VB.VECTOR,this.x=A,this.y=e}function ns(A,e,t){return new ts(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)}var Bs=(ss.prototype.subdivide=function(A,e){var t=ns(this.start,this.startControl,A),r=ns(this.startControl,this.endControl,A),n=ns(this.endControl,this.end,A),B=ns(t,r,A),s=ns(r,n,A),o=ns(B,s,A);return e?new ss(this.start,t,B,o):new ss(o,s,n,this.end)},ss.prototype.add=function(A,e){return new ss(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},ss.prototype.reverse=function(){return new ss(this.end,this.endControl,this.startControl,this.start)},ss);function ss(A,e,t,r){this.type=VB.BEZIER_CURVE,this.start=A,this.startControl=e,this.endControl=t,this.end=r}function os(A){return A.type===VB.BEZIER_CURVE}var is,as,cs=function(A){var e=A.styles,t=A.bounds,r=jA(e.borderTopLeftRadius,t.width,t.height),n=r[0],B=r[1],s=jA(e.borderTopRightRadius,t.width,t.height),o=s[0],i=s[1],a=jA(e.borderBottomRightRadius,t.width,t.height),c=a[0],Q=a[1],w=jA(e.borderBottomLeftRadius,t.width,t.height),u=w[0],U=w[1],l=[];l.push((n+o)/t.width),l.push((u+c)/t.width),l.push((B+U)/t.height),l.push((i+Q)/t.height);var C=Math.max.apply(Math,l);1t.width+p?0:o-p,i-H,is.TOP_RIGHT):new ts(t.left+t.width-d,t.top+H),this.bottomRightPaddingBox=0t.width+p+T?0:o-p+T,i-(H+N),is.TOP_RIGHT):new ts(t.left+t.width-(d+K),t.top+H+N),this.bottomRightContentBox=0A.element.container.styles.zIndex.order?(i=e,!1):0=A.element.container.styles.zIndex.order?(a=e+1,!1):0=200&&xhr.status<300){resolve(new _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"](xhr.status,xhr.statusText,xhr.response||xhr.responseText))}else{reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText,xhr.status))}};xhr.onerror=function(){_this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning,"Error from HTTP request. "+xhr.status+": "+xhr.statusText+".");reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText,xhr.status))};xhr.ontimeout=function(){_this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning,"Timeout from HTTP request.");reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"])};xhr.send(request.content||"")})};return XhrHttpClient}(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"LogLevel",function(){return LogLevel});var LogLevel;(function(LogLevel){LogLevel[LogLevel["Trace"]=0]="Trace";LogLevel[LogLevel["Debug"]=1]="Debug";LogLevel[LogLevel["Information"]=2]="Information";LogLevel[LogLevel["Warning"]=3]="Warning";LogLevel[LogLevel["Error"]=4]="Error";LogLevel[LogLevel["Critical"]=5]="Critical";LogLevel[LogLevel["None"]=6]="None"})(LogLevel||(LogLevel={}))},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"HubConnectionState",function(){return HubConnectionState});__webpack_require__.d(__webpack_exports__,"HubConnection",function(){return HubConnection});var _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(11);var _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(15);var _ILogger__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9);var _Subject__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(16);var _Utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(13);var __awaiter=undefined&&undefined.__awaiter||function(thisArg,_arguments,P,generator){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):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=undefined&&undefined.__generator||function(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]responseLength?binaryData.slice(responseLength).buffer:null}else{var textData=data;var separatorIndex=textData.indexOf(_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].RecordSeparator);if(separatorIndex===-1){throw new Error("Message is incomplete.")}var responseLength=separatorIndex+1;messageData=textData.substring(0,responseLength);remainingData=textData.length>responseLength?textData.substring(responseLength):null}var messages=_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].parse(messageData);var response=JSON.parse(messages[0]);if(response.type){throw new Error("Expected a handshake response from the server.")}responseMessage=response;return[remainingData,responseMessage]};return HandshakeProtocol}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"TextMessageFormat",function(){return TextMessageFormat});var TextMessageFormat=function(){function TextMessageFormat(){}TextMessageFormat.write=function(output){return""+output+TextMessageFormat.RecordSeparator};TextMessageFormat.parse=function(input){if(input[input.length-1]!==TextMessageFormat.RecordSeparator){throw new Error("Message is incomplete.")}var messages=input.split(TextMessageFormat.RecordSeparator);messages.pop();return messages};TextMessageFormat.RecordSeparatorCode=30;TextMessageFormat.RecordSeparator=String.fromCharCode(TextMessageFormat.RecordSeparatorCode);return TextMessageFormat}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"Arg",function(){return Arg});__webpack_require__.d(__webpack_exports__,"Platform",function(){return Platform});__webpack_require__.d(__webpack_exports__,"getDataDetail",function(){return getDataDetail});__webpack_require__.d(__webpack_exports__,"formatArrayBuffer",function(){return formatArrayBuffer});__webpack_require__.d(__webpack_exports__,"isArrayBuffer",function(){return isArrayBuffer});__webpack_require__.d(__webpack_exports__,"sendMessage",function(){return sendMessage});__webpack_require__.d(__webpack_exports__,"createLogger",function(){return createLogger});__webpack_require__.d(__webpack_exports__,"SubjectSubscription",function(){return SubjectSubscription});__webpack_require__.d(__webpack_exports__,"ConsoleLogger",function(){return ConsoleLogger});var _ILogger__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9);var _Loggers__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(14);var __awaiter=undefined&&undefined.__awaiter||function(thisArg,_arguments,P,generator){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):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=undefined&&undefined.__generator||function(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]-1){this.subject.observers.splice(index,1)}if(this.subject.observers.length===0&&this.subject.cancelCallback){this.subject.cancelCallback().catch(function(_){})}};return SubjectSubscription}();var ConsoleLogger=function(){function ConsoleLogger(minimumLogLevel){this.minimumLogLevel=minimumLogLevel;this.outputConsole=console}ConsoleLogger.prototype.log=function(logLevel,message){if(logLevel>=this.minimumLogLevel){switch(logLevel){case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Critical:case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel]+": "+message);break;case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel]+": "+message);break;case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel]+": "+message);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel]+": "+message);break}}};return ConsoleLogger}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"NullLogger",function(){return NullLogger});var NullLogger=function(){function NullLogger(){}NullLogger.prototype.log=function(_logLevel,_message){};NullLogger.instance=new NullLogger;return NullLogger}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"MessageType",function(){return MessageType});var MessageType;(function(MessageType){MessageType[MessageType["Invocation"]=1]="Invocation";MessageType[MessageType["StreamItem"]=2]="StreamItem";MessageType[MessageType["Completion"]=3]="Completion";MessageType[MessageType["StreamInvocation"]=4]="StreamInvocation";MessageType[MessageType["CancelInvocation"]=5]="CancelInvocation";MessageType[MessageType["Ping"]=6]="Ping";MessageType[MessageType["Close"]=7]="Close"})(MessageType||(MessageType={}))},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"Subject",function(){return Subject});var _Utils__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(13);var Subject=function(){function Subject(){this.observers=[]}Subject.prototype.next=function(item){for(var _i=0,_a=this.observers;_i<_a.length;_i++){var observer=_a[_i];observer.next(item)}};Subject.prototype.error=function(err){for(var _i=0,_a=this.observers;_i<_a.length;_i++){var observer=_a[_i];if(observer.error){observer.error(err)}}};Subject.prototype.complete=function(){for(var _i=0,_a=this.observers;_i<_a.length;_i++){var observer=_a[_i];if(observer.complete){observer.complete()}}};Subject.prototype.subscribe=function(observer){this.observers.push(observer);return new _Utils__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscription"](this,observer)};return Subject}()},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,"HubConnectionBuilder",function(){return HubConnectionBuilder});var _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(18);var _HttpConnection__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(19);var _HubConnection__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(10);var _ILogger__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(9);var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(25);var _Loggers__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(14);var _Utils__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(13);var __assign=undefined&&undefined.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0){return[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+transportExceptions.join(" ")))]}return[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})};HttpConnection.prototype.constructTransport=function(transport){switch(transport){case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets:if(!this.options.WebSocket){throw new Error("'WebSocket' is not supported in your environment.")}return new _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__["WebSocketTransport"](this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||false,this.options.WebSocket);case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents:if(!this.options.EventSource){throw new Error("'EventSource' is not supported in your environment.")}return new _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__["ServerSentEventsTransport"](this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||false,this.options.EventSource);case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].LongPolling:return new _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__["LongPollingTransport"](this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||false);default:throw new Error("Unknown transport: "+transport+".")}};HttpConnection.prototype.startTransport=function(url,transferFormat){var _this=this;this.transport.onreceive=this.onreceive;this.transport.onclose=function(e){return _this.stopConnection(e)};return this.transport.connect(url,transferFormat)};HttpConnection.prototype.resolveTransportOrError=function(endpoint,requestedTransport,requestedTransferFormat){var transport=_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][endpoint.transport];if(transport===null||transport===undefined){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Skipping transport '"+endpoint.transport+"' because it is not supported by this client.");return new Error("Skipping transport '"+endpoint.transport+"' because it is not supported by this client.")}else{if(transportMatches(requestedTransport,transport)){var transferFormats=endpoint.transferFormats.map(function(s){return _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][s]});if(transferFormats.indexOf(requestedTransferFormat)>=0){if(transport===_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets&&!this.options.WebSocket||transport===_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents&&!this.options.EventSource){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Skipping transport '"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' because it is not supported in your environment.'");return new Error("'"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' is not supported in your environment.")}else{this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Selecting transport '"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"'.");try{return this.constructTransport(transport)}catch(ex){return ex}}}else{this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Skipping transport '"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' because it does not support the requested transfer format '"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat]+"'.");return new Error("'"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' does not support "+_ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat]+".")}}else{this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Skipping transport '"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' because it was disabled by the client.");return new Error("'"+_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport]+"' is disabled by the client.")}}};HttpConnection.prototype.isITransport=function(transport){return transport&&typeof transport==="object"&&"connect"in transport};HttpConnection.prototype.stopConnection=function(error){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"HttpConnection.stopConnection("+error+") called while in state "+this.connectionState+".");this.transport=undefined;error=this.stopError||error;this.stopError=undefined;if(this.connectionState==="Disconnected"){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug,"Call to HttpConnection.stopConnection("+error+") was ignored because the connection is already in the disconnected state.");return}if(this.connectionState==="Connecting "){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Warning,"Call to HttpConnection.stopConnection("+error+") was ignored because the connection hasn't yet left the in the connecting state.");return}if(this.connectionState==="Disconnecting"){this.stopPromiseResolver()}if(error){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error,"Connection disconnected with error '"+error+"'.")}else{this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information,"Connection disconnected.")}this.connectionId=undefined;this.connectionState="Disconnected";if(this.onclose&&this.connectionStarted){this.connectionStarted=false;try{this.onclose(error)}catch(e){this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error,"HttpConnection.onclose("+error+") threw error '"+e+"'.")}}};HttpConnection.prototype.resolveUrl=function(url){if(url.lastIndexOf("https://",0)===0||url.lastIndexOf("http://",0)===0){return url}if(!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isBrowser||!window.document){throw new Error("Cannot resolve '"+url+"'.")}var aTag=window.document.createElement("a");aTag.href=url;this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information,"Normalizing '"+url+"' to '"+aTag.href+"'.");return aTag.href};HttpConnection.prototype.resolveNegotiateUrl=function(url){var index=url.indexOf("?");var negotiateUrl=url.substring(0,index===-1?url.length:index);if(negotiateUrl[negotiateUrl.length-1]!=="/"){negotiateUrl+="/"}negotiateUrl+="negotiate";negotiateUrl+=index===-1?"":url.substring(index);if(negotiateUrl.indexOf("negotiateVersion")===-1){negotiateUrl+=index===-1?"?":"&";negotiateUrl+="negotiateVersion="+this.negotiateVersion}return negotiateUrl};return HttpConnection}();function transportMatches(requestedTransport,actualTransport){return!requestedTransport||(actualTransport&requestedTransport)!==0}var TransportSendQueue=function(){function TransportSendQueue(transport){this.transport=transport;this.buffer=[];this.executing=true;this.sendBufferedData=new PromiseSource;this.transportResult=new PromiseSource;this.sendLoopPromise=this.sendLoop()}TransportSendQueue.prototype.send=function(data){this.bufferData(data);if(!this.transportResult){this.transportResult=new PromiseSource}return this.transportResult.promise};TransportSendQueue.prototype.stop=function(){this.executing=false;this.sendBufferedData.resolve();return this.sendLoopPromise};TransportSendQueue.prototype.bufferData=function(data){if(this.buffer.length&&typeof this.buffer[0]!==typeof data){throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof data)}this.buffer.push(data);this.sendBufferedData.resolve()};TransportSendQueue.prototype.sendLoop=function(){return __awaiter(this,void 0,void 0,function(){var transportResult,data,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(false){}return[4,this.sendBufferedData.promise];case 1:_a.sent();if(!this.executing){if(this.transportResult){this.transportResult.reject("Connection stopped.")}return[3,6]}this.sendBufferedData=new PromiseSource;transportResult=this.transportResult;this.transportResult=undefined;data=typeof this.buffer[0]==="string"?this.buffer.join(""):TransportSendQueue.concatBuffers(this.buffer);this.buffer.length=0;_a.label=2;case 2:_a.trys.push([2,4,,5]);return[4,this.transport.send(data)];case 3:_a.sent();transportResult.resolve();return[3,5];case 4:error_1=_a.sent();transportResult.reject(error_1);return[3,5];case 5:return[3,0];case 6:return[2]}})})};TransportSendQueue.concatBuffers=function(arrayBuffers){var totalLength=arrayBuffers.map(function(b){return b.byteLength}).reduce(function(a,b){return a+b});var result=new Uint8Array(totalLength);var offset=0;for(var _i=0,arrayBuffers_1=arrayBuffers;_i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]Your Font/Glyphs

    Your font contains the following glyphs

    The generated SVG font can be imported back to IcoMoon for modification.

    Class Names

     icon-camera  icon-camera-2  icon-mic  icon-mic-2  icon-phone-hang-up  icon-phone-hang-up-2  icon-call-outgoing  icon-bubble-dots  icon-spinner  icon-cancel-circle  icon-cancel-circle-2  icon-checkmark-circle  icon-checkmark-circle-2  icon-cancel  icon-spam  icon-info  icon-chrome  icon-firefox  icon-IE  icon-opera  icon-safari  icon-IcoMoon  icon-html5  icon-css3  icon-html5-2  icon-calculate  icon-calculate-2  icon-support  icon-phone  icon-contact-add  icon-contact-remove  icon-contact-add-2  icon-spinner-2  icon-checkmark  icon-checkmark-2  icon-checkmark-3  icon-contact-remove-2  icon-call-incoming  icon-phone-2  icon-phone-3  icon-grid  icon-spinner-3  icon-phone-4  icon-phone-5  icon-user  icon-user-2  icon-happy  icon-happy-2  icon-smiley  icon-smiley-2  icon-tongue  icon-tongue-2  icon-sad  icon-sad-2  icon-wink  icon-wink-2  icon-grin  icon-grin-2  icon-cool  icon-cool-2  icon-angry  icon-angry-2  icon-evil  icon-evil-2  icon-shocked  icon-shocked-2  icon-confused  icon-confused-2  icon-neutral  icon-neutral-2  icon-wondering  icon-wondering-2  icon-warning  icon-notification  icon-question  icon-question-2  icon-point-up  icon-twitter
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/add-to-cart-button/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/add-to-cart-button/view.html deleted file mode 100644 index 61bf219da..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/add-to-cart-button/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/booking/index.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/booking/index.html deleted file mode 100644 index 14bf11ff2..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/booking/index.html +++ /dev/null @@ -1 +0,0 @@ -
    Thank you for booking our service
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/customs/order/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/customs/order/view.html deleted file mode 100644 index 8d14d180d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/customs/order/view.html +++ /dev/null @@ -1 +0,0 @@ -

     TV Model Qty Units Sub-dealer Reward - +
    - +
     TOTAL

     TV Model Qty Units
    - +
     TOTAL
     Sub-dealer Reward
    - +
    FINAL TOTAL UNIT
    Final Gift
    FINAL TOTAL UNIT
    Final Gifts
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/fb-login/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/fb-login/view.html deleted file mode 100644 index 0bbcd098d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/fb-login/view.html +++ /dev/null @@ -1 +0,0 @@ -

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/google-pay/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/google-pay/view.html deleted file mode 100644 index acb688853..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/google-pay/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/mix-messages-hub-client/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/mix-messages-hub-client/view.html deleted file mode 100644 index 779be29b9..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/mix-messages-hub-client/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Save Data

    • {{m.name}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/service-hub-client/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/service-hub-client/view.html deleted file mode 100644 index 2a868af7a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/service-hub-client/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Save Data

    • {{m.name}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/shopping-cart/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/shopping-cart/view.html deleted file mode 100644 index 1459999da..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/shopping-cart/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/video-chat-hub/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/video-chat-hub/view.html deleted file mode 100644 index fdb46ed5e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/components/video-chat-hub/view.html +++ /dev/null @@ -1 +0,0 @@ -

    Look Up!

    Your browser should be asking you to enable your webcam and microphone. This site will not work until you provide access.

    Your browser does not appear to support WebRTC.

    Try either the latest Firefox nightly build, or Google Chrome Beta to join the fun.
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/shopping-cart/shopping-cart/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/shopping-cart/shopping-cart/view.html deleted file mode 100644 index 1459999da..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-client/shopping-cart/shopping-cart/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step1/index.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step1/index.html deleted file mode 100644 index 225ea7c2b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step1/index.html +++ /dev/null @@ -1 +0,0 @@ -

    Hi there! Let start the first steps together.

    Database Configuration
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step2/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step2/view.html deleted file mode 100644 index ba31f63ea..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step2/view.html +++ /dev/null @@ -1 +0,0 @@ -

    We are now creating your most powerful account!

    * Please keep this account credential safe and only share this account to your most trusted person!

    You must agree before submitting.
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step3/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step3/view.html deleted file mode 100644 index 093901c43..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step3/view.html +++ /dev/null @@ -1 +0,0 @@ -

    You can start Mixcore with blank theme or with our default beautiful themes.

    Mixcore Themes list.
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/common-languages/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/common-languages/view.html deleted file mode 100644 index 8ec54788b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/common-languages/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/portal-languages/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/portal-languages/view.html deleted file mode 100644 index 8ec54788b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/components/portal-languages/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/view.html deleted file mode 100644 index bcf7c7e7d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step4/view.html +++ /dev/null @@ -1 +0,0 @@ -

    Let's name it your way!


    You can customize your beautiful your user portal that more suitable for you and your team. eg. You can change "Posts" term to "Articles"...


    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step5/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step5/view.html deleted file mode 100644 index ad814f177..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-init/pages/step5/view.html +++ /dev/null @@ -1,6 +0,0 @@ -

    Hooray! Almost there...

    You can start mixcore by choosing our beautiful themes.
    Then click Create the website to launch.


    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/actions/actions.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/actions/actions.html deleted file mode 100644 index 5993cfac1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/actions/actions.html +++ /dev/null @@ -1 +0,0 @@ -
    Preview Data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-field/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-field/view.html deleted file mode 100644 index 95d49fca4..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-field/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Additional Data Columns
    Column:
    Type {{col.dataType}}
    Width
    Height


    Column:
    Type
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-value/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-value/view.html deleted file mode 100644 index bce515749..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/additional-value/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Database
    {{ctrl.additionalData}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/custom-image/custom-image.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/custom-image/custom-image.html deleted file mode 100644 index 842b701ec..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/custom-image/custom-image.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/filter-list/filter-list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/filter-list/filter-list.html deleted file mode 100644 index f6407605f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/filter-list/filter-list.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/funding/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/funding/view.html deleted file mode 100644 index b16547880..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/funding/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Sponsor mixcore/mix.core
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-contributers/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-contributers/view.html deleted file mode 100644 index 083c2c07a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-contributers/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Contributers
    {{item.login}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-releases/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-releases/view.html deleted file mode 100644 index 734a4c859..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/github-releases/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Mixcore CMS Releases
    • {{item.published_at | date:'medium'}} - {{item.tag_name}} {{item.prerelease? '(Prerelease)' : ''}} [ Read | Zip ]
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/google-analytic/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/google-analytic/view.html deleted file mode 100644 index 3652a4bfb..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/google-analytic/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Google Analytics
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/header-nav/headerNav.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/header-nav/headerNav.html deleted file mode 100644 index 5c78fe8cc..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/header-nav/headerNav.html +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/hub-messages/hub-messages.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/hub-messages/hub-messages.html deleted file mode 100644 index adb1fe5b5..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/hub-messages/hub-messages.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/json-builder/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/json-builder/view.html deleted file mode 100644 index b7d08bdaf..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/json-builder/view.html +++ /dev/null @@ -1,93 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/list-mix-column/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/list-mix-column/view.html deleted file mode 100644 index 8b66186be..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/list-mix-column/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Column name:
    Type {{col.dataType}}
    Config
    Width
    Height
    Regular Expression
    Input option value

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-dynamic/main-side-bar-dynamic.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-dynamic/main-side-bar-dynamic.html deleted file mode 100644 index e3eb8ad7c..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-dynamic/main-side-bar-dynamic.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html deleted file mode 100644 index ff3f53675..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html deleted file mode 100644 index 3aa104c72..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html deleted file mode 100644 index 9637cb5f6..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-file-upload/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-file-upload/view.html deleted file mode 100644 index d105a197a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-file-upload/view.html +++ /dev/null @@ -1 +0,0 @@ -
    {{$ctrl.header}}
    View
    URL
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-upload/media-upload.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-upload/media-upload.html deleted file mode 100644 index afb1cbe64..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/media-upload/media-upload.html +++ /dev/null @@ -1 +0,0 @@ -
    Upload media/file
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/medium-news/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/medium-news/view.html deleted file mode 100644 index 293fe09c2..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/medium-news/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Blog & News
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-column/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-column/view.html deleted file mode 100644 index 00772dc00..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-column/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Column:
    Type {{$ctrl.column.dataType}}
    Width
    Height


    Column:
    Type
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-filter/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-filter/view.html deleted file mode 100644 index 11fc8b134..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-filter/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-value-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-value-editor/view.html deleted file mode 100644 index 43b0bb58b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-value-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    ({{$ctrl.mixDatabaseDataValue.dataType}})

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-values/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-values/view.html deleted file mode 100644 index d11c5be73..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-data-values/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-form/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-form/view.html deleted file mode 100644 index c429a0077..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-form/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Back to list Search links
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-data/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-data/view.html deleted file mode 100644 index c8919c249..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-data/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-values/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-values/view.html deleted file mode 100644 index a50e0d5dc..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-nav-values/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Loading...
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-navs/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-navs/view.html deleted file mode 100644 index 40c7f74c6..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-database-navs/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-file-upload/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-file-upload/view.html deleted file mode 100644 index fe1b81aac..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-file-upload/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-navigations/mix-navigations.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-navigations/mix-navigations.html deleted file mode 100644 index 2fc1a27b9..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-navigations/mix-navigations.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-template-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-template-editor/view.html deleted file mode 100644 index 4654128c0..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-template-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    {{$ctrl.folderType}} template editor Edit {{$ctrl.folderType}} Template
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-value-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-value-editor/view.html deleted file mode 100644 index 22390e1a3..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/mix-value-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-content-filter/modal-content-filter.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-content-filter/modal-content-filter.html deleted file mode 100644 index 892a2a1b8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-content-filter/modal-content-filter.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-datas/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-datas/view.html deleted file mode 100644 index 091625a82..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-datas/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Category
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-metas/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-metas/view.html deleted file mode 100644 index 411d16cf0..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-nav-metas/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-navs/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-navs/view.html deleted file mode 100644 index 430c08a06..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-navs/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-permission/modal-permission.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-permission/modal-permission.html deleted file mode 100644 index 0e33698ee..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/modal-permission/modal-permission.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/monaco-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/monaco-editor/view.html deleted file mode 100644 index 5b14cff56..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/monaco-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/navigations/navigations.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/navigations/navigations.html deleted file mode 100644 index 8ee36ded0..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/navigations/navigations.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-structure/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-structure/view.html deleted file mode 100644 index 599af254b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-structure/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Simple Data
    TitleTypeUniqueRequiredSelectDisplay
    Name:
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-value/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-value/view.html deleted file mode 100644 index 98f6b4a27..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/properties-value/view.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleValue

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/related-navigations/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/related-navigations/view.html deleted file mode 100644 index 36f3dd200..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/related-navigations/view.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageActived
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/service-hub-portal/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/service-hub-portal/view.html deleted file mode 100644 index 750926a08..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/service-hub-portal/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Save Data

    • {{m.name}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/template-editor/templateEditor.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/template-editor/templateEditor.html deleted file mode 100644 index eda8417e7..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/components/template-editor/templateEditor.html +++ /dev/null @@ -1 +0,0 @@ -
    {{$ctrl.folderType}} Template Viewer Edit {{$ctrl.folderType}} Template
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/auth/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/auth/view.html deleted file mode 100644 index 6df20415d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/auth/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/default/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/default/view.html deleted file mode 100644 index e9610a9f8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/default/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/general/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/general/view.html deleted file mode 100644 index d741fb44c..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/general/view.html +++ /dev/null @@ -1 +0,0 @@ -
    General Settings
    Secure Back-office
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/demo.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/demo.html deleted file mode 100644 index 96e1b385e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/demo.html +++ /dev/null @@ -1,14 +0,0 @@ -

    Dropzone {{zone}}

    New Elements

    Selected

    Type: {{$ctrl.models.selected.type}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/item.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/item.html deleted file mode 100644 index 34c6b1da6..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/components/portal-menus/item.html +++ /dev/null @@ -1 +0,0 @@ -
    :::
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/details.html deleted file mode 100644 index 64052534b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/app-settings/details.html +++ /dev/null @@ -1 +0,0 @@ -

    App settings

    Use the filter side bar on the right to filter and search your settings.

    Localization Add new List strings

    Manage your multilingual site contents.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/details.html deleted file mode 100644 index 297e4fda5..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create new configuration

    Use the filter side bar on the right to filter and search your settings.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/list.html deleted file mode 100644 index 2779f6139..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/configuration/list.html +++ /dev/null @@ -1 +0,0 @@ -

    System Setting List

    Use the filter side bar on the right to filter and search your settings.

    Setting KeyDescriptionValueCategoryActions
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/details.html deleted file mode 100644 index 7a6cea11f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Add language

    Fill all of the following fields to add a new language.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/list.html deleted file mode 100644 index 3ec01d352..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/culture/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Language List

    Use the filter side bar on the right to filter and search your site languages.

    IconNameAliasSpecificultureActions
    {{item.fullName}}{{item.alias}}{{item.specificulture}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/details.html deleted file mode 100644 index 0dc0badfc..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/details.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/list.html deleted file mode 100644 index 4a9d3e18a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/customer/list.html +++ /dev/null @@ -1 +0,0 @@ -
    First NameLast NameFull NamePhoneDOBTotal VisitMoney
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/dashboard/dashboard.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/dashboard/dashboard.html deleted file mode 100644 index 2177af08b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/dashboard/dashboard.html +++ /dev/null @@ -1 +0,0 @@ -

    Dashboard

    You can see some of the news and information of your site and Mixcore CMS here.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/details.html deleted file mode 100644 index 525250015..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/details.html +++ /dev/null @@ -1 +0,0 @@ -

    File edit

    You are now editing /{{activedFile.fileFolder}}{{activedFile.webPath}} file. Please be carefull.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/list.html deleted file mode 100644 index 4f69ef183..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/file/list.html +++ /dev/null @@ -1 +0,0 @@ -

    File list

    The table below display all of the files within your content and assets folders.

    NameWebPathPreviewActions
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/form/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/form/list.html deleted file mode 100644 index cf9e2b09e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/form/list.html +++ /dev/null @@ -1 +0,0 @@ -
    CodeTitleImageCreated DateAuthor
    {{item.code}}{{item.title}}
    {{item.excerpt}}
    {{item.createdDateTime | utcToLocal}}{{item.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/import/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/import/details.html deleted file mode 100644 index bdf7aed98..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/import/details.html +++ /dev/null @@ -1 +0,0 @@ -
    {{prettyJsonObj(viewModel)}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/json-data/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/json-data/list.html deleted file mode 100644 index ecacbd292..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/json-data/list.html +++ /dev/null @@ -1 +0,0 @@ -
    NameWebPathPreviewActions

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/details.html deleted file mode 100644 index 07b3fecbd..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Translate Resource

    Fill all of the following fields to create a new resource.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/list.html deleted file mode 100644 index d93a28502..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/localize/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Translate Resource List

    Use the filter side bar on the right to filter and search your resource.

    KeywordValueDefault ValueCategory
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/details.html deleted file mode 100644 index 55ca27e3e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create new media/file

    Use the upload side bar on the right to upload new media/file.

    Media Info
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list-grid.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list-grid.html deleted file mode 100644 index aae4bf45b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list-grid.html +++ /dev/null @@ -1 +0,0 @@ -
    {{item.title}}
    by {{item.author}} in {{item.category}} - {{item.createdDateTime | utcToLocal:'d.M.yyyy h:mm a'}}
    Filter
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list.html deleted file mode 100644 index c4d1aa3d3..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/media/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Media list

    Use the filter side bar on the right to filter and search your medias.

    TitlePathImageCreated Date
    {{item.title}}
    {{item.createdDateTime | utcToLocal:'d.M.yyyy h:mm a'}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/details.html deleted file mode 100644 index 4b5a14095..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create {{mixDatabaseTitle}}'s data

    Fill all of the following fields to create a new data for {{mixDatabaseTitle}} database.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/list.html deleted file mode 100644 index fc4ad7267..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/list.html +++ /dev/null @@ -1 +0,0 @@ -

    {{mixDatabaseTitle}}'s data

    This list is show all of the total items existing in {{mixDatabaseTitle}} database.

    Total items:
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/navigation.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/navigation.html deleted file mode 100644 index 525945db1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database-data/navigation.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/components/main/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/components/main/view.html deleted file mode 100644 index 587993625..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/components/main/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/details.html deleted file mode 100644 index e37f0f6a4..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create/Update Database

    Dynamic database to allow you design any web/mobile applications.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/list.html deleted file mode 100644 index 88b536bd3..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/mix-database/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Database list

    Use the filter side bar on the right to filter and search your database.

    DatabaseNameTypeCreated Date
    {{item.title}}{{item.name}}{{item.model.type}}{{item.createdDateTime | utcToLocal}}
    Apply
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/details.html deleted file mode 100644 index be2e1303d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/details.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/list.html deleted file mode 100644 index 569f97b87..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-data/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Module's Data

    Use the filter side bar on the right to filter and search your module's data.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-gallery/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-gallery/list.html deleted file mode 100644 index 6f91dd198..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-gallery/list.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/details.html deleted file mode 100644 index abb315fa7..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/details.html +++ /dev/null @@ -1 +0,0 @@ -
    Create new configuration
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/list.html deleted file mode 100644 index 38514bfab..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module-post/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Page list

    Use the filter side bar on the right to filter and search your pages.

    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    Note: Drag Drop only allow when order by priority asc
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/main/main.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/main/main.html deleted file mode 100644 index 4a1ed8e98..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/main/main.html +++ /dev/null @@ -1 +0,0 @@ -
    This system name is using within the template code.
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-advanced/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-advanced/view.html deleted file mode 100644 index 7b365ea84..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-advanced/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-content/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-content/view.html deleted file mode 100644 index 9fd52c30f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-content/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-type/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-type/view.html deleted file mode 100644 index 6f95ba7ef..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/components/module-type/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Module types {{type}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/data.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/data.html deleted file mode 100644 index 164f83b77..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/data.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/details.html deleted file mode 100644 index 98dd32054..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Module

    Fill all of the following fields to create a new module.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/list.html deleted file mode 100644 index 18a70ce1e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/module/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Module list

    Use the filter side bar on the right to filter and search your modules.

    ModuleNameCreated DateImage
    {{item.title}}{{item.name}}{{item.lastModified | utcToLocal:'d.M.yyyy h:mm a'}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/moduleData/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/moduleData/details.html deleted file mode 100644 index d695af260..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/moduleData/details.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-gallery/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-gallery/list.html deleted file mode 100644 index 498c8cded..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-gallery/list.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-page/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-page/list.html deleted file mode 100644 index ff9db24fd..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-page/list.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-position/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-position/list.html deleted file mode 100644 index 9bbdf4960..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-position/list.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-post/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-post/list.html deleted file mode 100644 index 2ecaeb304..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page-post/list.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/general/general.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/general/general.html deleted file mode 100644 index d8adb2e3e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/general/general.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/main/main.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/main/main.html deleted file mode 100644 index c419b0ca1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/main/main.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/modules/modules.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/modules/modules.html deleted file mode 100644 index 83a56e8d8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/modules/modules.html +++ /dev/null @@ -1 +0,0 @@ -
    No module created yet...
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-advanced/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-advanced/view.html deleted file mode 100644 index 5737ce4c1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-advanced/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-content/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-content/view.html deleted file mode 100644 index f2f7ad28b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-content/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-type/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-type/view.html deleted file mode 100644 index f4bf0badd..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/page-type/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Page types
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/related/productRelated.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/related/productRelated.html deleted file mode 100644 index 1f6192d15..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/components/related/productRelated.html +++ /dev/null @@ -1 +0,0 @@ -
    Selected items
    List items
    TitleImageDisplay
    {{product.title}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/data.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/data.html deleted file mode 100644 index 92a5f5659..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/data.html +++ /dev/null @@ -1 +0,0 @@ -
    TitleImageCreated DateAuthor
    {{item.post.title}}
    {{item.post.createdDateTime | utcToLocal}}{{item.post.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/details.html deleted file mode 100644 index d53372e60..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Page

    Fill all of the following fields to create a new page.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/list.html deleted file mode 100644 index 7e3a69b79..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/page/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Page list

    Use the filter side bar on the right to filter and search your pages.

    PageExcerptCreated DateAuthor
    {{item.title}}{{shortString(item.excerpt,50)}}{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}{{item.createdBy}}
    TitleExcerptCreated DateAuthor
    {{c.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}{{c.page.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/main/main.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/main/main.html deleted file mode 100644 index 9ceb7a7ec..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/main/main.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/parents/parents.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/parents/parents.html deleted file mode 100644 index 75d79fd01..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/parents/parents.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html deleted file mode 100644 index 30fe40035..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/details.html deleted file mode 100644 index 3217404f8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Permission

    Fill all of the following fields to create a new permission.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/list.html deleted file mode 100644 index 3f5c3f217..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/permission/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Permission List

    Use the filter side bar on the right to filter and search your permissions.

    KeywordDefaultUrlCreated Date
    {{item.post.createdDateTime | utcToLocal}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/main/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/main/view.html deleted file mode 100644 index 0c3da95b0..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/main/view.html +++ /dev/null @@ -1,2 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/modules/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/modules/view.html deleted file mode 100644 index f1dcf2844..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/modules/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/parents/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/parents/view.html deleted file mode 100644 index ce3501564..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/parents/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-advanced/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-advanced/view.html deleted file mode 100644 index 535c8cfc2..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-advanced/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-content/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-content/view.html deleted file mode 100644 index 1620dba43..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/post-content/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/related/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/related/view.html deleted file mode 100644 index 819ed712f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/components/related/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Selected items
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/details.html deleted file mode 100644 index b460e1f7b..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Post

    Fill all of the following fields to create a new post.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-details.html deleted file mode 100644 index c68d56598..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-details.html +++ /dev/null @@ -1,2 +0,0 @@ -
    Info
    URL Alias
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-list.html deleted file mode 100644 index 45069afb4..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/gallery-list.html +++ /dev/null @@ -1 +0,0 @@ -

    PostImageCreated DateAuthor
    {{item.title}}{{item.createdDateTime | utcToLocal}}{{item.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/list.html deleted file mode 100644 index 94e1aa896..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/post/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Post list

    Use the filter side bar on the right to filter and search your post.

    PostImageCreated DateAuthor
    {{item.title}}{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}{{item.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/details.html deleted file mode 100644 index 37ecefb6e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Grant permission

    Select access permissions to assign for this role.

    Select roles No Permission Found!
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/list.html deleted file mode 100644 index be7dd2b6d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/role/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Role List

    Use the filter side bar on the right to filter and search your roles.

    Role NameNormalized NameIdConcurrency Stamp
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/components/main/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/components/main/view.html deleted file mode 100644 index 2c350ff6f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/components/main/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Create Service
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/details.html deleted file mode 100644 index e19302aaf..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/service/details.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/setting/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/setting/list.html deleted file mode 100644 index cf9e2b09e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/setting/list.html +++ /dev/null @@ -1 +0,0 @@ -
    CodeTitleImageCreated DateAuthor
    {{item.code}}{{item.title}}
    {{item.excerpt}}
    {{item.createdDateTime | utcToLocal}}{{item.createdBy}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/social-feed/social-feed.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/social-feed/social-feed.html deleted file mode 100644 index 438494708..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/social-feed/social-feed.html +++ /dev/null @@ -1,3 +0,0 @@ -
    TitleExcerptImageCreated Date
    {{item.created_time | utcToLocal}}
    Prev Next
    -    {{prettyJsonObj(socialSettings)}}
    -  
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/details.html deleted file mode 100644 index 9c1a65ae1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/details.html +++ /dev/null @@ -1 +0,0 @@ -
    Create new configuration
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/list.html deleted file mode 100644 index 4fba17ac2..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/store/list.html +++ /dev/null @@ -1 +0,0 @@ -
    {{post.title}}
    by {{post.properties.author_name}} in {{post.properties.category}}
    $ {{post.properties.price }}
    {{post.properties.download_count}} download
    Filter
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/details.html deleted file mode 100644 index 1862517cf..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Template list

    You are now editing {{viewModel.fileName}} template file. Please be carefull!

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/list.html deleted file mode 100644 index 7aa849252..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/template/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Template list

    Use the filter side bar on the right to filter and search your templates.

    Template NameFolder pathCreated DateActions
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-attribute-sets/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-attribute-sets/view.html deleted file mode 100644 index 562861ca8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-attribute-sets/view.html +++ /dev/null @@ -1 +0,0 @@ -

    With Data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-mix-databases/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-mix-databases/view.html deleted file mode 100644 index 562861ca8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-mix-databases/view.html +++ /dev/null @@ -1 +0,0 @@ -

    With Data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-modules/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-modules/view.html deleted file mode 100644 index 52e1db7a8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-modules/view.html +++ /dev/null @@ -1 +0,0 @@ -

    With Data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-pages/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-pages/view.html deleted file mode 100644 index 8d3d59882..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/components/theme-export-pages/view.html +++ /dev/null @@ -1 +0,0 @@ -

    With data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/details.html deleted file mode 100644 index cf70515ad..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Create Theme

    Fill all of the following fields to create a new theme.




    {{theme.name}}

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/export.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/export.html deleted file mode 100644 index 041f9e701..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/export.html +++ /dev/null @@ -1 +0,0 @@ -

    Export theme and data

    Use the filter side bar on the right to filter and search your themes.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/list.html deleted file mode 100644 index 5ae5d432d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/theme/list.html +++ /dev/null @@ -1 +0,0 @@ -

    Theme list

    Use the filter side bar on the right to filter and search your themes.

    TitleImageAuthorCreated Date
    {{item.title}}{{item.createdBy}}{{item.createdDateTime | utcToLocal:'dd/MM/yyyy hh:mm a'}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/url-alias/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/url-alias/list.html deleted file mode 100644 index 5b8808061..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/url-alias/list.html +++ /dev/null @@ -1 +0,0 @@ -
    SourceIdTypeAliasCreated Date
    {{item.createdDateTime | utcToLocal}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/details.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/details.html deleted file mode 100644 index 8e66b337e..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/details.html +++ /dev/null @@ -1 +0,0 @@ -

    Update User

    Fill all of the following fields to create a new user.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/list.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/list.html deleted file mode 100644 index 80a5ccdb8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/list.html +++ /dev/null @@ -1 +0,0 @@ -

    User List

    Use the filter side bar on the right to filter and search your users.

    UsernameRolesAvatarCreated Date
    {{item.joinDate | utcToLocal:'d.M.yyyy h:mm a'}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/my-profile.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/my-profile.html deleted file mode 100644 index 4ba23ab99..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/my-profile.html +++ /dev/null @@ -1 +0,0 @@ -

    My Profile

    Fill all of the following fields to update your profile information.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/register.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/register.html deleted file mode 100644 index a8d2b7eab..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-portal/pages/user/register.html +++ /dev/null @@ -1 +0,0 @@ -

    Create User

    Fill all of the following fields to create a new user.

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/forgot-password/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/forgot-password/view.html deleted file mode 100644 index f087960ac..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/forgot-password/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/login/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/login/view.html deleted file mode 100644 index aa35c1c41..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/login/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/register/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/register/view.html deleted file mode 100644 index 436b428f1..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/register/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Mixcore CMS
    Hi! Let's create your new account.
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/reset-password/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/reset-password/view.html deleted file mode 100644 index c6a76c1f8..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-security/pages/reset-password/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Reset Password
    Back to homepage
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/azure-storage/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/azure-storage/view.html deleted file mode 100644 index 313256ffb..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/azure-storage/view.html +++ /dev/null @@ -1 +0,0 @@ -

    Status:

    Files:

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/checkbox-switch/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/checkbox-switch/view.html deleted file mode 100644 index da966a42d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/checkbox-switch/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/cultures/cultures.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/cultures/cultures.html deleted file mode 100644 index 708dd385a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/cultures/cultures.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/custom-file/custom-file.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/custom-file/custom-file.html deleted file mode 100644 index e76c349f0..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/custom-file/custom-file.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/language-switcher/language-switcher.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/language-switcher/language-switcher.html deleted file mode 100644 index 3ade64163..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/language-switcher/language-switcher.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/limit-string/limit-string.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/limit-string/limit-string.html deleted file mode 100644 index 4cf99fecb..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/limit-string/limit-string.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/login-popup/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/login-popup/view.html deleted file mode 100644 index 50c7c5073..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/login-popup/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/media-navs/media-navs.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/media-navs/media-navs.html deleted file mode 100644 index a3e6068af..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/media-navs/media-navs.html +++ /dev/null @@ -1 +0,0 @@ -
    Selected items


    {{media.title}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/medias/medias.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/medias/medias.html deleted file mode 100644 index edd704f22..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/medias/medias.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-data-table/mix-data-table.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-data-table/mix-data-table.html deleted file mode 100644 index 20c6781bc..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-data-table/mix-data-table.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-data-value-preview/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-data-value-preview/view.html deleted file mode 100644 index f0bc23e77..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-data-value-preview/view.html +++ /dev/null @@ -1 +0,0 @@ -

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-form-web/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-form-web/view.html deleted file mode 100644 index 7fbd89b66..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-database-form-web/view.html +++ /dev/null @@ -1 +0,0 @@ -

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-editor/view.html deleted file mode 100644 index 0b83be06d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Loading...
    ({{$ctrl.translate($ctrl.field.dataType)}})
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-preview/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-preview/view.html deleted file mode 100644 index 0ce2988ef..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-field-preview/view.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-module-data-table/mix-module-data-table.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-module-data-table/mix-module-data-table.html deleted file mode 100644 index 9e435c60a..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/mix-module-data-table/mix-module-data-table.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-articles/modal-articles.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-articles/modal-articles.html deleted file mode 100644 index 259903131..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-articles/modal-articles.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-croppie/croppie.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-croppie/croppie.html deleted file mode 100644 index 2d1d45574..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/modal-croppie/croppie.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-data-preview/module-data-preview.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-data-preview/module-data-preview.html deleted file mode 100644 index 61c8a7b63..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-data-preview/module-data-preview.html +++ /dev/null @@ -1 +0,0 @@ -

    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form-editor/view.html deleted file mode 100644 index a4a7bedab..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    {{$ctrl.dataType}}
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form/view.html deleted file mode 100644 index a80380dfd..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/module-form/view.html +++ /dev/null @@ -1 +0,0 @@ -
    Module Data
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-image/preview-image.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-image/preview-image.html deleted file mode 100644 index e998d9d2d..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-image/preview-image.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-popup/preview-popup.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-popup/preview-popup.html deleted file mode 100644 index 48eb9daf5..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/preview-popup/preview-popup.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/quill-editor/view.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/quill-editor/view.html deleted file mode 100644 index 5813aa3ba..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/quill-editor/view.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/star-rating/star-rating.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/star-rating/star-rating.html deleted file mode 100644 index ad50254b2..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/star-rating/star-rating.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/statuses/statuses.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/statuses/statuses.html deleted file mode 100644 index 04b0c7291..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/statuses/statuses.html +++ /dev/null @@ -1 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-horizontal/tabs.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-horizontal/tabs.html deleted file mode 100644 index 318f81365..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-horizontal/tabs.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-verticle/tabs.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-verticle/tabs.html deleted file mode 100644 index 1c20de824..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/tabs-verticle/tabs.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/templates/tabs.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/templates/tabs.html deleted file mode 100644 index 3dccd254f..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/templates/tabs.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/trumbowyg/trumbowyg.html b/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/trumbowyg/trumbowyg.html deleted file mode 100644 index 75b5d5627..000000000 --- a/src/Mix.Cms.Web/wwwroot/mix-app/views/app-shared/components/trumbowyg/trumbowyg.html +++ /dev/null @@ -1,4 +0,0 @@ -
    \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/mix-content/imports/themes/default_blank.zip b/src/Mix.Cms.Web/wwwroot/mix-content/imports/themes/default_blank.zip deleted file mode 100644 index 8105fdb64..000000000 Binary files a/src/Mix.Cms.Web/wwwroot/mix-content/imports/themes/default_blank.zip and /dev/null differ diff --git a/src/Mix.Cms.Web/wwwroot/offline.html b/src/Mix.Cms.Web/wwwroot/offline.html deleted file mode 100644 index 66a7fbac5..000000000 --- a/src/Mix.Cms.Web/wwwroot/offline.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - -

    PWABuilder requires an active internet connection to function.

    - - - - - - - \ No newline at end of file diff --git a/src/Mix.Cms.Web/wwwroot/sitemap.xml b/src/Mix.Cms.Web/wwwroot/sitemap.xml deleted file mode 100644 index afc11889f..000000000 --- a/src/Mix.Cms.Web/wwwroot/sitemap.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - 2021-02-04T02:15:42.0489942Z - monthly - 0.3 - https://localhost:5001/page/en-us/maintenance - - - - - 2021-02-04T02:15:42.0490816Z - monthly - 0.3 - https://localhost:5001/page/en-us/search - - - - - 2021-02-04T02:15:42.0490871Z - monthly - 0.3 - https://localhost:5001/page/en-us/home - - - - - 2021-02-04T02:15:42.069946Z - monthly - 0.3 - https://localhost:5001/post/en-us/1/mixcore-cms - - - - \ No newline at end of file diff --git a/src/Mix.Heart.NetCore/Attributes/GeneratedControllerAttribute.cs b/src/Mix.Heart.NetCore/Attributes/GeneratedControllerAttribute.cs deleted file mode 100644 index 71f10f94c..000000000 --- a/src/Mix.Heart.NetCore/Attributes/GeneratedControllerAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Mix.Heart.NetCore.Attributes -{ - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class GeneratedControllerAttribute : Attribute - { - public GeneratedControllerAttribute(string route) - { - Route = route; - } - - public string Route { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Heart.NetCore/Controllers/BaseRestApiController.cs b/src/Mix.Heart.NetCore/Controllers/BaseRestApiController.cs deleted file mode 100644 index 2106dc3e0..000000000 --- a/src/Mix.Heart.NetCore/Controllers/BaseRestApiController.cs +++ /dev/null @@ -1,363 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Mix.Common.Helper; -using Mix.Domain.Core.ViewModels; -using Mix.Domain.Data.Repository; -using Mix.Domain.Data.ViewModels; -using Mix.Heart.Extensions; -using Mix.Heart.Helpers; -using Mix.Services; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading.Tasks; - -namespace Mix.Heart.NetCore.Controllers -{ - [Produces("application/json")] - public class BaseRestApiController : Controller - where TDbContext : DbContext - where TModel : class - where TView : ViewModelBase - { - protected static DefaultRepository _repository = DefaultRepository.Instance; - protected static TDbContext _context; - protected static IDbContextTransaction _transaction; - protected string _lang; - protected bool _forbidden; - - /// - /// The domain - /// - protected string _domain; - - - - #region Helpers - - protected async Task> GetSingleAsync(string id) - { - Expression> predicate = ReflectionHelper.GetExpression("Id", id, Heart.Enums.MixHeartEnums.ExpressionMethod.Eq); - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> GetSingleAsync(Expression> predicate = null) - { - RepositoryResponse data = null; - if (predicate != null) - { - data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - } - return data; - } - - protected async Task> DeleteAsync(Expression> predicate, bool isDeleteRelated = false) - { - var data = await DefaultRepository.Instance.GetSingleModelAsync(predicate); - if (data.IsSucceed) - { - var result = await data.Data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task> DeleteAsync(TView data, bool isDeleteRelated = false) - { - if (data != null) - { - var result = await data.RemoveModelAsync(isDeleteRelated).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse() { IsSucceed = false }; - } - - protected async Task>> DeleteListAsync(Expression> predicate, bool isRemoveRelatedModel = false) - { - var data = await DefaultRepository.Instance.RemoveListModelAsync(isRemoveRelatedModel, predicate); - return data; - } - - protected async Task> ExportListAsync(Expression> predicate, string type) - { - var getData = await DefaultModelRepository.Instance.GetModelListByAsync(predicate, _context); - FileViewModel file = null; - if (getData.IsSucceed) - { - string exportPath = $"Export/Structures/{typeof(TModel).Name}"; - string filename = $"{type}_{DateTime.UtcNow.ToString("ddMMyyyy")}"; - var objContent = new JObject( - new JProperty("type", type.ToString()), - new JProperty("data", JArray.FromObject(getData.Data)) - ); - file = new FileViewModel() - { - Filename = filename, - Extension = ".json", - FileFolder = exportPath, - Content = objContent.ToString() - }; - // Copy current templates file - MixFileRepository.Instance.SaveWebFile(file); - } - UnitOfWorkHelper.HandleTransaction(getData.IsSucceed, true, _transaction); - return new RepositoryResponse() - { - IsSucceed = true, - Data = file, - }; - } - - protected async Task>> GetListAsync(Expression> predicate = null) - { - int.TryParse(Request.Query["pageIndex"], out int pageIndex); - Enum.TryParse(Request.Query["direction"], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query["pageSize"], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query["orderBy"].ToString().ToTitleCase(), - Direction = direction - }; - RepositoryResponse> data = null; - - if (data == null) - { - if (predicate != null) - { - data = await DefaultRepository.Instance.GetModelListByAsync( - predicate, request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null); - } - else - { - data = await DefaultRepository.Instance.GetModelListAsync(request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - } - } - return data; - } - - protected async Task> SaveAsync(TView vm, bool isSaveSubModel) - { - if (vm != null) - { - var result = await vm.SaveModelAsync(isSaveSubModel).ConfigureAwait(false); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task> SaveAsync(JObject obj, Expression> predicate) - { - if (obj != null) - { - List fields = new List(); - Type type = typeof(TModel); - foreach (var item in obj.Properties()) - { - var propName = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(item.Name); - PropertyInfo propertyInfo = type.GetProperty(propName); - if (propertyInfo != null) - { - object val = Convert.ChangeType(item.Value, propertyInfo.PropertyType); - var field = new EntityField() - { - PropertyName = propName, - PropertyValue = val - }; - fields.Add(field); - } - } - - var result = await DefaultRepository.Instance.UpdateFieldsAsync(predicate, fields); - - return result; - } - return new RepositoryResponse(); - } - - protected async Task>> SaveListAsync(List lstVm, bool isSaveSubModel) - { - var result = await DefaultRepository.Instance.SaveListModelAsync(lstVm, isSaveSubModel); - - return result; - } - - protected RepositoryResponse> SaveList(List lstVm, bool isSaveSubModel) - { - var result = new RepositoryResponse>() { IsSucceed = true }; - if (lstVm != null) - { - foreach (var vm in lstVm) - { - var tmp = vm.SaveModel(isSaveSubModel, - _context, _transaction); - result.IsSucceed = result.IsSucceed && tmp.IsSucceed; - if (!tmp.IsSucceed) - { - result.Exception = tmp.Exception; - result.Errors.AddRange(tmp.Errors); - } - } - return result; - } - - return result; - } - - #endregion Helpers - - #region Routes - - [HttpGet] - public virtual async Task>> Get() - { - bool isFromDate = DateTime.TryParse(Request.Query["fromDate"], out DateTime fromDate); - bool isToDate = DateTime.TryParse(Request.Query["toDate"], out DateTime toDate); - int.TryParse(Request.Query["pageIndex"], out int pageIndex); - Enum.TryParse(Request.Query["direction"], out Heart.Enums.MixHeartEnums.DisplayDirection direction); - bool isPageSize = int.TryParse(Request.Query["pageSize"], out int pageSize); - - RequestPaging request = new RequestPaging() - { - PageIndex = pageIndex, - PageSize = isPageSize ? pageSize : 100, - OrderBy = Request.Query["orderBy"].ToString().ToTitleCase(), - Direction = direction - }; - - RepositoryResponse> getData = await DefaultRepository.Instance.GetModelListAsync( - request.OrderBy, request.Direction, request.PageSize, request.PageIndex, null, null).ConfigureAwait(false); - - if (getData.IsSucceed) - { - return Ok(getData.Data); - } - else - { - return BadRequest(getData.Errors); - } - } - - // GET: api/v1/rest/{culture}/attribute-set-data/5 - [HttpGet("{id}")] - public async Task> Get(string id) - { - var getData = await GetSingleAsync(id); - if (getData.IsSucceed) - { - return getData.Data; - } - else - { - return NotFound(); - } - } - - // POST: api/s - // To protect from overposting attacks, please enable the specific properties you want to bind to, for - // more details see https://aka.ms/RazorPagesCRUD. - [HttpPost] - public async Task> Create([FromBody] TView data) - { - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - // PUT: api/s/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for - // more details see https://aka.ms/RazorPagesCRUD. - [HttpPut("{id}")] - public async Task Update(string id, [FromBody] TView data) - { - var currentId = ReflectionHelper.GetPropertyValue(data, "id").ToString(); - if (id != currentId) - { - return BadRequest(); - } - var result = await SaveAsync(data, true); - if (result.IsSucceed) - { - return NoContent(); - } - else - { - var current = await GetSingleAsync(currentId); - if (!current.IsSucceed) - { - return NotFound(); - } - else - { - return BadRequest(result.Errors); - } - } - } - - // PATCH: api/v1/rest/en-us/attribute-set/portal/5 - [HttpPatch("{id}")] - public async Task Patch(string id, [FromBody] JObject fields) - { - var result = await GetSingleAsync(id); - if (result.IsSucceed) - { - var saveResult = await result.Data.UpdateFieldsAsync(fields); - if (saveResult.IsSucceed) - { - return NoContent(); - } - else - { - return BadRequest(saveResult.Errors); - } - } - else - { - return NotFound(); - } - } - - // DELETE: api/v1/rest/en-us/attribute-set/portal/5 - [HttpDelete("{id}")] - public async Task> Delete(string id) - { - var predicate = ReflectionHelper.GetExpression("id", id, Enums.MixHeartEnums.ExpressionMethod.Eq); - var result = await DeleteAsync(predicate, false); - if (result.IsSucceed) - { - return Ok(result.Data); - } - else - { - return BadRequest(result.Errors); - } - } - - [HttpGet("clear-cache")] - protected async Task ClearCacheAsync(Type type) - { - await MixCacheService.RemoveCacheAsync(type: type); - } - - #endregion Routes - } -} \ No newline at end of file diff --git a/src/Mix.Heart.NetCore/Conventions/GenericControllerRouteConvention.cs b/src/Mix.Heart.NetCore/Conventions/GenericControllerRouteConvention.cs deleted file mode 100644 index 53adbd6a4..000000000 --- a/src/Mix.Heart.NetCore/Conventions/GenericControllerRouteConvention.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApplicationModels; -using Mix.Heart.Extensions; -using Mix.Heart.NetCore.Attributes; -using System.Reflection; - -namespace Mix.Heart.RestFul.Conventions -{ - public class GenericControllerRouteConvention : IControllerModelConvention - { - public void Apply(ControllerModel controller) - { - if (controller.ControllerType.IsGenericType) - { - // BaseController Generic Type - var genericType = controller.ControllerType.GenericTypeArguments[2]; - var customNameAttribute = genericType.GetCustomAttribute(); - - if (customNameAttribute?.Route != null) - { - controller.Selectors.Add(new SelectorModel - { - AttributeRouteModel = new AttributeRouteModel(new RouteAttribute(customNameAttribute.Route)), - }); - } - else - { - controller.ControllerName = genericType.Name.ToHypenCase(); - } - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Heart.NetCore/Extensions/ServiceCollectionExtensions.cs b/src/Mix.Heart.NetCore/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index a65cd31d7..000000000 --- a/src/Mix.Heart.NetCore/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Mix.Heart.Providers; -using Mix.Heart.RestFul.Conventions; -using System; -using System.Reflection; - -namespace Mix.Heart.NetCore -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddGeneratedRestApi(this IServiceCollection services, Assembly assembly, Type baseType = null) - { - services. - AddMvc(o => o.Conventions.Add( - new GenericControllerRouteConvention() - )). - ConfigureApplicationPartManager(m => - m.FeatureProviders.Add(new GenericTypeControllerFeatureProvider(assembly, baseType) - )); - return services; - } - } -} \ No newline at end of file diff --git a/src/Mix.Heart.NetCore/Mix.Heart.NetCore.csproj b/src/Mix.Heart.NetCore/Mix.Heart.NetCore.csproj deleted file mode 100644 index f06288655..000000000 --- a/src/Mix.Heart.NetCore/Mix.Heart.NetCore.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net5.0 - - - - - - - - - diff --git a/src/Mix.Heart.NetCore/Providers/GenericTypeControllerFeatureProvider.cs b/src/Mix.Heart.NetCore/Providers/GenericTypeControllerFeatureProvider.cs deleted file mode 100644 index b2c53ac52..000000000 --- a/src/Mix.Heart.NetCore/Providers/GenericTypeControllerFeatureProvider.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.AspNetCore.Mvc.ApplicationParts; -using Microsoft.AspNetCore.Mvc.Controllers; -using Mix.Heart.NetCore.Attributes; -using Mix.Heart.NetCore.Controllers; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace Mix.Heart.Providers -{ - public class GenericTypeControllerFeatureProvider : IApplicationFeatureProvider - { - public Assembly Assembly { get; set; } - public Type BaseType { get; set; } - - public GenericTypeControllerFeatureProvider(Assembly assembly, Type baseType = null) - { - this.Assembly = assembly; - BaseType = baseType != null ? baseType : typeof(BaseRestApiController<,,>); - } - - public void PopulateFeature(IEnumerable parts, ControllerFeature feature) - { - var candidates = Assembly.GetExportedTypes().Where(x => x.GetCustomAttributes().Any()); - - foreach (var candidate in candidates) - { - if (candidate.BaseType.IsGenericType - && candidate.BaseType.GenericTypeArguments.Length == this.BaseType.GetGenericArguments().Length) - { - Type[] types = candidate.BaseType.GenericTypeArguments; - feature.Controllers.Add( - BaseType.MakeGenericType(types) - .GetTypeInfo() - ); - } - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Data/ApplicationDbContext.cs b/src/Mix.Identity/Data/ApplicationDbContext.cs deleted file mode 100644 index 69b35770f..000000000 --- a/src/Mix.Identity/Data/ApplicationDbContext.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Mix.Identity.Entities; -using Mix.Identity.Models; -using System.IO; - -namespace Mix.Identity.Data -{ - public class ApplicationDbContext : IdentityDbContext - { - /// - /// Initializes a new instance of the class. - /// - /// The options. - public ApplicationDbContext(DbContextOptions options) - : base(options) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ApplicationDbContext() - { - } - - public DbSet Clients { get; set; } - public DbSet RefreshTokens { get; set; } - - /// - /// Called when [configuring]. - /// - /// The options builder. - //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - //{ - // // get the configuration from the app settings - // var config = new ConfigurationBuilder() - // .SetBasePath(Directory.GetCurrentDirectory()) - // .AddJsonFile(Const.CONST_FILE_APPSETTING) - // .Build(); - - // // define the database to use - // optionsBuilder.UseSqlServer(config.GetConnectionString(Const.CONST_DEFAULT_CONNECTION)); - //} - - /// - /// Called when [model creating]. - /// - /// The builder. - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - // Customize the ASP.NET Identity model and override the defaults if needed. - // For example, you can rename the ASP.NET Identity table names and more. - // Add your customizations after calling base.OnModelCreating(builder); - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - var config = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile(Const.CONST_FILE_APPSETTING) - .Build(); - string cnn = config.GetConnectionString(Const.CONST_DEFAULT_CONNECTION); - if (!string.IsNullOrEmpty(cnn)) - { - // define the database to use - optionsBuilder.UseSqlServer(cnn); - base.OnConfiguring(optionsBuilder); - } - } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Infrastructure/ApplicationUserManager.cs b/src/Mix.Identity/Infrastructure/ApplicationUserManager.cs deleted file mode 100644 index 8a01a7fce..000000000 --- a/src/Mix.Identity/Infrastructure/ApplicationUserManager.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Mix.Identity.Models; -using System; -using System.Collections.Generic; - -namespace Mix.Identity.Infrastructure -{ - public class ApplicationUserManager : UserManager - { - public ApplicationUserManager(IUserStore store, IOptions optionsAccessor, - IPasswordHasher passwordHasher, IEnumerable> userValidators, - IEnumerable> passwordValidators, ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, IServiceProvider services, ILogger> logger) - : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger) - { - } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Infrastructure/ExtendedClaimsProvider.cs b/src/Mix.Identity/Infrastructure/ExtendedClaimsProvider.cs deleted file mode 100644 index 309dcf906..000000000 --- a/src/Mix.Identity/Infrastructure/ExtendedClaimsProvider.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Mix.Identity.Models; -using System.Collections.Generic; -using System.Security.Claims; - -namespace Mix.Identity.Infrastructure -{ - public static class ExtendedClaimsProvider - { - public static IEnumerable GetClaims(ApplicationUser user) - { - List claims = new List(); - - foreach (var claim in user.Claims) - { - claims.Add(CreateClaim(claim.ClaimType, claim.ClaimValue)); - } - return claims; - } - - public static Claim CreateClaim(string type, string value) - { - return new Claim(type, value, ClaimValueTypes.String); - } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Mix.Identity.csproj b/src/Mix.Identity/Mix.Identity.csproj deleted file mode 100644 index f2657a4b6..000000000 --- a/src/Mix.Identity/Mix.Identity.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net5.0 - - - - - - - - - - - - - diff --git a/src/Mix.Identity/Models/AccountViewModels/ExternalLoginViewModel.cs b/src/Mix.Identity/Models/AccountViewModels/ExternalLoginViewModel.cs deleted file mode 100644 index a9786157f..000000000 --- a/src/Mix.Identity/Models/AccountViewModels/ExternalLoginViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.ComponentModel.DataAnnotations; - -namespace Mix.Identity.Models.AccountViewModels -{ - public class ExternalLoginViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Models/AccountViewModels/RegisterViewModel.cs b/src/Mix.Identity/Models/AccountViewModels/RegisterViewModel.cs deleted file mode 100644 index 0ee3ce9ab..000000000 --- a/src/Mix.Identity/Models/AccountViewModels/RegisterViewModel.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.ComponentModel.DataAnnotations; - -namespace Mix.Identity.Models.AccountViewModels -{ - public class RegisterViewModel - { - public string FirstName { get; set; } - public string LastName { get; set; } - public string NickName { get; set; } - - [Required] - public string UserName { get; set; } - - /// - /// Gets or sets the email. - /// - /// - /// The email. - /// - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - /// - /// Gets or sets the password. - /// - /// - /// The password. - /// - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - /// - /// Gets or sets the confirm password. - /// - /// - /// The confirm password. - /// - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string ReturnUrl { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Models/AccountViewModels/UserRoleModel.cs b/src/Mix.Identity/Models/AccountViewModels/UserRoleModel.cs deleted file mode 100644 index fb6651d30..000000000 --- a/src/Mix.Identity/Models/AccountViewModels/UserRoleModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Newtonsoft.Json; - -namespace Mix.Identity.Models.AccountViewModels -{ - public class UserRoleModel - { - [JsonProperty("userId")] - public string UserId { get; set; } - - [JsonProperty("roleId")] - public string RoleId { get; set; } - - [JsonProperty("roleName")] - public string RoleName { get; set; } - - [JsonProperty("isUserInRole")] - public bool IsUserInRole { get; set; } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Models/ApplicationUser.cs b/src/Mix.Identity/Models/ApplicationUser.cs deleted file mode 100644 index 857b068ec..000000000 --- a/src/Mix.Identity/Models/ApplicationUser.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Identity; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace Mix.Identity.Models -{ - // Add profile data for application users by adding properties to the ApplicationUser class - public class ApplicationUser : IdentityUser - { - [Required] - public DateTime JoinDate { get; set; } - - public bool IsActived { get; set; } - public System.DateTime LastModified { get; set; } - public string ModifiedBy { get; set; } - - public string RegisterType { get; set; } - public string Avatar { get; set; } - public string NickName { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string Gender { get; set; } - public int CountryId { get; set; } - public string Culture { get; set; } - public DateTime? DOB { get; set; } - - /// - /// Navigation property for the roles this user belongs to. - /// - public virtual ICollection> Roles { get; } = new List>(); - - /// - /// Navigation property for the claims this user possesses. - /// - public virtual ICollection> Claims { get; } = new List>(); - - /// - /// Navigation property for this users login accounts. - /// - public virtual ICollection> Logins { get; } = new List>(); - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Models/AspNetUser.cs b/src/Mix.Identity/Models/AspNetUser.cs deleted file mode 100644 index 83e507bea..000000000 --- a/src/Mix.Identity/Models/AspNetUser.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Http; -using Mix.Identity.Interfaces; -using System.Collections.Generic; -using System.Security.Claims; - -namespace Mix.Identity.Models -{ - public class AspNetUser : IUser - { - /// - /// The accessor{CC2D43FA-BBC4-448A-9D0B-7B57ADF2655C} - /// - private readonly IHttpContextAccessor _accessor; - - /// - /// Initializes a new instance of the class. - /// - /// The accessor. - public AspNetUser(IHttpContextAccessor accessor) - { - _accessor = accessor; - } - - /// - /// Gets the name. - /// - /// - /// The name. - /// - public string Name => _accessor.HttpContext.User.Identity.Name; - - /// - /// Determines whether this instance is authenticated. - /// - /// - /// true if this instance is authenticated; otherwise, false. - /// - public bool IsAuthenticated() - { - return _accessor.HttpContext.User.Identity.IsAuthenticated; - } - - /// - /// Gets the claims identity. - /// - /// - public IEnumerable GetClaimsIdentity() - { - return _accessor.HttpContext.User.Claims; - } - } -} \ No newline at end of file diff --git a/src/Mix.Identity/Repositories/AuthRepository.cs b/src/Mix.Identity/Repositories/AuthRepository.cs deleted file mode 100644 index c2ed74ae1..000000000 --- a/src/Mix.Identity/Repositories/AuthRepository.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the Mixcore Foundation under one or more agreements. -// The Mixcore Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Mix.Identity.Models; -using System; -using System.Collections.Generic; - -namespace Mix.Identity.Repositories -{ - public class AuthRepository : UserManager - { - public AuthRepository(IUserStore store, IOptions optionsAccessor, - IPasswordHasher passwordHasher, IEnumerable> userValidators, - IEnumerable> passwordValidators, ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, IServiceProvider services, ILogger> logger) - : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger) - { - } - } -} \ No newline at end of file diff --git a/src/MixCore.sln b/src/MixCore.sln deleted file mode 100644 index 2e83fa708..000000000 --- a/src/MixCore.sln +++ /dev/null @@ -1,83 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29215.179 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CMS", "CMS", "{C45D03E7-0453-4199-A5DE-E61B5FF29AF4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mixcore", "Mix.Cms.Web\Mixcore.csproj", "{0E27FDA9-70B1-41AD-8465-3E56EA78F0DF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Cms.Api", "Mix.Cms.Api\Mix.Cms.Api.csproj", "{BC4D7CE6-F507-482E-A939-B9F8D6533929}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Cms.Lib", "Mix.Cms.Lib\Mix.Cms.Lib.csproj", "{46A6FAC4-B138-4AB8-AAB2-597EE1774371}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Identity", "Mix.Identity\Mix.Identity.csproj", "{08480B8D-2BA4-4E6F-8A08-D668E6F4C13D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Cms.Api.RestFul", "Mix.Cms.Api.RestFul\Mix.Cms.Api.RestFul.csproj", "{D174224F-710A-43EA-AB67-296156EA6599}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Cms.Service.SignalR", "Mix.Cms.Service.SignalR\Mix.Cms.Service.SignalR.csproj", "{940730E0-9409-4DBF-A38A-3CFEC2D9A22E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Heart.NetCore", "Mix.Heart.NetCore\Mix.Heart.NetCore.csproj", "{EEA39C49-5113-4772-87C1-2F1D0487A8CE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mix.Cms.Schedule", "Mix.Cms.Schedule\Mix.Cms.Schedule.csproj", "{BCEA1296-5B82-4A1C-AD81-5A9ACC421750}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{CCA797E2-3092-4C49-8839-C052D0D54B3B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0E27FDA9-70B1-41AD-8465-3E56EA78F0DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0E27FDA9-70B1-41AD-8465-3E56EA78F0DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0E27FDA9-70B1-41AD-8465-3E56EA78F0DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0E27FDA9-70B1-41AD-8465-3E56EA78F0DF}.Release|Any CPU.Build.0 = Release|Any CPU - {BC4D7CE6-F507-482E-A939-B9F8D6533929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BC4D7CE6-F507-482E-A939-B9F8D6533929}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BC4D7CE6-F507-482E-A939-B9F8D6533929}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BC4D7CE6-F507-482E-A939-B9F8D6533929}.Release|Any CPU.Build.0 = Release|Any CPU - {46A6FAC4-B138-4AB8-AAB2-597EE1774371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46A6FAC4-B138-4AB8-AAB2-597EE1774371}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46A6FAC4-B138-4AB8-AAB2-597EE1774371}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46A6FAC4-B138-4AB8-AAB2-597EE1774371}.Release|Any CPU.Build.0 = Release|Any CPU - {08480B8D-2BA4-4E6F-8A08-D668E6F4C13D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08480B8D-2BA4-4E6F-8A08-D668E6F4C13D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08480B8D-2BA4-4E6F-8A08-D668E6F4C13D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08480B8D-2BA4-4E6F-8A08-D668E6F4C13D}.Release|Any CPU.Build.0 = Release|Any CPU - {D174224F-710A-43EA-AB67-296156EA6599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D174224F-710A-43EA-AB67-296156EA6599}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D174224F-710A-43EA-AB67-296156EA6599}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D174224F-710A-43EA-AB67-296156EA6599}.Release|Any CPU.Build.0 = Release|Any CPU - {940730E0-9409-4DBF-A38A-3CFEC2D9A22E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {940730E0-9409-4DBF-A38A-3CFEC2D9A22E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {940730E0-9409-4DBF-A38A-3CFEC2D9A22E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {940730E0-9409-4DBF-A38A-3CFEC2D9A22E}.Release|Any CPU.Build.0 = Release|Any CPU - {EEA39C49-5113-4772-87C1-2F1D0487A8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEA39C49-5113-4772-87C1-2F1D0487A8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEA39C49-5113-4772-87C1-2F1D0487A8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEA39C49-5113-4772-87C1-2F1D0487A8CE}.Release|Any CPU.Build.0 = Release|Any CPU - {BCEA1296-5B82-4A1C-AD81-5A9ACC421750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BCEA1296-5B82-4A1C-AD81-5A9ACC421750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BCEA1296-5B82-4A1C-AD81-5A9ACC421750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCEA1296-5B82-4A1C-AD81-5A9ACC421750}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {BC4D7CE6-F507-482E-A939-B9F8D6533929} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - {46A6FAC4-B138-4AB8-AAB2-597EE1774371} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - {08480B8D-2BA4-4E6F-8A08-D668E6F4C13D} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - {D174224F-710A-43EA-AB67-296156EA6599} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - {940730E0-9409-4DBF-A38A-3CFEC2D9A22E} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - {EEA39C49-5113-4772-87C1-2F1D0487A8CE} = {CCA797E2-3092-4C49-8839-C052D0D54B3B} - {BCEA1296-5B82-4A1C-AD81-5A9ACC421750} = {C45D03E7-0453-4199-A5DE-E61B5FF29AF4} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8B133AF3-4413-4B56-9BEC-8C4509008F85} - EndGlobalSection - GlobalSection(Performance) = preSolution - HasPerformanceSessions = true - EndGlobalSection -EndGlobal diff --git a/src/Readme.md b/src/Readme.md new file mode 100644 index 000000000..d5921e342 --- /dev/null +++ b/src/Readme.md @@ -0,0 +1,24 @@ +# Add new Module +## 1. Add module name in mix.shared/Constants/MixModuleNames +## 2. Add Endpoint in MixContent/AppConfigs/endpoint.json +## 3. Add Get/Set to MixEndpointService + +# Run module as a microservice : +## 1. Remove Reference to module from Mixcore project +## 2. Copy MixContent Folder to Module's source code +## 3. Update ocelot.json. +(Ref: https://ocelot.readthedocs.io/en/latest/features/configuration.html). Ex: +``` +{ + "DownstreamPathTemplate": "/api/v2/rest/mix-portal/{catchALl}", + "DownstreamScheme": "https", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5006 + } + ], + "UpstreamPathTemplate": "/api/v2/rest/mix-portal/{catchALl}", + "UpstreamHttpMethod": [ "Get", "Post", "Put", "Patch", "Delete" ] +} +``` diff --git a/src/applications/Mixcore/Controllers/HomeController.cs b/src/applications/Mixcore/Controllers/HomeController.cs new file mode 100644 index 000000000..e03afeea9 --- /dev/null +++ b/src/applications/Mixcore/Controllers/HomeController.cs @@ -0,0 +1,81 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; +using Mixcore.Domain.Bases; + +namespace Mixcore.Controllers +{ + public class HomeController : MvcBaseController + { + + private readonly ILogger _logger; + public HomeController( + IHttpContextAccessor httpContextAccessor, + ILogger logger, + IPSecurityConfigService ipSecurityConfigService, + MixService mixService, + TranslatorService translator, + MixDatabaseService databaseService, + MixCmsContext context) + : base(httpContextAccessor, ipSecurityConfigService, mixService, translator, databaseService, context) + { + _logger = logger; + } + + protected override void ValidateRequest() + { + base.ValidateRequest(); + + // If this site has not been inited yet + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + isValid = false; + if (string.IsNullOrEmpty(_databaseService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) + { + _redirectUrl = "Init"; + } + else + { + var status = GlobalConfigService.Instance.AppSettings.InitStatus; + _redirectUrl = $"/init/step{status}"; + } + } + } + + [Route("")] + public async Task Index(string seoName, string keyword) + { + if (!isValid) + { + return Redirect(_redirectUrl); + } + return await Home(); + } + + protected async Task Home() + { + // Home Page + var pageRepo = PageContentViewModel.GetRepository(_uow); + var page = await pageRepo.GetFirstAsync(p => p.MixTenantId == MixTenantId && p.Type == MixPageType.Home); + + if (page == null) + { + return NotFound(); + } + + await page.ExpandView(); + ViewData["Title"] = page.SeoTitle; + ViewData["Description"] = page.SeoDescription; + ViewData["Keywords"] = page.SeoKeywords; + ViewData["Image"] = page.Image; + ViewData["Layout"] = page.Layout?.FilePath; + ViewData["BodyClass"] = page.ClassName; + ViewData["ViewMode"] = MixMvcViewMode.Page; + ViewData["Keyword"] = page.SeoKeywords; + + ViewBag.viewMode = MixMvcViewMode.Page; + return View(page); + } + } +} diff --git a/src/applications/Mixcore/Controllers/InitController.cs b/src/applications/Mixcore/Controllers/InitController.cs new file mode 100644 index 000000000..e723a30a8 --- /dev/null +++ b/src/applications/Mixcore/Controllers/InitController.cs @@ -0,0 +1,83 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Lib.Services; +using Mix.Shared.Services; +using Mixcore.Domain.Constants; + +namespace Mixcore.Controllers +{ + public class InitController : MixControllerBase + { + public InitController( + IHttpContextAccessor httpContextAccessor, + MixService mixService, + IPSecurityConfigService ipSecurityConfigService) + : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + } + + [HttpGet] + [Route("init")] + [Route("init/{page}")] + public IActionResult Index(string page) + { + if (!GlobalConfigService.Instance.AppSettings.IsInit) + { + return Redirect("/"); + } + else + { + page ??= ""; + var initStatus = GlobalConfigService.Instance.AppSettings.InitStatus; + + switch (initStatus) + { + case InitStep.Blank: + InitEndpoints(); + if (page.ToLower() != "") + { + return Redirect(InitRoutePath.Default); + } + break; + + case InitStep.InitTenant: + if (page.ToLower() != "step2") + { + return Redirect(InitRoutePath.Step2); + } + break; + + case InitStep.InitAccount: + if (page.ToLower() != "step3") + { + return Redirect(InitRoutePath.Step3); + } + break; + case InitStep.SelectTheme: + if (page.ToLower() != "step4") + { + return Redirect(InitRoutePath.Step4); + } + break; + } + return View(); + } + } + + private void InitEndpoints() + { + if (string.IsNullOrEmpty(MixEndpointService.Instance.Messenger)) + { + string endpoint = $"{Request.Scheme}://{Request.Host}"; + MixEndpointService.Instance.Messenger = endpoint; + MixEndpointService.Instance.Portal = endpoint; + MixEndpointService.Instance.Grpc = endpoint; + MixEndpointService.Instance.Scheduler = endpoint; + MixEndpointService.Instance.Theme = endpoint; + MixEndpointService.Instance.Account = endpoint; + MixEndpointService.Instance.Common = endpoint; + MixEndpointService.Instance.Mixcore = endpoint; + MixEndpointService.Instance.SaveSettings(); + } + } + } +} diff --git a/src/applications/Mixcore/Controllers/PageController.cs b/src/applications/Mixcore/Controllers/PageController.cs new file mode 100644 index 000000000..c432c510b --- /dev/null +++ b/src/applications/Mixcore/Controllers/PageController.cs @@ -0,0 +1,96 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; + +namespace Mixcore.Controllers +{ + [Route("{controller}")] + public class PageController : MixControllerBase + { + protected UnitOfWorkInfo _uow; + protected readonly MixCmsContext _context; + private readonly ILogger _logger; + private readonly TranslatorService _translator; + private readonly MixDatabaseService _databaseService; + public PageController( + IHttpContextAccessor httpContextAccessor, + ILogger logger, + IPSecurityConfigService ipSecurityConfigService, + MixService mixService, + TranslatorService translator, + MixDatabaseService databaseService, + MixCmsContext context, + MixCacheService cacheService) + : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + _context = context; + _uow = new(_context); + _logger = logger; + _translator = translator; + _databaseService = databaseService; + _context = context; + } + + protected override void ValidateRequest() + { + base.ValidateRequest(); + + // If this site has not been inited yet + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + isValid = false; + if (string.IsNullOrEmpty(_databaseService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) + { + _redirectUrl = "Init"; + } + else + { + var status = GlobalConfigService.Instance.AppSettings.InitStatus; + _redirectUrl = $"/init/step{status}"; + } + } + } + + #region Routes + [Route("{id}")] + public async Task Index(int id, string keyword) + { + if (isValid) + { + return await Page(id, keyword); + } + else + { + return Redirect(_redirectUrl); + } + } + + #endregion Routes + + #region Helper + protected async Task Page(int pageId, string keyword = null) + { + // Home Page + var pageRepo = PageContentViewModel.GetRepository(_uow); + var page = await pageRepo.GetSingleAsync(m => m.Id == pageId && m.MixTenantId == MixTenantId); + if (page == null) + return NotFound(); + + ViewData["Title"] = page.SeoTitle; + ViewData["Description"] = page.SeoDescription; + ViewData["Keywords"] = page.SeoKeywords; + ViewData["Image"] = page.Image; + ViewData["Layout"] = page.Layout?.FilePath; + ViewData["BodyClass"] = page.ClassName; + ViewData["ViewMode"] = MixMvcViewMode.Page; + ViewData["Keyword"] = keyword; + + ViewBag.viewMode = MixMvcViewMode.Page; + return View(page); + } + } + + + #endregion +} diff --git a/src/applications/Mixcore/Controllers/PortalController.cs b/src/applications/Mixcore/Controllers/PortalController.cs new file mode 100644 index 000000000..a42c664ee --- /dev/null +++ b/src/applications/Mixcore/Controllers/PortalController.cs @@ -0,0 +1,76 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; + +namespace Mixcore.Controllers +{ + public class PortalController : MixControllerBase + { + private readonly MixDatabaseService _databaseService; + + public PortalController( + IHttpContextAccessor httpContextAccessor, + MixService mixService, + MixDatabaseService databaseService, IPSecurityConfigService ipSecurityConfigService, + MixCacheService cacheService) + : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + _databaseService = databaseService; + } + + [HttpGet] + [Route("portal")] + [Route("portal/page/{type}")] + [Route("portal/post/{type}")] + [Route("portal/{pageName}")] + [Route("portal/{pageName}/{type}")] + [Route("portal/{pageName}/{type}/{param}")] + [Route("portal/{pageName}/{type}/{param}/{param1}")] + [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}")] + [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}/{param3}")] + [Route("portal/{pageName}/{type}/{param}/{param1}/{param2}/{param3}/{param4}")] + public IActionResult Index() + { + if (isValid) + { + return View(); + } + else + { + return Redirect(_redirectUrl); + } + } + + #region overrides + + protected override void ValidateRequest() + { + // If IP retricted in appsettings + if (ForbiddenPortal) + { + isValid = false; + _redirectUrl = $"/403"; + } + + base.ValidateRequest(); + + // If this site has not been inited yet + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + isValid = false; + if (string.IsNullOrEmpty(_databaseService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) + { + _redirectUrl = "Init"; + } + else + { + var status = GlobalConfigService.Instance.AppSettings.InitStatus; + _redirectUrl = $"/init/step{status}"; + } + } + } + + #endregion overrides + } +} diff --git a/src/applications/Mixcore/Controllers/PostController.cs b/src/applications/Mixcore/Controllers/PostController.cs new file mode 100644 index 000000000..51d2b33e3 --- /dev/null +++ b/src/applications/Mixcore/Controllers/PostController.cs @@ -0,0 +1,101 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; + +namespace Mixcore.Controllers +{ + [Route("{controller}")] + public class PostController : MixControllerBase + { + protected UnitOfWorkInfo _uow; + protected readonly MixCmsContext _context; + private readonly ILogger _logger; + private readonly TranslatorService _translator; + private readonly MixDatabaseService _databaseService; + public PostController( + IHttpContextAccessor httpContextAccessor, + ILogger logger, + IPSecurityConfigService ipSecurityConfigService, + MixService mixService, + TranslatorService translator, + MixDatabaseService databaseService, + MixCmsContext context, + MixCacheService cacheService) + : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + _context = context; + _uow = new(_context); + _logger = logger; + _translator = translator; + _databaseService = databaseService; + _context = context; + } + + protected override void ValidateRequest() + { + base.ValidateRequest(); + + // If this site has not been inited yet + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + isValid = false; + if (string.IsNullOrEmpty(_databaseService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) + { + _redirectUrl = "Init"; + } + else + { + var status = GlobalConfigService.Instance.AppSettings.InitStatus; + _redirectUrl = $"/init/step{status}"; + } + } + } + + #region Routes + [Route("{id}")] + [Route("{id}/{keyword}")] + public async Task Index(int id, string keyword) + { + if (isValid) + { + return await Post(id, keyword); + } + else + { + return Redirect(_redirectUrl); + } + } + + #endregion Routes + + #region Helper + protected async Task Post(int postId, string keyword = null) + { + // Home Post + var postRepo = PostContentViewModel.GetRepository(_uow); + var post = await postRepo.GetSingleAsync(m => m.Id == postId && m.MixTenantId == MixTenantId); + if (post == null) + { + string msg = $"PostController: {postId} - {keyword}"; + MixService.LogException(status: MixErrorStatus.NotFound, message: msg); + return NotFound(); + } + + ViewData["Title"] = post.SeoTitle; + ViewData["Description"] = post.SeoDescription; + ViewData["Keywords"] = post.SeoKeywords; + ViewData["Image"] = post.Image; + ViewData["Layout"] = post.Layout?.FilePath; + ViewData["BodyClass"] = post.ClassName; + ViewData["ViewMode"] = MixMvcViewMode.Post; + ViewData["Keyword"] = keyword; + + ViewBag.viewMode = MixMvcViewMode.Post; + return View(post); + } + } + + + #endregion +} diff --git a/src/applications/Mixcore/Controllers/SecurityController.cs b/src/applications/Mixcore/Controllers/SecurityController.cs new file mode 100644 index 000000000..359c5b0ec --- /dev/null +++ b/src/applications/Mixcore/Controllers/SecurityController.cs @@ -0,0 +1,145 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal; +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Entities.Account; +using Mix.Identity.Models.AccountViewModels; +using Mix.Lib.Services; +using Mix.Shared.Services; +using System.Security.Claims; + +namespace Mixcore.Controllers +{ + public class SecurityController : MixControllerBase + { + private readonly SignInManager _signInManager; + private readonly TenantUserManager _userManager; + private readonly ILogger _logger; + private readonly MixIdentityService _idService; + private readonly MixCmsContext _cmsContext; + public SecurityController( + IHttpContextAccessor httpContextAccessor, + MixService mixService, + IPSecurityConfigService ipSecurityConfigService, + MixCacheService cacheService, + SignInManager signInManager, + ILogger logger, + MixIdentityService idService, + TenantUserManager userManager, + MixCmsContext cmsContext) + : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + _signInManager = signInManager; + _logger = logger; + _idService = idService; + _userManager = userManager; + _cmsContext = cmsContext; + } + + [HttpGet] + [Route("security/{page}")] + public IActionResult Index(string page) + { + if (isValid) + { + return View(); + } + else + { + return Redirect(_redirectUrl); + } + } + + [Route("security/external-login")] + [HttpPost] + [AllowAnonymous] + public ActionResult ExternalLogin(string provider, string returnUrl = null) + { + // Request a redirect to the external login provider. + returnUrl ??= Url.Content("~/"); + var redirectUrl = $"/security/external-login-result?returnUrl={returnUrl}"; + var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); + return new ChallengeResult(provider, properties); + } + + [Route("security/external-login-result")] + [HttpGet] + [AllowAnonymous] + public async Task> ExternalLoginResultAsync(string returnUrl = null, string remoteError = null) + { + returnUrl = returnUrl ?? Url.Content("~/"); + if (remoteError != null) + { + return RedirectToPage("./Login", new { ReturnUrl = returnUrl }); + } + var info = await _signInManager.GetExternalLoginInfoAsync(); + if (info == null) + { + return RedirectToPage("./Security/Login", new { ReturnUrl = returnUrl }); + } + + // Sign in the user with this external login provider if the user already has a login. + var siginResult = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor: true); + if (siginResult.Succeeded) + { + string email = info.Principal.FindFirstValue(ClaimTypes.Email); + var user = await _userManager.FindByEmailAsync(email); + var token = await _idService.GetAuthData(_cmsContext, user, true, MixTenantId); + return View(new ExternalLoginResultModel() + { + Token = token.ToString(Formatting.None), + ReturnUrl = returnUrl + }); + } + if (siginResult.IsLockedOut) + { + return RedirectToPage("./Lockout"); + } + else + { + // If the user does not have an account, then ask the user to create an account. + string email = info.Principal.FindFirstValue(ClaimTypes.Email); + var user = await _userManager.FindByEmailAsync(email); + if (user != null) + { + await _userManager.AddLoginAsync(user, info); + await _signInManager.SignInAsync(user, isPersistent: false, info.LoginProvider); + var token = await _idService.GetAuthData(_cmsContext, user, true, MixTenantId); + return View(new ExternalLoginResultModel() + { + Token = token.ToString(Formatting.None), + ReturnUrl = returnUrl + }); + } + else + { + user = new MixUser() + { + Email = email, + UserName = email, + CreatedDateTime = DateTime.UtcNow + }; + var result = await _userManager.CreateAsync(user); + if (result.Succeeded) + { + result = await _userManager.AddLoginAsync(user, info); + if (result.Succeeded) + { + _logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider); + await _signInManager.SignInAsync(user, isPersistent: false, info.LoginProvider); + var token = await _idService.GetAuthData(_cmsContext, user, true, MixTenantId); + return View(new ExternalLoginResultModel() + { + Token = token.ToString(Formatting.None), + ReturnUrl = returnUrl + }); + } + } + } + + + return BadRequest(); + } + } + } +} diff --git a/src/applications/Mixcore/Domain/Bases/MvcBaseController.cs b/src/applications/Mixcore/Domain/Bases/MvcBaseController.cs new file mode 100644 index 000000000..a536656eb --- /dev/null +++ b/src/applications/Mixcore/Domain/Bases/MvcBaseController.cs @@ -0,0 +1,69 @@ +using Microsoft.AspNetCore.Mvc; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; + +namespace Mixcore.Domain.Bases +{ + public class MvcBaseController : MixControllerBase + { + protected UnitOfWorkInfo _uow; + protected readonly MixCmsContext _context; + protected readonly TranslatorService _translator; + protected readonly MixDatabaseService _databaseService; + public MvcBaseController( + IHttpContextAccessor httpContextAccessor, + IPSecurityConfigService ipSecurityConfigService, + MixService mixService, + TranslatorService translator, + MixDatabaseService databaseService, + MixCmsContext context) : base(httpContextAccessor, mixService, ipSecurityConfigService) + { + _context = context; + _uow = new(_context); + _translator = translator; + _databaseService = databaseService; + _context = context; + } + + protected override void ValidateRequest() + { + base.ValidateRequest(); + + // If this site has not been inited yet + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + isValid = false; + if (string.IsNullOrEmpty(_databaseService.GetConnectionString(MixConstants.CONST_CMS_CONNECTION))) + { + _redirectUrl = "Init"; + } + else + { + var status = GlobalConfigService.Instance.AppSettings.InitStatus; + _redirectUrl = $"/init/step{status}"; + } + } + } + + #region Helper + protected async Task Page(int pageId, string keyword = null) + { + // Home Page + var pageRepo = PageContentViewModel.GetRepository(_uow); + var page = await pageRepo.GetSingleAsync(pageId); + ViewData["Title"] = page.SeoTitle; + ViewData["Description"] = page.SeoDescription; + ViewData["Keywords"] = page.SeoKeywords; + ViewData["Image"] = page.Image; + ViewData["Layout"] = page.Layout.FilePath; + ViewData["BodyClass"] = page.ClassName; + ViewData["ViewMode"] = MixMvcViewMode.Page; + ViewData["Keyword"] = keyword; + + ViewBag.viewMode = MixMvcViewMode.Page; + return View(page); + } + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/Constants/InitRoutePath.cs b/src/applications/Mixcore/Domain/Constants/InitRoutePath.cs new file mode 100644 index 000000000..4a4e65b8f --- /dev/null +++ b/src/applications/Mixcore/Domain/Constants/InitRoutePath.cs @@ -0,0 +1,10 @@ +namespace Mixcore.Domain.Constants +{ + public class InitRoutePath + { + public const string Default = "/init"; + public const string Step2 = "/init/step2"; + public const string Step3 = "/init/step3"; + public const string Step4 = "/init/step4"; + } +} diff --git a/src/applications/Mixcore/Domain/Extensions/ServiceExtension.cs b/src/applications/Mixcore/Domain/Extensions/ServiceExtension.cs new file mode 100644 index 000000000..87f1c486e --- /dev/null +++ b/src/applications/Mixcore/Domain/Extensions/ServiceExtension.cs @@ -0,0 +1,66 @@ +using Newtonsoft.Json.Converters; +using Ocelot.DependencyInjection; +using Ocelot.Middleware; + +namespace Microsoft.Extensions.DependencyInjection +{ + public static class ServiceExtension + { + #region Ocelot + + public static void AddMixOcelot(this IServiceCollection services, IConfiguration configuration) + { + services.AddOcelot(configuration); + } + + public static void UseMixOcelot(this IApplicationBuilder app, IConfiguration configuration, bool isDevelop) + { + app.UseOcelot().Wait(); + } + #endregion + + #region Routes + + public static void AddMixRoutes(this IServiceCollection services) + { + services.AddControllersWithViews() + .AddRazorRuntimeCompilation() + .AddNewtonsoftJson(options => + { + options.SerializerSettings.Converters.Add(new StringEnumConverter()); + }); + + services.AddSingleton(); + } + + public static IApplicationBuilder UseMixRoutes(this IApplicationBuilder app) + { + string notStartWithPattern = "regex(^(?!(init|page|post|security|portal|api|vue|error|swagger|graphql|ReDoc|OpenAPI|.+Hub))(.+)$)"; + app.UseRouting(); + app.UseEndpoints(routes => + { + //routes.MapDefaultControllerRoute(); + routes.MapDynamicControllerRoute( + pattern: "{seoName:" + notStartWithPattern + "}"); + routes.MapDynamicControllerRoute( + pattern: "{culture:" + notStartWithPattern + "}/{seoName}"); + routes.MapDynamicControllerRoute( + pattern: "{controller:" + notStartWithPattern + "}/{id}/{seoName}"); + routes.MapDynamicControllerRoute( + pattern: "{culture:" + notStartWithPattern + "}/{controller}/{id}/{seoName}"); + }); + app.MapWhen( + context => + { + var path = context.Request.Path.Value.ToLower(); + return + path.StartsWith("/mix-app") || + path.StartsWith("/mix-content"); + }, + config => config.UseStaticFiles()); + return app; + } + + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/Helpers/MixCmsHelper.cs b/src/applications/Mixcore/Domain/Helpers/MixCmsHelper.cs new file mode 100644 index 000000000..d5e51449d --- /dev/null +++ b/src/applications/Mixcore/Domain/Helpers/MixCmsHelper.cs @@ -0,0 +1,8 @@ +namespace Mix.Lib.Helpers +{ + public class MixCmsHelper + { + + + } +} diff --git a/src/applications/Mixcore/Domain/Models/MenuItem.cs b/src/applications/Mixcore/Domain/Models/MenuItem.cs new file mode 100644 index 000000000..f29a0dca6 --- /dev/null +++ b/src/applications/Mixcore/Domain/Models/MenuItem.cs @@ -0,0 +1,52 @@ +namespace Mixcore.Domain.Models +{ + public class MenuItem + { + public JObject Obj { get; set; } + + public string Id { get; set; } + + public string Specificulture { get; set; } + + public string Title { get; set; } + + public string Uri { get; set; } + + public string Href + { + get + { + var domain = "/"; + return Uri != null && Uri.Contains(domain) ? Uri : $"{domain}{Uri}"; + } + } + + public string Icon { get; set; } + + public MixMenuItemType Type { get; set; } + + public string Target { get; set; } + + public string Classes { get; set; } + + public string Description { get; set; } + + public string TargetId { get; set; } + + public bool IsActive { get; set; } + + public List MenuItems { get; set; } + + public T Property(string fieldName) + { + if (Obj != null) + { + return Obj.Value(fieldName); + } + else + { + return default; + } + } + } +} diff --git a/src/applications/Mixcore/Domain/Models/MixNavigation.cs b/src/applications/Mixcore/Domain/Models/MixNavigation.cs new file mode 100644 index 000000000..75825a31d --- /dev/null +++ b/src/applications/Mixcore/Domain/Models/MixNavigation.cs @@ -0,0 +1,54 @@ +namespace Mixcore.Domain.Models +{ + public class MixNavigation + { + public string Id { get; set; } + + public string Specificulture { get; set; } + + public string Title { get; set; } + + public string Name { get; set; } + + public List MenuItems { get; set; } = new List(); + + public List ActivedMenuItems { get; set; } = new List(); + + public MenuItem ActivedMenuItem { get; set; } + + public JObject Obj { get; set; } + + public MixNavigation() + { + } + + public MixNavigation(JObject obj, string culture) + { + Obj = obj; + Id = obj["id"].Value(); + Specificulture = culture; + Title = obj["title"].Value(); + Name = obj["name"].Value(); + var arr = obj["menuItems"].ToObject(); + foreach (JObject item in arr) + { + var menuItem = item.ToObject(); + menuItem.Obj = item; + menuItem.Specificulture = Specificulture; + MenuItems.Add(menuItem); + } + } + + public T Property(string fieldName) + { + if (Obj != null) + { + return Obj.Value(fieldName); + } + else + { + return default; + } + } + } +} diff --git a/src/applications/Mixcore/Domain/Services/MixNavigationService.cs b/src/applications/Mixcore/Domain/Services/MixNavigationService.cs new file mode 100644 index 000000000..85f9a18ad --- /dev/null +++ b/src/applications/Mixcore/Domain/Services/MixNavigationService.cs @@ -0,0 +1,55 @@ +using Microsoft.AspNetCore.Mvc; +using System.Linq.Expressions; + +namespace Mixcore.Domain.Services +{ + public class MixNavigationService + { + private UnitOfWorkInfo uow; + private MixCmsContext _dbContext; + public MixNavigationService(MixCmsContext context) + { + _dbContext = context; + uow = new(_dbContext); + } + + public async Task GetNavigationAsync(string name, string culture, IUrlHelper Url) + { + var repo = NavigationViewModel.GetRepository(uow); + string columnName = "name"; + Expression> keywordPredicate = + m => m.MixDatabaseColumnName == columnName && m.StringValue == name; + var valDataIds = _dbContext.MixDataContentValue.Where(keywordPredicate).Select(m => m.ParentId).Distinct(); + var navs = await repo.GetListAsync(m => valDataIds.Contains(m.Id)); + var nav = navs?.FirstOrDefault()?.Nav; + string activePath = Url.ActionContext.HttpContext.Request.Path; + + if (nav != null) + { + foreach (var cate in nav.MenuItems) + { + cate.IsActive = cate.Uri == activePath; + if (cate.IsActive) + { + nav.ActivedMenuItem = cate; + nav.ActivedMenuItems.Add(cate); + } + + foreach (var item in cate.MenuItems) + { + item.IsActive = item.Uri == activePath; + if (item.IsActive) + { + nav.ActivedMenuItem = item; + nav.ActivedMenuItems.Add(cate); + nav.ActivedMenuItems.Add(item); + } + cate.IsActive = cate.IsActive || item.IsActive; + } + } + } + + return nav; + } + } +} diff --git a/src/applications/Mixcore/Domain/Services/TranslationTransformer.cs b/src/applications/Mixcore/Domain/Services/TranslationTransformer.cs new file mode 100644 index 000000000..d1ab7db42 --- /dev/null +++ b/src/applications/Mixcore/Domain/Services/TranslationTransformer.cs @@ -0,0 +1,65 @@ +using Microsoft.AspNetCore.Mvc.Routing; +using Mix.Database.Services; +using Mix.Lib.Services; +using Mix.Shared.Services; + +namespace Mixcore.Domain.Services +{ + // Ref: https://www.strathweb.com/2019/08/dynamic-controller-routing-in-asp-net-core-3-0/ + public class TranslationTransformer : DynamicRouteValueTransformer + { + private readonly MixDatabaseService _databaseService; + private readonly CultureService _cultureService; + + public TranslationTransformer( + IConfiguration configuration) + { + _databaseService = new(); + MixCmsContext ctx = new MixCmsContext(_databaseService); + _cultureService = new(ctx); + } + + public override ValueTask TransformAsync( + HttpContext httpContext, RouteValueDictionary values) + { + if (GlobalConfigService.Instance.AppSettings.IsInit) + { + return ValueTask.FromResult(values); + } + + RouteValueDictionary result = values; + + var keys = values.Keys.ToList(); + + var language = (string)values[keys[0]]; + var keyIndex = 1; + if (_cultureService.CheckValidCulture(language)) + { + language = GlobalConfigService.Instance.AppSettings.DefaultCulture; + keyIndex -= 1; + result["controller"] = "home"; + result["culture"] = language; + result["action"] = "Index"; + result["keyword"] = "aaa"; + result["seoName"] = "test"; + } + + return ValueTask.FromResult(result); + } + + private string GetRouteValue(RouteValueDictionary values, List keys, ref int keyIndex) + { + string value = keys.Count > keyIndex + ? values[keys[keyIndex]]?.ToString() + : string.Empty; + keyIndex += 1; + return value; + } + + private bool IsValidController(string controller) + { + string[] controllers = { "post", "page", "module", "data" }; + return controllers.Contains(controller?.ToLower()); + } + } +} diff --git a/src/applications/Mixcore/Domain/Subscribers/DomainSubscriber.cs b/src/applications/Mixcore/Domain/Subscribers/DomainSubscriber.cs new file mode 100644 index 000000000..d8b8cebbe --- /dev/null +++ b/src/applications/Mixcore/Domain/Subscribers/DomainSubscriber.cs @@ -0,0 +1,39 @@ +using Mix.Lib.Repositories; +using Mix.Queue.Engines; +using Mix.Queue.Engines.MixQueue; + +namespace Mixcore.Domain.Subscribers +{ + public class DomainSubscriber : SubscriberBase + { + private UnitOfWorkInfo _uow; + static string topicId = typeof(MixDomainViewModel).FullName; + public DomainSubscriber( + IConfiguration configuration, + MixMemoryMessageQueue queueService) + : base(topicId, MixModuleNames.Mixcore, configuration, queueService) + { + _uow = new(new MixCmsContext()); + } + + public override async Task Handler(MessageQueueModel data) + { + var _repository = MixTenantViewModel.GetRepository(_uow); + var post = data.Data.ToObject(); + switch (data.Action) + { + case "Get": + break; + case "Post": + case "Put": + case "Patch": + case "Delete": + MixTenantRepository.Instance.AllTenants = await _repository.GetAllAsync(m => true); + break; + default: + break; + } + await _uow.CompleteAsync(); + } + } +} diff --git a/src/applications/Mixcore/Domain/Subscribers/PageContentSubscriber.cs b/src/applications/Mixcore/Domain/Subscribers/PageContentSubscriber.cs new file mode 100644 index 000000000..e08f95a7d --- /dev/null +++ b/src/applications/Mixcore/Domain/Subscribers/PageContentSubscriber.cs @@ -0,0 +1,46 @@ +using Mix.Queue.Engines; +using Mix.Queue.Engines.MixQueue; + +namespace Mixcore.Domain.Subscribers +{ + public class PageContentSubscriber : SubscriberBase + { + static string topicId = typeof(MixPageContentViewModel).FullName; + private readonly ILogger logger; + private readonly MixCacheService cacheService; + + public PageContentSubscriber( + ILogger logger, + IConfiguration configuration, + MixMemoryMessageQueue queueService, + MixCacheService cacheService) + : base(topicId, MixModuleNames.Mixcore, configuration, queueService) + { + this.logger = logger; + this.cacheService = cacheService; + } + + public override async Task Handler(MessageQueueModel data) + { + var template = data.Data.ToObject(); + switch (data.Action) + { + case "Get": + break; + case "Post": + case "Put": + case "Patch": + case "Delete": + await DeleteCacheAsync(template); + break; + default: + break; + } + } + + private async Task DeleteCacheAsync(MixPageContentViewModel data) + { + await cacheService.RemoveCacheAsync(data.Id.ToString(), typeof(PageContentViewModel)); + } + } +} diff --git a/src/applications/Mixcore/Domain/Subscribers/TemplateSubscriber.cs b/src/applications/Mixcore/Domain/Subscribers/TemplateSubscriber.cs new file mode 100644 index 000000000..d10ef476b --- /dev/null +++ b/src/applications/Mixcore/Domain/Subscribers/TemplateSubscriber.cs @@ -0,0 +1,59 @@ +using Mix.Queue.Engines; +using Mix.Queue.Engines.MixQueue; + +namespace Mixcore.Domain.Subscribers +{ + public class TemplateSubscriber : SubscriberBase + { + static string topicId = typeof(MixTemplateViewModel).FullName; + private readonly ILogger logger; + + public TemplateSubscriber( + ILogger logger, + IConfiguration configuration, + MixMemoryMessageQueue queueService) : base(topicId, MixModuleNames.Mixcore, configuration, queueService) + { + this.logger = logger; + } + + public override Task Handler(MessageQueueModel data) + { + var template = data.Data.ToObject(); + switch (data.Action) + { + case "Get": + case "Patch": + break; + case "Post": + case "Put": + SaveTemplate(template); + break; + case "Delete": + DeleteTemplate(template); + break; + default: + break; + } + + return Task.CompletedTask; + } + + private void DeleteTemplate(MixTemplateViewModel template) + { + MixFileHelper.DeleteFile($"{template.FileFolder}/{template.FileName}{template.Extension}"); + logger.LogWarning("Removed Template File {0}/{1}{2}", template.FileFolder, template.FileName, template.Extension); + } + + private void SaveTemplate(MixTemplateViewModel template) + { + MixFileHelper.SaveFile(new Mix.Heart.Models.FileModel() + { + Content = template.Content, + Filename = template.FileName, + Extension = template.Extension, + FileFolder = template.FileFolder + }); + logger.LogInformation("Saved Template File {0}/{1}{2}", template.FileFolder, template.FileName, template.Extension); + } + } +} diff --git a/src/applications/Mixcore/Domain/Subscribers/TenantSubscriber.cs b/src/applications/Mixcore/Domain/Subscribers/TenantSubscriber.cs new file mode 100644 index 000000000..eebea48d3 --- /dev/null +++ b/src/applications/Mixcore/Domain/Subscribers/TenantSubscriber.cs @@ -0,0 +1,39 @@ +using Mix.Lib.Repositories; +using Mix.Queue.Engines; +using Mix.Queue.Engines.MixQueue; + +namespace Mixcore.Domain.Subscribers +{ + public class TenantSubscriber : SubscriberBase + { + private UnitOfWorkInfo _uow; + static string topicId = typeof(MixTenantViewModel).FullName; + public TenantSubscriber( + IConfiguration configuration, + MixMemoryMessageQueue queueService) + : base(topicId, MixModuleNames.Mixcore, configuration, queueService) + { + _uow = new(new MixCmsContext()); + } + + public override async Task Handler(MessageQueueModel data) + { + var _repository = MixTenantViewModel.GetRepository(_uow); + var post = data.Data.ToObject(); + switch (data.Action) + { + case "Get": + break; + case "Post": + case "Put": + case "Patch": + case "Delete": + MixTenantRepository.Instance.AllTenants = await _repository.GetAllAsync(m => true); + break; + default: + break; + } + await _uow.CompleteAsync(); + } + } +} diff --git a/src/applications/Mixcore/Domain/Subscribers/ThemeSubscriber.cs b/src/applications/Mixcore/Domain/Subscribers/ThemeSubscriber.cs new file mode 100644 index 000000000..ea2097bed --- /dev/null +++ b/src/applications/Mixcore/Domain/Subscribers/ThemeSubscriber.cs @@ -0,0 +1,22 @@ +using Mix.Queue.Engines; +using Mix.Queue.Engines.MixQueue; + +namespace Mixcore.Domain.Subscribers +{ + public class ThemeSubscriber : SubscriberBase + { + static string topicId = typeof(MixThemeViewModel).FullName; + public ThemeSubscriber( + IConfiguration configuration, + MixMemoryMessageQueue queueService) : base(topicId, MixModuleNames.Mixcore, configuration, queueService) + { + } + + public override Task Handler(MessageQueueModel data) + { + var post = data.Data.ToObject(); + Console.WriteLine($"{post.DisplayName} - from {MixModuleNames.Mixcore}"); + return Task.CompletedTask; + } + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/AdditionalDataViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/AdditionalDataViewModel.cs new file mode 100644 index 000000000..e07eb9e58 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/AdditionalDataViewModel.cs @@ -0,0 +1,83 @@ +namespace Mixcore.Domain.ViewModels +{ + public class AdditionalDataViewModel + : HaveParentContentViewModelBase + { + #region Contructors + + public AdditionalDataViewModel() + { + } + + public AdditionalDataViewModel(MixDataContent entity) : base(entity) + { + } + + public AdditionalDataViewModel(UnitOfWorkInfo unitOfWorkInfo = null) : base(unitOfWorkInfo) + { + } + + public AdditionalDataViewModel(MixDataContent entity, UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + #endregion + + #region Properties + + public int MixDatabaseId { get; set; } + public string MixDatabaseName { get; set; } + public List Columns { get; set; } + public List Values { get; set; } + public JObject Data { get; set; } + + public List ChildData { get; set; } = new(); + public List RelatedData { get; set; } = new(); + + public Guid? ContentGuidParentId { get; set; } + public int? ContentIntParentId { get; set; } + public MixDatabaseParentType ContentParentType { get; set; } + + #endregion + + #region Overrides + + public override async Task ExpandView() + { + using var colRepo = MixDatabaseColumnViewModel.GetRepository(UowInfo); + using var valRepo = MixDataContentValueViewModel.GetRepository(UowInfo); + + Values = await valRepo.GetListAsync(m => m.ParentId == Id); + + if (Data == null) + { + Data = MixDataHelper.ParseData(Id, UowInfo); + } + + await Data.LoadAllReferenceDataAsync(Id, MixDatabaseName, UowInfo); + } + + #endregion + + #region Public Methods + + public bool HasValue(string fieldName) + { + return Data?.Value(fieldName) != null; + } + + public T Property(string fieldName) + { + if (Data != null) + { + return Data.Value(fieldName); + } + else + { + return default; + } + } + + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/ModuleContentViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/ModuleContentViewModel.cs new file mode 100644 index 000000000..b85597234 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/ModuleContentViewModel.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; + +namespace Mixcore.Domain.ViewModels +{ + public class ModuleContentViewModel + : ExtraColumnMultilanguageSEOContentViewModelBase + + { + #region Contructors + + public ModuleContentViewModel() + { + } + + public ModuleContentViewModel(MixModuleContent entity, + UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + public ModuleContentViewModel(UnitOfWorkInfo unitOfWorkInfo) : base(unitOfWorkInfo) + { + } + #endregion + + #region Properties + + public string SystemName { get; set; } + public string ClassName { get; set; } + public int? PageSize { get; set; } + public MixModuleType Type { get; set; } + + public string DetailUrl => $"/Module/{Id}/{SeoName}"; + + public Guid? AdditionalDataId { get; set; } + public AdditionalDataViewModel AdditionalData { get; set; } + public PagingResponseModel Data { get; set; } + #endregion + + #region Overrides + public override async Task ExpandView() + { + await LoadAdditionalDataAsync(); + await base.ExpandView(); + } + + #region Private Methods + + private async Task LoadAdditionalDataAsync() + { + if (AdditionalDataId == default) + { + var nav = await Context.MixDataContentAssociation + .FirstOrDefaultAsync( + m => m.ParentType == MixDatabaseParentType.Module + && m.IntParentId == Id); + AdditionalDataId = nav?.DataContentId; + } + if (AdditionalDataId.HasValue) + { + var repo = AdditionalDataViewModel.GetRepository(UowInfo); + AdditionalData = await repo.GetSingleAsync(AdditionalDataId.Value); + } + } + + #endregion + + #endregion + + #region Public Methods + + public T Property(string fieldName) + { + return AdditionalData != null + ? AdditionalData.Property(fieldName) + : default; + } + + public async Task LoadData(PagingModel pagingModel) + { + Data = await ModuleDataViewModel.GetRepository(UowInfo).GetPagingAsync( + m => m.ParentId == Id, + pagingModel); + } + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/ModuleDataViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/ModuleDataViewModel.cs new file mode 100644 index 000000000..200005c42 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/ModuleDataViewModel.cs @@ -0,0 +1,51 @@ +namespace Mixcore.Domain.ViewModels +{ + public class ModuleDataViewModel + : MultilanguageSEOContentViewModelBase + + { + #region Contructors + + public ModuleDataViewModel() + { + } + + public ModuleDataViewModel(MixModuleData entity, + + UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + public ModuleDataViewModel(UnitOfWorkInfo unitOfWorkInfo) : base(unitOfWorkInfo) + { + } + #endregion + + #region Properties + public string Value { get; set; } + + public JObject Data { get; set; } = new JObject(); + #endregion + + #region Overrides + + public override Task ExpandView() + { + if (!string.IsNullOrEmpty(Value)) + { + Data = JObject.Parse(Value); + } + return base.ExpandView(); + } + + #endregion + + #region Helper + public string Property(string name) + { + var prop = Data.Property(name)?.Value; + return prop?.Value("value"); + } + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/NavigationViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/NavigationViewModel.cs new file mode 100644 index 000000000..9467bccc7 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/NavigationViewModel.cs @@ -0,0 +1,56 @@ +namespace Mixcore.Domain.ViewModels +{ + public class NavigationViewModel + : HaveParentContentViewModelBase + { + #region Contructors + + public NavigationViewModel() + { + } + + public NavigationViewModel(MixDataContent entity) : base(entity) + { + } + + public NavigationViewModel(UnitOfWorkInfo unitOfWorkInfo = null) : base(unitOfWorkInfo) + { + } + + public NavigationViewModel(MixDataContent entity, UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + #endregion + + #region Properties + + public int MixDatabaseId { get; set; } + public string MixDatabaseName { get; set; } + public List Columns { get; set; } + public List Values { get; set; } + public JObject Data { get; set; } + + public List ChildData { get; set; } = new(); + public List RelatedData { get; set; } = new(); + + public Guid? ContentGuidParentId { get; set; } + public int? ContentIntParentId { get; set; } + public MixDatabaseParentType ContentParentType { get; set; } + + + public MixNavigation Nav + { + get + { + if (MixDatabaseName == MixDatabaseNames.NAVIGATION && Data != null) + { + return new MixNavigation(Data, Specificulture); + } + return null; + } + } + + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/PageContentViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/PageContentViewModel.cs new file mode 100644 index 000000000..0d660bbe2 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/PageContentViewModel.cs @@ -0,0 +1,101 @@ +using Microsoft.EntityFrameworkCore; + +namespace Mixcore.Domain.ViewModels +{ + [GenerateRestApiController(QueryOnly = true)] + public class PageContentViewModel + : ExtraColumnMultilanguageSEOContentViewModelBase + + { + #region Contructors + + public PageContentViewModel() + { + } + + public PageContentViewModel(MixPageContent entity, + + UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + public PageContentViewModel(UnitOfWorkInfo unitOfWorkInfo) : base(unitOfWorkInfo) + { + } + #endregion + + #region Properties + + public string ClassName { get; set; } + + public string DetailUrl => $"/page/{Id}/{SeoName}"; + + public Guid? AdditionalDataId { get; set; } + + public List Modules { get; set; } + public AdditionalDataViewModel AdditionalData { get; set; } + #endregion + + #region Overrides + public override async Task ExpandView() + { + await LoadModulesAsync(); + await LoadAdditionalDataAsync(); + await base.ExpandView(); + } + + + + #endregion + + #region Public Method + public ModuleContentViewModel GetModule(string moduleName) + { + return Modules.FirstOrDefault(m => m.SystemName == moduleName); + } + public T Property(string fieldName) + { + return AdditionalData != null + ? AdditionalData.Property(fieldName) + : default; + } + + #endregion + #region Private Methods + private async Task LoadAdditionalDataAsync() + { + if (AdditionalDataId == default) + { + var nav = await Context.MixDataContentAssociation + .FirstOrDefaultAsync(m => m.ParentType == MixDatabaseParentType.Page + && m.IntParentId == Id); + AdditionalDataId = nav?.DataContentId; + } + if (AdditionalDataId.HasValue) + { + var repo = AdditionalDataViewModel.GetRepository(UowInfo); + AdditionalData = await repo.GetSingleAsync(AdditionalDataId.Value); + } + } + + private async Task LoadModulesAsync() + { + var tasks = new List(); + var moduleIds = await Context.MixPageModuleAssociation + .AsNoTracking() + .Where(p => p.LeftId == Id) + .OrderBy(m => m.Priority) + .Select(m => m.RightId) + .ToListAsync(); + var moduleRepo = ModuleContentViewModel.GetRepository(UowInfo); + Modules = await moduleRepo.GetListAsync(m => moduleIds.Contains(m.Id)); + var paging = new PagingModel(); + foreach (var item in Modules) + { + tasks.Add(item.LoadData(paging)); + } + await Task.WhenAll(tasks); + } + #endregion + } +} diff --git a/src/applications/Mixcore/Domain/ViewModels/PostContentViewModel.cs b/src/applications/Mixcore/Domain/ViewModels/PostContentViewModel.cs new file mode 100644 index 000000000..59c620730 --- /dev/null +++ b/src/applications/Mixcore/Domain/ViewModels/PostContentViewModel.cs @@ -0,0 +1,79 @@ +using Microsoft.EntityFrameworkCore; +using Mix.Shared.Services; + +namespace Mixcore.Domain.ViewModels +{ + [GenerateRestApiController(QueryOnly = true)] + public class PostContentViewModel + : ExtraColumnMultilanguageSEOContentViewModelBase + + { + #region Contructors + + public PostContentViewModel() + { + } + + public PostContentViewModel(MixPostContent entity, + + UnitOfWorkInfo uowInfo = null) : base(entity, uowInfo) + { + } + + public PostContentViewModel(UnitOfWorkInfo unitOfWorkInfo) : base(unitOfWorkInfo) + { + } + #endregion + + #region Properties + + public string ClassName { get; set; } + + public string DetailUrl => $"{GlobalConfigService.Instance.Domain}/post/{Id}/{SeoName}"; + + public Guid? AdditionalDataId { get; set; } + + public AdditionalDataViewModel AdditionalData { get; set; } + #endregion + + #region Overrides + public override async Task ExpandView() + { + await LoadAdditionalDataAsync(); + await base.ExpandView(); + } + + + + #endregion + + #region Public Method + + public T Property(string fieldName) + { + return AdditionalData != null + ? AdditionalData.Property(fieldName) + : default; + } + + #endregion + #region Private Methods + private async Task LoadAdditionalDataAsync() + { + if (AdditionalDataId == default) + { + var nav = await Context.MixDataContentAssociation + .FirstOrDefaultAsync(m => m.ParentType == MixDatabaseParentType.Page + && m.IntParentId == Id); + AdditionalDataId = nav?.DataContentId; + } + if (AdditionalDataId.HasValue) + { + var repo = AdditionalDataViewModel.GetRepository(UowInfo); + AdditionalData = await repo.GetSingleAsync(AdditionalDataId.Value); + } + } + + #endregion + } +} diff --git a/src/Mix.Cms.Web/Models/ErrorViewModel.cs b/src/applications/Mixcore/Models/ErrorViewModel.cs similarity index 84% rename from src/Mix.Cms.Web/Models/ErrorViewModel.cs rename to src/applications/Mixcore/Models/ErrorViewModel.cs index 7a477a529..937bb74e9 100644 --- a/src/Mix.Cms.Web/Models/ErrorViewModel.cs +++ b/src/applications/Mixcore/Models/ErrorViewModel.cs @@ -1,4 +1,4 @@ -namespace Mix.Cms.Web.Models +namespace Mixcore.Models { public class ErrorViewModel { @@ -6,4 +6,4 @@ public class ErrorViewModel public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } -} \ No newline at end of file +} diff --git a/src/applications/Mixcore/Program.cs b/src/applications/Mixcore/Program.cs new file mode 100644 index 000000000..1052b98b6 --- /dev/null +++ b/src/applications/Mixcore/Program.cs @@ -0,0 +1,15 @@ +namespace Mixcore +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + return MixHelper.CreateHostBuilder(args); + } + } +} diff --git a/src/applications/Mixcore/Properties/launchSettings.json b/src/applications/Mixcore/Properties/launchSettings.json new file mode 100644 index 000000000..0cc05de43 --- /dev/null +++ b/src/applications/Mixcore/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:39170", + "sslPort": 44358 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Mixcore": { + "commandName": "Project", + "dotnetRunMessages": "true", + "launchBrowser": true, + "applicationUrl": "https://localhost:5010;http://localhost:5011;https://v2.dev.mixcore.org/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/applications/Mixcore/Readme.md b/src/applications/Mixcore/Readme.md new file mode 100644 index 000000000..e42f2d525 --- /dev/null +++ b/src/applications/Mixcore/Readme.md @@ -0,0 +1,45 @@ + +# Run module as a microservice : +## 1. Remove Reference to module from Mixcore project +## 2. Copy MixContent to Module's source code +## 3. Update ocelot.json.(Ref: https://ocelot.readthedocs.io/en/latest/features/configuration.html). +Ex: +``` +"Routes": [ + { + "DownstreamPathTemplate": "/api/v2/rest/mix-account/{catchALl}", + "DownstreamScheme": "https", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5002 + } + ], + "UpstreamPathTemplate": "/api/v2/rest/mix-account/{catchALl}", + "UpstreamHttpMethod": [ "Get", "Post", "Put", "Patch", "Delete" ] + }, + { + "DownstreamPathTemplate": "/api/v2/rest/mix-portal/{catchALl}", + "DownstreamScheme": "https", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 5006 + } + ], + "UpstreamPathTemplate": "/api/v2/rest/mix-portal/{catchALl}", + "UpstreamHttpMethod": [ "Get", "Post", "Put", "Patch", "Delete" ] + } +] +``` +## 4. Remove Config Http2 from appsettings if exist. +``` +"Kestrel": { + "EndpointDefaults": { + "Protocols": "Http2" + } + } +``` +## 5. Update "EnableOcelot" in mixcore -> global.json = true. + +**Make sure the enpoints in MixContent/AppConfigs/endpoints.json are correct (when deploy to from local to production, must change the localhost to real endpoints)** \ No newline at end of file diff --git a/src/applications/Mixcore/Startup.cs b/src/applications/Mixcore/Startup.cs new file mode 100644 index 000000000..902233b7d --- /dev/null +++ b/src/applications/Mixcore/Startup.cs @@ -0,0 +1,82 @@ +using Mix.Database.Entities.Account; +using Mix.Shared.Services; +using Mixcore.Domain.Subscribers; +using Ocelot.DependencyInjection; +using System.Reflection; +using System.Text.Encodings.Web; +using System.Text.Unicode; + +namespace Mixcore +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddWebEncoders(options => + { + options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All); + }); + + services.AddMixCors(); + + + services.AddMixServices(Assembly.GetExecutingAssembly(), Configuration); + services.AddScoped(); + + // Queue Subscribers + services.AddHostedService(); + services.AddHostedService(); + services.AddHostedService(); + services.AddHostedService(); + services.AddHostedService(); + + services.AddMixAuthorize(); + services.AddMixRoutes(); + + // Must app Auth config after Add mixservice to init App config + services.AddMixOcelot(Configuration); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (!env.IsDevelopment()) + { + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseCors(builder => + { + builder.AllowAnyOrigin(); + builder.AllowAnyMethod(); + builder.AllowAnyHeader(); + builder.WithExposedHeaders("Grpc-Status", "Grpc-Message"); + }); + + app.UseMixApps(Assembly.GetExecutingAssembly(), Configuration, env.IsDevelopment()); + + app.UseStaticFiles(); + + if (GlobalConfigService.Instance.AppSettings.EnableOcelot) + { + app.UseMixOcelot(Configuration, env.IsDevelopment()); + } + if (GlobalConfigService.Instance.AppSettings.IsHttps) + { + app.UseHttpsRedirection(); + } + + + app.UseMixRoutes(); + } + } +} diff --git a/src/applications/Mixcore/Views/Home/Index.cshtml b/src/applications/Mixcore/Views/Home/Index.cshtml new file mode 100644 index 000000000..303e5cdd4 --- /dev/null +++ b/src/applications/Mixcore/Views/Home/Index.cshtml @@ -0,0 +1,72 @@ +@model PageContentViewModel +@{ + Layout = Model.Layout?.FilePath; +} +@* + + *@ + + +@if (!string.IsNullOrEmpty(Model.Template?.FilePath)) +{ + try + { + @*foreach (var item in navs) + { + @item.ToString() + }*@ + + } + catch (System.InvalidOperationException invalidOperationException) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @invalidOperationException + + } + catch (Exception ex) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @ex + + } +} +else +{ +
    +

    Please choose template

    +
    +} +@{ + string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailUrl; + var domain = url.IndexOf("http") == -1 ? $"{Context.Request.Scheme}://{Context.Request.Host}" : string.Empty; + string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; + string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; + string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.Image; +} +@section Seo{ + @Model.SeoTitle + + + + + + + + + + +} +@section Styles{ + + @Html.Raw(Model.Layout?.Styles) + + @Html.Raw(Model.Template?.Styles) +} +@section Scripts{ + + @Html.Raw(Model.Layout?.Scripts) + + @Html.Raw(Model.Template?.Scripts) +} \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Init/Index.cshtml b/src/applications/Mixcore/Views/Init/Index.cshtml new file mode 100644 index 000000000..59bc72d37 --- /dev/null +++ b/src/applications/Mixcore/Views/Init/Index.cshtml @@ -0,0 +1,75 @@ +@inject MixConfigurationService configService + + + + + + + + + Init Cms - Mixcore + + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Page/Index.cshtml b/src/applications/Mixcore/Views/Page/Index.cshtml new file mode 100644 index 000000000..0d4a82176 --- /dev/null +++ b/src/applications/Mixcore/Views/Page/Index.cshtml @@ -0,0 +1,67 @@ +@model PageContentViewModel +@{ + Layout = Model.Layout?.FilePath; + ViewData["Title"] = "Home Page"; +} + + + +@if (!string.IsNullOrEmpty(Model.Template?.FilePath)) +{ + try + { + + } + catch (System.InvalidOperationException invalidOperationException) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @invalidOperationException + + } + catch (Exception ex) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @ex + + } +} +else +{ +
    +

    Please choose template

    +
    +} +@{ + string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailUrl; + var domain = url.IndexOf("http") == -1 ? $"{Context.Request.Scheme}://{Context.Request.Host}" : string.Empty; + string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; + string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; + string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.Image; +} +@section Seo{ +@Model.SeoTitle + + + + + + + + + + +} +@section Styles{ + + @Html.Raw(Model.Layout?.Styles) + + @Html.Raw(Model.Template?.Styles) +} +@section Scripts{ + + @Html.Raw(Model.Layout?.Scripts) + + @Html.Raw(Model.Template?.Scripts) +} \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Portal/Index.cshtml b/src/applications/Mixcore/Views/Portal/Index.cshtml new file mode 100644 index 000000000..206c1881d --- /dev/null +++ b/src/applications/Mixcore/Views/Portal/Index.cshtml @@ -0,0 +1,83 @@ +@inject MixConfigurationService configService +@{ + Layout = null; + var menus = MixFileHelper.GetFile("portal-menus", ".json", MixFolders.JsonDataFolder); +} + + + + + + @ViewData["Title"] - Angular mixcore + + + + + + + + + + + + + + +
    + + + +
    + + +
    +
    + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Post/Index.cshtml b/src/applications/Mixcore/Views/Post/Index.cshtml new file mode 100644 index 000000000..4bbec5d11 --- /dev/null +++ b/src/applications/Mixcore/Views/Post/Index.cshtml @@ -0,0 +1,67 @@ +@model PostContentViewModel +@{ + Layout = Model.Layout.FilePath; + ViewData["Title"] = Model.SeoTitle; +} + + + +@if (!string.IsNullOrEmpty(Model.Template.FilePath)) +{ + try + { + + } + catch (System.InvalidOperationException invalidOperationException) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @invalidOperationException + + } + catch (Exception ex) + { +

    Unable load template @Model.Template.FilePath with Exception detail below:

    + + @ex + + } +} +else +{ +
    +

    Please choose template

    +
    +} +@{ + string url = ViewData["OgUrl"] != null ? (string)ViewData["OgUrl"] : Model.DetailUrl; + var domain = url.IndexOf("http") == -1 ? $"{Context.Request.Scheme}://{Context.Request.Host}" : string.Empty; + string title = ViewData["OgTitle"] != null ? (string)ViewData["OgTitle"] : Model.SeoTitle; + string desc = ViewData["OgDescription"] != null ? (string)ViewData["OgDescription"] : Model.SeoDescription; + string image = ViewData["OgImage"] != null ? (string)ViewData["OgImage"] : Model.Image; +} +@section Seo{ +@Model.SeoTitle + + + + + + + + + + +} +@section Styles{ + + @Html.Raw(Model.Layout?.Styles) + + @Html.Raw(Model.Template?.Styles) +} +@section Scripts{ + + @Html.Raw(Model.Layout?.Scripts) + + @Html.Raw(Model.Template?.Scripts) +} \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Security/ExternalLoginResult.cshtml b/src/applications/Mixcore/Views/Security/ExternalLoginResult.cshtml new file mode 100644 index 000000000..a3567065d --- /dev/null +++ b/src/applications/Mixcore/Views/Security/ExternalLoginResult.cshtml @@ -0,0 +1,12 @@ +@model Mix.Identity.Models.AccountViewModels.ExternalLoginResultModel +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ +} + + \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Security/Index.cshtml b/src/applications/Mixcore/Views/Security/Index.cshtml new file mode 100644 index 000000000..ea86d34de --- /dev/null +++ b/src/applications/Mixcore/Views/Security/Index.cshtml @@ -0,0 +1,90 @@ +@inject MixConfigurationService configService +@{ + Layout = null; +} + + + + + + + + + + @ViewData["Title"] - mixcore + + + @* + *@ + + + + + + + + + + + + + + +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/applications/Mixcore/Views/Shared/Error.cshtml b/src/applications/Mixcore/Views/Shared/Error.cshtml new file mode 100644 index 000000000..a1e04783c --- /dev/null +++ b/src/applications/Mixcore/Views/Shared/Error.cshtml @@ -0,0 +1,25 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

    Error.

    +

    An error occurred while processing your request.

    + +@if (Model.ShowRequestId) +{ +

    + Request ID: @Model.RequestId +

    +} + +

    Development Mode

    +

    + Swapping to Development environment will display more detailed information about the error that occurred. +

    +

    + The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

    diff --git a/src/Mix.Cms.Web/Views/Shared/_Layout.cshtml b/src/applications/Mixcore/Views/Shared/_Layout.cshtml similarity index 80% rename from src/Mix.Cms.Web/Views/Shared/_Layout.cshtml rename to src/applications/Mixcore/Views/Shared/_Layout.cshtml index 0bd3c8789..7abfed68b 100644 --- a/src/Mix.Cms.Web/Views/Shared/_Layout.cshtml +++ b/src/applications/Mixcore/Views/Shared/_Layout.cshtml @@ -3,20 +3,20 @@ - @ViewData["Title"] - Mix.Cms.Web + @ViewData["Title"] - Mixcore - +