Compare commits

...

2334 Commits

Author SHA1 Message Date
c8f56e1659 Merge pull request #2461 from oqtane/master
Merge pull request #2460 from oqtane/dev
2022-10-17 16:46:03 -04:00
56631a3e6b Merge pull request #2460 from oqtane/dev
3.2.1 release
2022-10-17 16:45:47 -04:00
84ee9de18c Merge pull request #2459 from sbwalker/dev
Changed default service url in MAUI so users can immediately run client app
2022-10-17 08:12:53 -04:00
0aeb4e9173 Changed default service url in MAUI so users can immediately run client app 2022-10-17 08:12:04 -04:00
bb65e5c373 Merge pull request #2455 from sbwalker/dev
prepare for 3.2.1 release
2022-10-13 13:35:36 -04:00
45e2027c56 prepare for 3.2.1 release 2022-10-13 13:34:43 -04:00
6dc5ef44b7 Merge pull request #2454 from sbwalker/dev
Resolve deserialization issue with System.Text.Json when accessing remote services
2022-10-12 12:38:08 -04:00
e88d3cca07 Resolve deserialization issue with System.Text.Json when accessing remote services 2022-10-12 12:37:03 -04:00
a4b7381141 Merge pull request #2451 from sbwalker/dev
fix #2435 - remove NewtonSoft.Json dependency
2022-10-11 08:35:44 -04:00
2ea054dc72 fix #2435 - remove NewtonSoft.Json dependency 2022-10-11 08:34:33 -04:00
13ec726ab2 Merge pull request #2450 from sbwalker/dev
add file download event
2022-10-05 08:02:22 -04:00
2e32b65421 add file download event 2022-10-05 08:00:45 -04:00
f48ca53cdb Merge pull request #2449 from sbwalker/dev
Enhance SyncManager to raise events which can be handled on the server within hosted services. Raise create, update, delete events for all major entities. Include support for refresh and reload events to synchronize client state. Move client state cache invalidation to a hosted service to separate concerns and demonstrate events.
2022-10-04 19:21:35 -04:00
c5b632cb24 Enhance SyncManager to raise events which can be handled on the server within hosted services. Raise create, update, delete events for all major entities. Include support for refresh and reload events to synchronize client state. Move client state cache invalidation to a hosted service to separate concerns and demonstrate events. 2022-10-04 19:20:02 -04:00
422e9ae99e Update README.md 2022-09-30 15:24:15 -04:00
68ada8fbe4 Merge pull request #2431 from chlupac/InstallFix
Unattended installation fix
2022-09-30 11:49:06 -04:00
e40bf08691 Merge pull request #2446 from sbwalker/dev
add upgrade logic for sites using remapped identifier and email claim…
2022-09-30 09:54:59 -04:00
a04c7222b2 add upgrade logic for sites using remapped identifier and email claim types 2022-09-30 09:53:37 -04:00
172faec5a0 Merge pull request #2445 from sbwalker/dev
log any user creation errors from .NET Identity
2022-09-29 17:18:48 -04:00
e01c3e7e4a log any user creation errors from .NET Identity 2022-09-29 17:16:29 -04:00
7a3d5d0429 Merge pull request #2444 from sbwalker/dev
fix #2432 - add support for roles as part of external login via OIDC
2022-09-29 16:34:18 -04:00
ddf1caaaaa fix #2432 - add support for roles as part of external login via OIDC 2022-09-29 16:32:50 -04:00
021293cbb0 Merge pull request #2443 from sbwalker/dev
fix #2427 - issue with upgrade available in Language Management
2022-09-28 16:18:08 -04:00
1438e61f1b fix #2427 - issue with upgrade available in Language Management 2022-09-28 16:16:46 -04:00
182f4dbae7 Merge pull request #2442 from sbwalker/dev
fix #2426 - error in recycle bin
2022-09-28 13:56:46 -04:00
26ec3fc7cf fix #2426 - error in recycle bin 2022-09-28 13:55:12 -04:00
225c758795 Merge pull request #2440 from leigh-pointer/PagerFooter
Add footer to the Pager control
2022-09-28 09:45:48 -04:00
5e653250f3 Merge pull request #2441 from sbwalker/dev
Fix #2439 - ensure resource urls are constructed consistently on client and server
2022-09-28 09:44:32 -04:00
b7a3713946 Fix #2439 - ensure resource urls are constructed consistently on client and server 2022-09-28 09:43:02 -04:00
44242fdb4a Add footer to the Pager control
Mirrored the Head functionality for <tfoot> tag
2022-09-28 14:00:53 +02:00
45515b2c06 Unattented instalation fix 2022-09-24 15:44:20 +02:00
2d95fe294c Merge pull request #2430 from sbwalker/dev
Add Blazor Server reconnect script, fix event log direct link from notification email, add more validation to Pager, improve browser refresh script to wait for server availability
2022-09-24 08:38:54 -04:00
72cc44641b Add Blazor Server reconnect script, fix event log direct link from notification email, add more validation to Pager, improve browser refresh script to wait for server availability 2022-09-24 08:37:18 -04:00
9ac3fa5269 Merge pull request #2425 from sbwalker/dev
fix new id convention in file server
2022-09-21 15:39:20 -04:00
d1ea141165 fix new id convention in file server 2022-09-21 15:37:52 -04:00
dca21fbb8c Merge pull request #2424 from sbwalker/dev
improve BaseUrl handling for MAUI, replace ContentUrl with FileUrl and improve file server
2022-09-21 13:39:51 -04:00
06812d5df8 improve BaseUrl handling for MAUI, replace ContentUrl with FileUrl and improve file server 2022-09-21 13:38:21 -04:00
564410d3cd Update README.md 2022-09-19 17:10:11 -04:00
4b1cec979a Merge pull request #2422 from sbwalker/dev
rename list name to match intent
2022-09-14 22:30:05 -04:00
a5f1bc3895 rename list name to match intent 2022-09-14 22:28:31 -04:00
b097d031b5 Merge pull request #2421 from sbwalker/dev
clean up pdb files on client, hash assembly file names
2022-09-14 10:11:22 -04:00
45df729711 clean up pdb files on client, hash assembly file names 2022-09-14 10:09:50 -04:00
802ee8a1ff Merge pull request #2419 from oqtane/master
Merge pull request #2418 from oqtane/dev
2022-09-13 09:18:35 -04:00
e312970212 Merge pull request #2418 from oqtane/dev
3.2.0 release
2022-09-13 09:18:16 -04:00
c0f4069a9b Merge pull request #2417 from sbwalker/dev
refactor IndexedDB interop functions
2022-09-13 07:44:10 -04:00
654352827e refactor IndexedDB interop functions 2022-09-13 07:42:27 -04:00
7dd210976d Merge pull request #2416 from sbwalker/dev
optimize assembly list retrieval
2022-09-12 16:21:11 -04:00
5302be8bc1 optimize assembly list retrieval 2022-09-12 16:19:32 -04:00
9ed7181e28 Merge pull request #2415 from sbwalker/dev
remove unnecessary using statements
2022-09-12 14:56:35 -04:00
23ae4b01cb remove unnecessary using statements 2022-09-12 14:54:31 -04:00
59764d3378 Merge pull request #2414 from sbwalker/dev
cache assemblies in IndexedDB on WebAssembly
2022-09-12 14:48:17 -04:00
b8e2c729c1 cache assemblies in IndexedDB on WebAssembly 2022-09-12 14:46:46 -04:00
530d80a011 Merge pull request #2412 from sbwalker/dev
optimize assembly loading for MAUI to use client storage
2022-09-11 10:50:20 -04:00
2d306e8fda optimize assembly loading for MAUI to use client storage 2022-09-11 10:48:40 -04:00
b3d9a70fd1 Merge pull request #2410 from sbwalker/dev
remove Oqtane.Server from Oqtane.Maui solution
2022-09-09 11:40:06 -04:00
b880207f61 remove Oqtane.Server from Oqtane.Maui solution 2022-09-09 11:37:33 -04:00
ee76d02999 Merge pull request #2409 from sbwalker/dev
improvements to run in Android Emulator
2022-09-09 10:27:45 -04:00
804c33a375 improvements to run in Android Emulator 2022-09-09 10:26:13 -04:00
de784714d9 Merge pull request #2408 from sbwalker/dev
fix issue in upgrade logic for making folder paths cross platform
2022-09-08 15:44:34 -04:00
2404e26b61 fix issue in upgrade logic for making folder paths cross platform 2022-09-08 15:43:03 -04:00
b191fdda2c Merge pull request #2407 from sbwalker/dev
prepare for 3.2.0
2022-09-08 15:30:05 -04:00
e8adfd45d2 prepare for 3.2.0 2022-09-08 15:28:25 -04:00
7158595801 Merge pull request #2406 from orionlaw/dev
Make sure Job date times are stored in the database as UTC.
2022-09-08 09:14:31 -04:00
ba97f63338 Make sure Job date times are stored in the database as UTC. This is required if using Postgres or you will get an exception with a message of “Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported.”. 2022-09-07 12:46:24 -06:00
62eca2aedc Merge pull request #2401 from chlupac/BackslashFix
Backslash fix.
2022-09-06 10:53:48 -04:00
b15f6b1fa7 Merge pull request #2402 from chlupac/GitignoreUpdate
Gitignore update
2022-09-06 10:53:05 -04:00
5b22de589c Merge pull request #2403 from sbwalker/dev
Fix #2399 - page paths not being validated for deleted pages
2022-09-06 10:52:34 -04:00
d1f50f12af Fix #2399 - page paths not being validated for deleted pages 2022-09-06 10:50:53 -04:00
d40c1d9b31 Backslash fix. 2022-09-06 09:14:58 +02:00
b69041d4af Gitignore update 2022-09-06 09:14:42 +02:00
64c5d9a09f Merge pull request #2400 from sbwalker/dev
more changes to support Default pane
2022-09-05 15:51:22 -04:00
dd170bb41a more changes to support Default pane 2022-09-05 15:49:38 -04:00
1e6e4033f8 Merge pull request #2398 from sbwalker/dev
changed UrlParameterTemplate name for consistency
2022-09-04 09:48:48 -04:00
01fabc8d9e changed UrlParameterTemplate name for consistency 2022-09-04 09:47:03 -04:00
2ca2539b53 Merge pull request #2397 from sbwalker/dev
fix #2366 - populate new UrlParameters property
2022-09-04 09:37:09 -04:00
51e2e2966f fix #2366 - populate new UrlParameters property 2022-09-04 09:35:18 -04:00
55d02d2db5 Merge pull request #2396 from sbwalker/dev
Fix #2382 - Admin pane improvements
2022-09-02 18:11:51 -04:00
282a0b0c44 Fix #2382 - Admin pane improvements 2022-09-02 18:10:13 -04:00
8432779b23 Merge pull request #2395 from sbwalker/dev
added public Refresh method to FileManager
2022-09-02 09:12:41 -04:00
13b9982461 added public Refresh method to FileManager 2022-09-02 09:11:00 -04:00
d76b8cebdc Merge pull request #2389 from sbwalker/dev
Changes for .NET MAUI on Android
2022-08-31 16:35:53 -04:00
80315ae6d4 Changes for .NET MAUI on Android 2022-08-31 16:34:14 -04:00
95e7344286 Merge pull request #2385 from sbwalker/dev
moved hierarchical ordering logic to server for pages and folders
2022-08-30 07:33:46 -04:00
28f73727b5 moved hierarchical ordering logic to server for pages and folders 2022-08-30 07:31:56 -04:00
68f5bf5759 Merge pull request #2384 from sbwalker/dev
made folder paths cross platform, introduced file handler for abstracting the serving of files, enabled url mapping for broken file links, resolved public folder deletion issue
2022-08-30 07:23:50 -04:00
075748d697 made folder paths cross platform, introduced file handler for abstracting the serving of files, enabled url mapping for broken file links, resolved public folder deletion issue 2022-08-30 07:21:52 -04:00
e8d86f94f2 Merge pull request #2376 from sbwalker/dev
fix rootnamespace
2022-08-19 16:12:32 -04:00
d6bb802892 fix rootnamespace 2022-08-19 16:10:27 -04:00
52680e9002 Merge pull request #2375 from sbwalker/dev
prepare for 3.2.0
2022-08-19 15:59:35 -04:00
d6385d82ae prepare for 3.2.0 2022-08-19 15:57:31 -04:00
d058de067c Merge pull request #2374 from sbwalker/dev
Prepare for 3.2.0 release
2022-08-19 15:56:39 -04:00
32d6d143dd Prepare for 3.2.0 release 2022-08-19 15:54:33 -04:00
b49432802b Merge pull request #2373 from sbwalker/dev
Improvements to richtexteditor to allow file management in raw html editor. Also allow disabling of raw html editor which can be utilized via new setting in Html/Text module.
2022-08-19 15:34:43 -04:00
99d4d75d8e Improvements to richtexteditor to allow file management in raw html editor. Also allow disabling of raw html editor which can be utilized via new setting in Html/Text module. 2022-08-19 15:32:30 -04:00
1f584d57ac Merge pull request #2372 from sbwalker/dev
optimize Url Parameters and implement in Event Log
2022-08-18 16:06:34 -04:00
2c1543aa82 optimize Url Parameters and implement in Event Log 2022-08-18 16:04:30 -04:00
4390cbbfae Update README.md 2022-08-18 08:35:49 -04:00
bbf9e5717e Merge pull request #2370 from sbwalker/dev
improve support for module content editors
2022-08-16 17:27:54 -04:00
c7edc28bd9 improve support for module content editors 2022-08-16 17:25:46 -04:00
6e0de6f7bf Merge pull request #2369 from sbwalker/dev
check for existence of appsettings.json on Maui
2022-08-16 09:42:14 -04:00
3659422165 check for existence of appsettings.json on Maui 2022-08-16 09:40:03 -04:00
1af30da44e Merge pull request #2368 from sbwalker/dev
trim list of pages allowed to be Home Page
2022-08-16 08:44:53 -04:00
56c082cb26 trim list of pages allowed to be Home Page 2022-08-16 08:42:47 -04:00
e8eca582de Merge pull request #2363 from sbwalker/dev
added ability to specify a site home page, updated default template content to include .NET MAUI
2022-08-15 17:03:34 -04:00
4084b352de added ability to specify a site home page, updated default template content to include .NET MAUI 2022-08-15 17:01:20 -04:00
633e4acf0e Merge pull request #2362 from sbwalker/dev
add Site option for specifying a Hosting Model of Blazor Hybrid
2022-08-15 09:32:42 -04:00
468df15d80 add Site option for specifying a Hosting Model of Blazor Hybrid 2022-08-15 09:30:36 -04:00
f4537b4fcb Merge pull request #2361 from sbwalker/dev
optimize site router
2022-08-14 11:24:43 -04:00
8bca345b45 optimize site router 2022-08-14 11:22:39 -04:00
ee80712c77 Merge pull request #2360 from sbwalker/dev
resolve issue with deleted pages and modules caused by refactoring
2022-08-12 18:04:51 -04:00
3cf7153f44 resolve issue with deleted pages and modules caused by refactoring 2022-08-12 18:02:45 -04:00
8e2fc75e48 Update README.md 2022-08-12 17:09:15 -04:00
4aa51c8583 Merge pull request #2359 from sbwalker/dev
performance improvements to reduce http and database interactions
2022-08-12 16:49:59 -04:00
3c6ebd7742 performance improvements to reduce http and database interactions 2022-08-12 16:47:51 -04:00
b85539dc17 Merge pull request #2358 from sbwalker/dev
add ability to dynamically set module title and visible from components
2022-08-12 13:08:14 -04:00
4cae3f02ed add ability to dynamically set module title and visible from components 2022-08-12 13:05:48 -04:00
469b436f10 Merge pull request #2356 from dkoeder/dev
Some methods failing in BaseEntityBuilder if Schema is not null.
2022-08-12 10:45:14 -04:00
66e3e6729b Merge pull request #2357 from sbwalker/dev
add support for preserving state when loading admin components
2022-08-12 10:45:05 -04:00
fc6a794714 add support for preserving state when loading admin components 2022-08-12 10:43:00 -04:00
d75ed3d5ac Update BaseEntityBuilder.cs
Some methods failing in BaseEntityBuilder if Schema is not null.
2022-08-11 16:15:09 -06:00
bd0a218214 Merge pull request #2355 from sbwalker/dev
Blazor Hybrid / .NET MAUI support
2022-08-11 17:11:45 -04:00
f96129fa37 Blazor Hybrid / .NET MAUI support 2022-08-11 17:09:32 -04:00
920418618a Update README.md 2022-08-10 08:30:38 -04:00
29247481a6 Merge pull request #2351 from ajahangard/patch-1
#Bug in passing Lifetime property to GenerateToken
2022-08-09 10:47:28 -04:00
773710aeef #Bug in passing Lifetime property to GenerateToken
Audience is passed to GenerateToken instead of Lifetime.
2022-08-09 15:32:52 +04:30
d0c8ee57e6 Merge pull request #2348 from sbwalker/dev
Fix satellite assembly loading issue when running on WebAssembly
2022-08-08 10:49:42 -04:00
cf2adc7f6a Fix satellite assembly loading issue when running on WebAssembly 2022-08-08 10:47:33 -04:00
b621f24540 Merge pull request #2342 from sbwalker/dev
Fix #2336 - error.png path incorrect
2022-08-06 16:27:45 -04:00
99be638525 Fix #2336 - error.png path incorrect 2022-08-06 16:27:24 -04:00
d35c204e07 Merge pull request #2341 from sbwalker/dev
Fix #2339 - refactor module upgrade logic to  remove requirement on ServerManagerType for modules which have no backend
2022-08-06 16:13:53 -04:00
d8b4267668 Fix #2339 - refactor module upgrade logic to remove requirement on ServerManagerType for modules which have no backend 2022-08-06 16:13:28 -04:00
3c2f3be451 Merge pull request #2338 from chlupac/TruncateAgent
Truncate UserAgent for save to Visitors table #2337
2022-08-05 09:16:54 -04:00
e846cf8672 Truncate UserAgent for save to Visitors table 2022-08-04 16:14:39 +02:00
8804bce6c0 Merge pull request #2331 from sbwalker/dev
add proper translation keys for ActionLink and ActionDialog into RESX for Module Creator template
2022-08-03 08:50:12 -04:00
83acda6d05 add proper translation keys for ActionLink and ActionDialog into RESX for Module Creator template 2022-08-03 08:49:47 -04:00
063719532f Merge pull request #2328 from sbwalker/dev
include ResourceType attribute in Settings component for external module template
2022-08-02 07:55:38 -04:00
7b1b061355 include ResourceType attribute in Settings component for external module template 2022-08-02 07:55:11 -04:00
ed4540887e Merge pull request #2326 from leigh-pointer/Bootstrap5.2
Formating issues with Bootstrap 5.2
2022-08-02 07:51:33 -04:00
6968476ed0 Merge pull request #2327 from leigh-pointer/ScreenProgess
Added Progress Indicator
2022-08-02 07:50:59 -04:00
5d2c7c3058 Added Progress Indicator
When deleting large blocks of Pages, Modules or Notifications there was currently no visual feedback so added the ModuleInstance.ShowProgressIndicator() and ModuleInstance.HideProgressIndicator() calls to these processes.
2022-08-02 10:37:04 +02:00
e6cb90e545 Formating issues with Bootstrap 5.2 2022-08-02 08:55:42 +02:00
ec73f4dbea Merge pull request #2322 from leigh-pointer/Bootstrap5.2
Updated Bootstrap to 5.2
2022-08-01 17:36:10 -04:00
4f41a52ee7 Merge pull request #2325 from sbwalker/dev
fix upgrade issue for framework translations, improvements for managing module translations
2022-08-01 17:05:57 -04:00
c097956fcb fix upgrade issue for framework translations, improvements for managing module translations 2022-08-01 17:05:18 -04:00
8cbc17ed98 Theme Creator updated to Bootstrap 5.2.0 2022-07-28 20:59:52 +02:00
50d89d0f13 Updated Bootstrap to 5.2
Replaced Bootstrap cloudflare versions and Integrity keys to match 5.2.0
2022-07-28 20:52:11 +02:00
7b4d13b73e Merge pull request #2318 from oqtane/master
Merge pull request #2317 from oqtane/dev
2022-07-27 16:16:01 -04:00
2909aa1656 Merge pull request #2317 from oqtane/dev
3.1.4 release
2022-07-27 16:15:43 -04:00
64131b6764 Update README.md 2022-07-27 08:54:48 -04:00
0b78d75a21 Merge pull request #2314 from sbwalker/dev
prepare for 3.1.4 release
2022-07-26 17:22:27 -04:00
b35c342960 prepare for 3.1.4 release 2022-07-26 17:22:06 -04:00
24c858d379 Merge pull request #2313 from sbwalker/dev
support for module translation download/install
2022-07-26 14:44:25 -04:00
b8a31a8be9 support for module translation download/install 2022-07-26 14:44:06 -04:00
02c30d6454 Merge pull request #2312 from sbwalker/dev
add ability to supply connection string in Add Site
2022-07-26 10:13:14 -04:00
985f003e6d add ability to supply connection string in Add Site 2022-07-26 10:12:54 -04:00
98045e1e2e Merge pull request #2311 from sbwalker/dev
introduce ITransientService interface for auto registration of transient services (for DBContexts and Repositories)
2022-07-26 09:42:12 -04:00
5762ce58a4 introduce ITransientService interface for auto registration of transient services (for DBContexts and Repositories) 2022-07-26 09:41:42 -04:00
2787ee71fc Merge pull request #2310 from sbwalker/dev
Allow for entry of raw connection string during installation
2022-07-26 07:48:29 -04:00
e61a6df4d7 Allow for entry of raw connection string during installation 2022-07-26 07:48:04 -04:00
0a5c2ecbf5 Merge pull request #2304 from sbwalker/dev
optimize satellite assembly loading based on the new model where all cultures are available
2022-07-21 16:02:48 -04:00
6bfab696ad optimize satellite assembly loading based on the new model where all cultures are available 2022-07-21 16:02:23 -04:00
928f2dd496 Merge pull request #2302 from chlupac/FileServiceFix
FileService fix
2022-07-20 08:23:41 -04:00
bcf75892f7 FileService fix 2022-07-20 10:39:13 +02:00
594761385f Merge pull request #2301 from sbwalker/dev
add Environment to System Info
2022-07-19 14:34:10 -04:00
d05fba06ec add Environment to System Info 2022-07-19 14:33:51 -04:00
25155b1b38 Merge pull request #2295 from chlupac/AppSettingsFix
Fixed loading of alternative appsettings "appsettings.{env.EnvironmentName}.json"
2022-07-19 14:20:08 -04:00
ded6c9c199 Merge pull request #2299 from chlupac/InstallManFix
Fix - InstallationManager crash when package folders are missing
2022-07-19 13:12:43 -04:00
c62e6c0045 Merge pull request #2300 from sbwalker/dev
performance optimization for permissions
2022-07-19 10:49:52 -04:00
b3feda9fd1 performance optimization for permissions 2022-07-19 10:49:33 -04:00
7ef8e2c8b8 Fix - InstallationManager crash when package folders are missing 2022-07-19 09:42:12 +02:00
d5ff211871 Fixed loading of alternative appsettings "appsettings.{env.EnvironmentName}.json" 2022-07-18 21:34:59 +02:00
51c23e3842 Merge pull request #2294 from sbwalker/dev
use package name as a convention for identifying satellite assemblies
2022-07-18 13:14:53 -04:00
557b30815e use package name as a convention for identifying satellite assemblies 2022-07-18 13:14:34 -04:00
145459bfc3 Merge pull request #2292 from sbwalker/dev
Added version to Language Management, improved framework performance by loading languages into PageState, include all supported cultures and allow Administrator to add any language to a site regardless of translation availability, fix translation upgrade issue
2022-07-16 10:00:20 -04:00
f97a6a2bee Added version to Language Management, improved framework performance by loading languages into PageState, include all supported cultures and allow Administrator to add any language to a site regardless of translation availability, fix translation upgrade issue 2022-07-16 09:59:47 -04:00
1134422891 Merge pull request #2291 from sbwalker/dev
Fix #2282 - dynamically determine framework path when scaffolding project references
2022-07-15 16:00:23 -04:00
6012275c7b Fix #2282 - dynamically determine framework path when scaffolding project references 2022-07-15 15:59:55 -04:00
2f07063375 Merge pull request #2288 from sbwalker/dev
Fix #2285 - handle scenario where the module definition associated to a module instance does not exist
2022-07-14 16:58:43 -04:00
310d1ed485 Fix #2285 - handle scenario where the module definition associated to a module instance does not exist 2022-07-14 16:58:16 -04:00
a48edbb16e Merge pull request #2287 from sbwalker/dev
fixed issue in default site template where MIT License module was being created in invalid pane
2022-07-14 09:11:16 -04:00
d6258409fc fixed issue in default site template where MIT License module was being created in invalid pane 2022-07-14 09:10:51 -04:00
1b94b1247b Merge pull request #2284 from sbwalker/dev
Fix #2280 - add 404 page on upgrade, Fix #2279 add message indicating a restart is required to activate scheduled jobs after installation, add Package Name to Module and Theme management
2022-07-13 15:19:07 -04:00
9ef63ae60e Fix #2280 - add 404 page on upgrade, Fix #2279 add message indicating a restart is required to activate scheduled jobs after installation, add Package Name to Module and Theme management 2022-07-13 15:18:41 -04:00
f99de4be48 Merge pull request #2272 from sbwalker/dev
Support for module editors by exposing Edit Mode in the Control Panel
2022-07-06 17:25:43 -04:00
80fd1820c2 Support for module editors by exposing Edit Mode in the Control Panel 2022-07-06 17:25:08 -04:00
0a4a983d20 Merge pull request #2269 from leigh-pointer/Resx
Added Missing Resource from Oqtane Theme Settings
2022-07-06 08:37:25 -04:00
c2cc830691 Added Missing Resource from Oqtane Theme Settings
Missing Resource string added
2022-07-04 21:37:42 +02:00
4d0490d1c6 Merge pull request #2260 from sbwalker/dev
FIx issue with redirect after site delete and remove tenant if it is empty
2022-06-28 08:17:39 -04:00
02d1838547 FIx issue with redirect after site delete and remove tenant if it is empty 2022-06-28 08:17:06 -04:00
5c6edff778 Update README.md 2022-06-27 16:35:50 -04:00
7cbca32ddd Update README.md 2022-06-27 16:16:58 -04:00
8950e315f8 Merge pull request #2258 from oqtane/master
Merge pull request #2257 from oqtane/dev
2022-06-27 16:12:27 -04:00
a703df40c0 Merge pull request #2257 from oqtane/dev
3.1.3 release
2022-06-27 16:12:05 -04:00
225fce8810 Merge pull request #2256 from sbwalker/dev
3.1.3 data provider packages
2022-06-27 15:43:42 -04:00
bdc0f0fcdd 3.1.3 data provider packages 2022-06-27 15:43:24 -04:00
5bbb8c4858 Merge pull request #2255 from sbwalker/dev
Add schema support to BaseEntityBuilder
2022-06-27 13:55:08 -04:00
35b9551bfb Add schema support to BaseEntityBuilder 2022-06-27 13:54:52 -04:00
c8c5a05b39 Merge pull request #2254 from sbwalker/dev
Fix #2249 Fix #2250 - issues with site deletion
2022-06-27 13:46:02 -04:00
2771f0301a Fix #2249 Fix #2250 - issues with site deletion 2022-06-27 13:45:42 -04:00
c4f04edc59 Merge pull request #2253 from sbwalker/dev
Fix #2252 - unable to insert images into rich text editor
2022-06-27 12:24:16 -04:00
5530422846 Fix #2252 - unable to insert images into rich text editor 2022-06-27 12:23:55 -04:00
ce77c81fb5 Merge pull request #2248 from sbwalker/dev
prepare for 3.1.3
2022-06-21 09:25:33 -04:00
bc488d4ac2 prepare for 3.1.3 2022-06-21 09:25:14 -04:00
fe72a10346 Merge pull request #2247 from sbwalker/dev
fix #2239 - email notification encoding to support all cultures
2022-06-20 19:42:50 -04:00
0da88398b4 fix #2239 - email notification encoding to support all cultures 2022-06-20 19:42:32 -04:00
c42de3da20 Merge pull request #2246 from sbwalker/dev
fix #2245 - default database type not set correctly when adding new site for any DB other than LocalDB, added Source: info to all extension installation scenarios now that the Registry supports both Nuget and GitHub locations
2022-06-20 17:45:10 -04:00
4bf9f36baa fix #2245 - default database type not set correctly when adding new site for any DB other than LocalDB, added Source: info to all extension installation scenarios now that the Registry supports both Nuget and GitHub locations 2022-06-20 17:44:49 -04:00
380cb192c7 Merge pull request #2244 from sbwalker/dev
allow multiple aliases to be defined as default
2022-06-18 09:18:47 -04:00
8882e19ec5 allow multiple aliases to be defined as default 2022-06-18 09:18:23 -04:00
7f52059b98 Merge pull request #2243 from sbwalker/dev
added extension method for creating a LocalizerFactory using a type name, refactored Pager and LocalizableComponent to use LocalizerFactory
2022-06-15 16:19:51 -04:00
1ce3cc4d7c added extension method for creating a LocalizerFactory using a type name, refactored Pager and LocalizableComponent to use LocalizerFactory 2022-06-15 16:19:22 -04:00
657c71e94d Merge pull request #2242 from leigh-pointer/Issue#2234
Fix for Recycle bin not showing Deleted Date (Issue #2234)
2022-06-14 10:26:50 -04:00
c8cfb3c7b7 Fix for Recycle bin not showing Deleted Date (Issue #2234)
Added the Deleted data to Module from the PageModule
2022-06-14 09:22:12 +02:00
6e7e90acf4 Merge pull request #2241 from sbwalker/dev
additional changes for #2228
2022-06-13 09:10:20 -04:00
6d3a556d34 additional changes for #2228 2022-06-13 09:10:01 -04:00
7d9188b659 Merge pull request #2238 from chlupac/LogExceptions
Exception is not saved to log
2022-06-09 15:13:10 -04:00
4f0a805c79 Exception is not saved to log 2022-06-09 10:24:13 +02:00
53f3320492 Merge pull request #2228 from chlupac/Log_notification_improvement
Log notification improvement
2022-06-08 15:48:17 -04:00
f9ce51b4a5 Merge pull request #2222 from hishamco/pager
Pager should inherits from LocalizableComponent
2022-06-08 15:47:25 -04:00
f8bf432c0d Merge pull request #2237 from sbwalker/dev
Improvements for #2229 - relax userrole restrictions
2022-06-08 15:47:12 -04:00
a822482172 Improvements for #2229 - relax userrole restrictions 2022-06-08 15:46:36 -04:00
b22f8a0b02 Remove generic type suffix properly 2022-06-08 00:12:10 +03:00
227331bf24 Merge branch 'dev' into pager 2022-06-07 23:37:08 +03:00
744688cbe1 Merge pull request #2235 from sbwalker/dev
Fix #2230 - add support for an Unauthenticated User global role
2022-06-07 15:26:05 -04:00
79c8126c4a Fix #2230 - add support for an Unauthenticated User global role 2022-06-07 15:25:44 -04:00
0b7c8e4ef7 Merge pull request #2232 from ijaz-saeed/dev
missing translation keys for module names
2022-06-07 15:23:08 -04:00
35e00f61d8 Update README.md 2022-06-07 09:38:42 -04:00
aba3d58df8 missing translation keys for module names 2022-06-06 10:12:00 +05:00
45984a8166 Merge pull request #2231 from sbwalker/dev
Improvements for #2221 - validate file extensions client-side before initiating upload, validate file extension server-side before writing part to disk, optimize part cleanup logic, add error handling to JavaScript XMLHttpRequest, ensure FileInput gets initialized after upload
2022-06-04 15:41:38 -04:00
ea5655ae42 Improvements for #2221 - validate file extensions client-side before initiating upload, valid file extension server-side before writing part to disk, optimize cleanup logic, add error handling to JavaScript XMLHttpRequest, ensure FileInput gets initialized after upload 2022-06-04 15:40:26 -04:00
f06cb0dfbb Log notification improvement 2022-05-31 11:33:42 +02:00
1abae55976 Remove magic string 2022-05-31 11:59:17 +03:00
a83ed40ec4 Avoid breaking changes 2022-05-31 10:40:42 +03:00
75ecae4672 Merge pull request #2223 from hishamco/toggle-password
Avoid toggle password & confirm password as same time when one button is clicked
2022-05-28 21:59:40 -04:00
16a6f942c5 Avoid toggle password & confirm password as same time when one button is clicked 2022-05-27 16:20:35 +03:00
aa98508e57 Remove the entry from SharedResources 2022-05-27 15:37:13 +03:00
583383aee1 Pager should inherits from LocalizableComponent 2022-05-27 15:33:48 +03:00
13f69f81d7 Merge pull request #2219 from sbwalker/dev
fix #2213 - disabling show on all pages
2022-05-26 01:19:35 -04:00
43c34fcd64 fix #2213 - disabling show on all pages 2022-05-26 01:19:14 -04:00
c272238539 Merge pull request #2217 from leigh-pointer/MissingRes2215
Fix for missing Resx entries #2215
2022-05-25 07:23:01 -04:00
6e0d2706a8 Fix for missing Resx entries #2215
Updated the Resx File with the missing entries.  

However the UserProfile\Add cant be Localized at present as the IStringLocalizer is not loaded when that property assignment is executed.
2022-05-25 11:13:38 +02:00
25a7289ce8 Merge pull request #2210 from leigh-pointer/PageOf
Fix for #2209 Localization Pager component (Page @_page of @_pages)
2022-05-24 21:47:12 -04:00
1ba7d045e4 Merge pull request #2211 from elgransan/dev
* Collapse menu after click on a page (mobile version)
2022-05-24 21:46:11 -04:00
a4d75befe7 * Collapse menu after click on a page (mobile version) 2022-05-22 20:05:01 -03:00
88377529bc Fix for #2209 Localization Pager component (Page @_page of @_pages)
Added fixe for issue.  Added the resource "PageOfPages" to SharedResources as trying to inject IStringLocalizer<Pager<TableItem>> and adding Pager.resx the resource failed to load.
2022-05-22 20:23:17 +02:00
91b9a0280f Merge pull request #2207 from sbwalker/dev
Add filtering by Category to Module Management - default to Common
2022-05-21 10:11:24 -04:00
25173ae85c Ddd filtering by Category to Module Management - default to Common 2022-05-21 10:10:57 -04:00
ad3350705e Update README.md 2022-05-19 11:44:38 -04:00
a16bc5db28 Merge pull request #2200 from oqtane/master
Merge pull request #2199 from oqtane/dev
2022-05-14 09:49:24 -04:00
51657338f5 Merge pull request #2199 from oqtane/dev
3.1.2 release
2022-05-14 09:48:59 -04:00
0fe3ea25af Merge pull request #2198 from sbwalker/dev
remove columns from main user management view  and migrate them to edit view
2022-05-13 17:00:32 -04:00
806daaf7c9 remove columns from main user management view and migrate them to edit view 2022-05-13 17:00:10 -04:00
21ff4a83b5 Merge pull request #2197 from sbwalker/dev
resolve login issue related to 'LoginOptions:TwoFactor' and order list of files alphabetically
2022-05-13 12:03:57 -04:00
ecc9aa40d7 resolve login issue related to 'LoginOptions:TwoFactor' and order list of files alphabetically 2022-05-13 12:03:34 -04:00
c34ca2a59b Merge pull request #2196 from sbwalker/dev
prepare for 3.1.2
2022-05-12 20:55:26 -04:00
dde7094fe3 prepare for 3.1.2 2022-05-12 20:55:11 -04:00
105afdfefc Merge pull request #2195 from sbwalker/dev
fix #2192 - Adding a new site fails
2022-05-12 20:42:20 -04:00
4c254a8686 fix #2192 - Adding a new site fails 2022-05-12 20:42:05 -04:00
33ca203e57 Merge pull request #2194 from sbwalker/dev
updated resource file
2022-05-12 13:56:01 -04:00
2ff4133cd4 updated resource file 2022-05-12 13:55:47 -04:00
49ad85713e Merge pull request #2193 from sbwalker/dev
add support for external login parameters and improve diagnostic messages related to claims
2022-05-12 13:52:06 -04:00
1978bf151f add support for external login parameters and improve diagnostic messages related to claims 2022-05-12 13:51:46 -04:00
506378de82 Merge pull request #2191 from sbwalker/dev
fix #2185 - alias auto registration including trailing slash
2022-05-10 08:03:55 -04:00
53ead7a03f fix #2185 - alias auto registration including trailing slash 2022-05-10 08:03:38 -04:00
ab979fd63c Merge pull request #2189 from sbwalker/dev
fix #2180 - Error in Module Creator if the template is not set
2022-05-09 11:35:17 -04:00
1e84a2238b fix #2180 - Error in Module Creator if the template is not set 2022-05-09 11:35:01 -04:00
5618adf86c Merge pull request #2187 from sbwalker/dev
fix #2182 - modifications to address MySQL compatibility issues
2022-05-08 22:14:54 -04:00
345b0bc95f fix #2182 - modifications to address MySQL compatibility issues 2022-05-08 22:14:26 -04:00
b1d6c35e99 Merge pull request #2183 from leigh-pointer/UserEmail
Args not in sink
2022-05-06 11:43:59 -04:00
d767f1a101 Args not in sink
The Display name and email address  not is the correct order!
2022-05-06 12:43:40 +02:00
c15f2b9a12 Merge pull request #2178 from leigh-pointer/UserEmail
Added the User Email field to the List
2022-05-05 17:14:08 -04:00
a21a53662b Update for real-estate
Removed Name
Removed Seconds from DateTime fields
Added Name to the Email link
2022-05-05 16:35:43 +02:00
ebb5340019 Merge pull request #2177 from leigh-pointer/NotIficationDateFormat
Updated the CreatedOn date format
2022-05-05 10:13:24 -04:00
6108bd214e Merge pull request #2179 from sbwalker/dev
fix #2176 - update LastIPAddress correctly during login
2022-05-05 09:57:26 -04:00
eed27e101a fix #2176 - update LastIPAddress correctly during login 2022-05-05 09:57:09 -04:00
2767680bed Added the User Email field to the List
Added the formatted email address of the user to the list view.
2022-05-05 13:25:35 +02:00
4080e30b6f Updated the CreatedOn date format
Updated the format to a more readable format of dd-MMM-yyyy
2022-05-05 13:07:09 +02:00
e89257be62 Merge pull request #2174 from sbwalker/dev
fix #2172 - File Upload issue caused by JS Interop not passing AntiForgery token in POST method
2022-05-04 17:15:10 -04:00
d3c40a7e8b fix #2172 - File Upload issue caused by JS Interop not passing AntiForgery token in POST methid 2022-05-04 17:14:45 -04:00
60657d5d25 Update README.md 2022-05-03 08:13:34 -04:00
71d5ae0e68 Merge pull request #2169 from oqtane/master
Merge pull request #2168 from oqtane/dev
2022-05-03 08:08:51 -04:00
46b8d202c7 Merge pull request #2168 from oqtane/dev
3.1.1 release
2022-05-03 08:08:34 -04:00
bc193a6470 Merge pull request #2167 from sbwalker/dev
remove custom module assets not part of framework
2022-05-03 07:54:30 -04:00
577528fa0a remove custom module assets not part of framework 2022-05-03 07:54:14 -04:00
35e78ea633 Merge pull request #2166 from sbwalker/dev
3.1.1 database providers, default module creator version to local install version
2022-05-02 17:08:56 -04:00
d5d4f85003 3.1.1 database providers, default module creator version to local install version 2022-05-02 17:08:29 -04:00
c6a49a6f5d Merge pull request #2164 from sbwalker/dev
enhance UserRole service with filtering and moved workload to server for better performance, improve error message details during installation
2022-04-29 21:39:36 -04:00
a3ff9373a2 enhance UserRole service with filtering and moved workload to server for better performance, improve error message details during installation 2022-04-29 21:39:11 -04:00
e6d2e74b17 Merge pull request #2162 from sbwalker/dev
refactor module upgrade logic, implement for themes and translations
2022-04-27 19:29:49 -04:00
e8464206e7 refactor module upgrade logic, implement for themes and translations 2022-04-27 19:29:29 -04:00
b6c4934123 Merge pull request #2161 from 2sic-forks/dev
Fix #2160 - upgrade module option
2022-04-27 15:03:46 -04:00
8ee83f738b fix# https://github.com/oqtane/oqtane.framework/issues/2160 2022-04-27 17:44:54 +02:00
c359300375 Merge pull request #2158 from sbwalker/dev
fix path on app-stylesheets
2022-04-26 16:34:08 -04:00
eb3361fa07 fix path on app-stylesheets 2022-04-26 16:33:50 -04:00
1b53da6749 Merge pull request #2155 from sbwalker/dev
external login improvements
2022-04-25 20:05:03 -04:00
c701895e29 external login improvements 2022-04-25 20:04:43 -04:00
e81222821e Merge pull request #2153 from sbwalker/dev
prepare for 3.1.1 release
2022-04-24 20:20:02 -04:00
cbca8c9e93 prepare for 3.1.1 release 2022-04-24 20:19:44 -04:00
92c4edacf2 Merge pull request #2152 from sbwalker/dev
completed antiforgery implementation, improved external login claim mapping, principal construction, and user experience
2022-04-22 17:54:49 -04:00
e4c648ee92 completed antiforgery implementation, improved external login claim mapping, principal construction, and user experience 2022-04-22 17:54:20 -04:00
69f6586aa9 Merge pull request #2149 from sbwalker/dev
Fix #2144 - install issue, Fix #2146 - move file issue, require verification of external login account linkage
2022-04-20 16:01:21 -04:00
391713b84d Fix #2144 - install issue, Fix #2146 - move file issue, require verification of external login account linkage 2022-04-20 16:00:58 -04:00
8c6a25e4b4 Merge pull request #2140 from sbwalker/dev
remove web.release.config as it causes installation issues in pure .net core environments (see #1957)
2022-04-15 09:23:14 -04:00
250701aff0 remove web.release.config as it causes installation issues in pure .net core environments (see #1957) 2022-04-15 09:22:51 -04:00
2dfd1bd5a2 Merge pull request #2139 from sbwalker/dev
removed method-level [ValidateAntiForgeryToken] attribute as it is now handled by global AutoValidateAntiforgeryTokenFilter, adjusted gitignore to improve filtering of Module and Theme folders in wwwroot and exclude all files in Oqtane.Server/Data
2022-04-15 08:02:04 -04:00
1c7380d4cf removed method-level [ValidateAntiForgeryToken] attribute as it is now handled by global AutoValidateAntiforgeryTokenFilter, adjusted gitignore to improve filtering of Module and Theme folders in wwwroot and exclude all files in Oqtane.Server/Data 2022-04-15 08:01:32 -04:00
68d9ac88b3 Merge pull request #2138 from sbwalker/dev
create separate API methods for tokens (short-lived) and personal access tokens (long-lived), include global antiforgery filter to mitigate XSRF when using cookie auth (ignored when using Jwt)
2022-04-14 19:42:24 -04:00
f6b3874668 create separate API methods for tokens (short-lived) and personal access tokens (long-lived), include global antiforgery filter to mitigate XSRF when using cookie auth (ignored when using Jwt) 2022-04-14 19:41:43 -04:00
c616878a64 Merge pull request #2134 from leigh-pointer/TogglePassword
User Areas to use the Toggle Password method
2022-04-14 08:58:59 -04:00
ad485a68ce Merge pull request #2136 from leigh-pointer/UsersCreatedOn
Added CreatedOn class "align-middle" to RowClass
2022-04-14 08:58:49 -04:00
2ebba3b8e7 Added CreatedOn class "align-middle" to RowClass 2022-04-14 14:52:34 +02:00
4117e6e1c5 Merge pull request #2135 from sbwalker/dev
Fix #2128 - site settings validation issue when logged in as Administrator (not Host)
2022-04-14 08:31:29 -04:00
423ee04879 Fix #2128 - site settings validation issue when logged in as Administrator (not Host) 2022-04-14 08:30:55 -04:00
1625e3ba6c User Areas to use the Toggle Password method
Updated the Components where the Password is required to allow toggle show / hide
2022-04-14 13:47:27 +02:00
5a71ab3c20 Merge pull request #2130 from leigh-pointer/LastLoggedIn
Update to User Management
2022-04-13 19:31:10 -04:00
b5833bf556 Merge pull request #2129 from leigh-pointer/NotificationDelAll
Allow the deletion of all Notifications
2022-04-13 19:28:37 -04:00
6c31765965 Merge pull request #2132 from sbwalker/dev
fix #2125 - cannot login using WebAssembly, remove granular 404 logging as it is already managed by url mapping, make IModule ReleaseVersions optional when using EF Core migrations
2022-04-13 19:27:35 -04:00
6dc1d42d90 fix #2125 - cannot login using WebAssembly, remove granular 404 logging as it is already managed by url mapping, make IModule ReleaseVersions optional when using EF Core migrations 2022-04-13 19:27:12 -04:00
e273a954e6 Update to User Management
Updated user management to display more of the User ; Last Login Last IP and Is Authenticated.
2022-04-13 15:24:28 +02:00
a602a942c4 Allow the deletion of all Notifications
Added button to delete all the notifications for the selected filter.
2022-04-13 14:33:30 +02:00
dd32b33621 Merge pull request #2124 from sbwalker/dev
minor improvements to security features, use ActivatorUtilities.CreateInstance with SiteMigration to enable simpler DI
2022-04-12 07:47:10 -04:00
355d0405f4 minor improvements to security features, use ActivatorUtilities.CreateInstance with SiteMigration to enable simpler DI 2022-04-12 07:46:43 -04:00
c1e1595d58 Update README.md 2022-04-11 08:30:24 -04:00
ef476ac9b3 Update README.md 2022-04-11 07:56:10 -04:00
a7aaa7b18b Merge pull request #2116 from sbwalker/dev
Fix #2111 - Adding user to Host role removes all other users roles
2022-04-05 17:11:29 -04:00
3abfbab5d1 Fix #2111 - Adding user to Host role removes all other users roles 2022-04-05 17:11:13 -04:00
b158474e21 Merge pull request #2113 from oqtane/master
Merge pull request #2112 from oqtane/dev
2022-04-05 08:51:40 -04:00
cfbcc41543 Merge pull request #2112 from oqtane/dev
3.1.0 release
2022-04-05 08:51:10 -04:00
fec0a02b1c Update README.md 2022-04-04 17:17:12 -04:00
3d93ba1215 Merge pull request #2110 from sbwalker/dev
fix logic issue in url mapping, improve 404 handling, add property change component notifications
2022-04-04 17:16:37 -04:00
042083c0e7 fix logic issue in url mapping, improve 404 handling, add property change component notifications 2022-04-04 17:16:12 -04:00
e0bb7b7faf Merge pull request #2108 from alperenbelgic/patch-1
Broken link fixed in Readme
2022-04-04 15:35:44 -04:00
acc4099ac8 Merge pull request #2109 from sbwalker/dev
dogfooding fixes
2022-04-04 10:54:50 -04:00
683ad8959a dogfooding fixes 2022-04-04 10:53:40 -04:00
a559c771cf Broken link fixed in Readme 2022-04-04 14:37:58 +01:00
8ba0ebf955 Update README.md 2022-04-04 09:08:32 -04:00
d83ec1827a Update README.md 2022-04-02 11:28:04 -04:00
314e49f5e1 Merge pull request #2106 from sbwalker/dev
adopt more of the migrations conventions
2022-04-02 11:25:03 -04:00
412b139796 adopt more of the migrations conventions 2022-04-02 11:24:41 -04:00
9b29487934 Update README.md 2022-04-02 11:12:03 -04:00
95213e41c4 Merge pull request #2105 from sbwalker/dev
replace startswith with equality to handle site subfolders
2022-04-02 11:09:01 -04:00
644ddfd5e1 replace startswith with equality to handle site subfolders 2022-04-02 11:08:38 -04:00
68dd9900c4 Merge pull request #2104 from sbwalker/dev
fix installation CSS issue
2022-04-02 09:29:38 -04:00
6b100cf70b fix installation CSS issue 2022-04-02 09:29:12 -04:00
6f33e5e8a0 Merge pull request #2103 from sbwalker/dev
refactored IUpgradeable to use the migration attribute approach
2022-04-02 09:19:50 -04:00
268e0e72a3 refactored IUpgradeable to use the migration attribute approach 2022-04-02 09:19:30 -04:00
5380b12294 Merge pull request #2102 from sbwalker/dev
allow for multiple upgrade classes
2022-04-01 18:07:13 -04:00
2ba1a95c8d allow for multiple upgrade classes 2022-04-01 18:06:59 -04:00
1ad0ee4a71 Merge pull request #2101 from sbwalker/dev
include theme resources on server page load, add IUpgradeable interface to provide site-based versioning support
2022-04-01 17:57:52 -04:00
fc12903cfd include theme resources on server page load, add IUpgradeable interface to provide site-based versioning support 2022-04-01 17:57:30 -04:00
640d22484d Merge pull request #2099 from leigh-pointer/ExternalMod
Updated Package reference to align with 3.1.0
2022-04-01 08:58:04 -04:00
34dc4d64e6 Merge pull request #2100 from sbwalker/dev
fix issue with the disabled link tags
2022-04-01 08:51:28 -04:00
bbb547efb6 fix issue with the disabled link tags 2022-04-01 08:51:08 -04:00
5b3640e23d Theme Template updated to 3.1.0 2022-04-01 12:56:28 +02:00
0fbbe244d8 Updated Package reference to align with 3.1.0 2022-04-01 12:53:55 +02:00
57def7da0c Merge pull request #2098 from sbwalker/dev
filter deleted pages and modules in the router, provide support for cascading aspect of style sheets, replace ResourceDeclaration concept with ResourceLevel
2022-03-31 21:06:25 -04:00
0fcf1c2732 filter deleted pages and modules in the router, provide support for cascading aspect of style sheets, replace ResourceDeclaration concept with ResourceLevel 2022-03-31 21:05:58 -04:00
c15b6cdf79 Merge pull request #2096 from sbwalker/dev
hide/show secure fields
2022-03-31 09:00:28 -04:00
06e25e04f8 hide/show secure fields 2022-03-31 09:00:13 -04:00
f8e04656cd Merge pull request #2095 from sbwalker/dev
better seperation of concerns
2022-03-31 08:35:29 -04:00
1c8debd894 better seperation of concerns 2022-03-31 08:35:11 -04:00
58d8fcd074 Merge pull request #2094 from sbwalker/dev
cleanup
2022-03-30 22:08:48 -04:00
a70f1ee1e0 cleanup 2022-03-30 22:08:32 -04:00
271ed3cbe2 Merge pull request #2093 from sbwalker/dev
fix registration
2022-03-30 08:10:56 -04:00
8ddaf57e17 fix registration 2022-03-30 08:10:42 -04:00
4f1ead116f Merge pull request #2092 from sbwalker/dev
remote service support via Jwt
2022-03-30 08:07:18 -04:00
3194c5b600 remote service support via Jwt 2022-03-30 08:07:03 -04:00
717f1a9b76 Merge pull request #2089 from sbwalker/dev
jwt changes
2022-03-29 08:39:01 -04:00
b7675a21eb jwt changes 2022-03-29 08:38:46 -04:00
b0d4c0d578 Merge pull request #2088 from sbwalker/dev
jwt improvements
2022-03-29 08:15:27 -04:00
b7a1d2df75 jwt improvements 2022-03-29 08:15:13 -04:00
5d31d33804 Merge pull request #2087 from sbwalker/dev
add Jwt authorization support for for API
2022-03-28 21:52:14 -04:00
a97af42e4b add Jwt authorization support for for API 2022-03-28 21:51:55 -04:00
17c6797afb Merge pull request #2086 from sbwalker/dev
cleanly separate SiteState service for client and server use cases
2022-03-27 21:06:08 -04:00
c8129607e8 cleanly separate SiteState service for client and server use cases 2022-03-27 21:05:44 -04:00
c2dce38bb1 Merge pull request #2085 from sbwalker/dev
fix #2082 - missing SiteId causing password reset notifications to not be created
2022-03-27 20:02:47 -04:00
8b0b7492f5 fix #2082 - missing SiteId causing password reset notifications to not be created 2022-03-27 20:02:19 -04:00
a25cfd87cc Merge pull request #2084 from sbwalker/dev
remove SiteSettings from Alias for better separation of concerns
2022-03-27 19:48:14 -04:00
f9432acf1b remove SiteSettings from Alias for better separation of concerns 2022-03-27 19:47:52 -04:00
c6c468c986 Merge pull request #2081 from sbwalker/dev
factor out auth constants, remove TAlias is Alias is not an extensible type, improve SiteOptions cache clearing, improve principal validation, localization improvements
2022-03-26 17:30:32 -04:00
b92a888583 factor out auth constants, remove TAlias is Alias is not an extensible type, improve SiteOptions cache clearing, improve principal validation, localization improvements 2022-03-26 17:30:06 -04:00
692b4b33fb Merge pull request #2079 from sbwalker/dev
consolidate user creation
2022-03-24 12:33:02 -04:00
79f427e10a consolidate user creation 2022-03-24 12:32:41 -04:00
340b3e7fe8 Merge pull request #2077 from sbwalker/dev
login localization
2022-03-23 17:19:18 -04:00
50a44c9416 login localization 2022-03-23 17:19:02 -04:00
3c41493d8e Merge pull request #2076 from sbwalker/dev
prepare for 3.1 release
2022-03-23 15:04:26 -04:00
4566ea436c prepare for 3.1 release 2022-03-23 15:04:03 -04:00
499bf3bc28 Update README.md 2022-03-23 10:58:44 -04:00
489a321763 Merge pull request #2075 from sbwalker/dev
Add OAuth2 support
2022-03-23 10:52:20 -04:00
9d86d923aa Add OAuth2 support 2022-03-23 10:51:52 -04:00
454529bd6a Merge pull request #2074 from sbwalker/dev
Allow Email Claim Type to be configurable
2022-03-21 16:29:45 -04:00
ca17dd3ca3 Allow Email Claim Type to be configurable 2022-03-21 16:29:28 -04:00
71c7a3de69 Merge pull request #2073 from sbwalker/dev
Add scheme to Redirect Url
2022-03-21 10:50:19 -04:00
76fc689337 Add scheme to Redirect Url 2022-03-21 10:50:01 -04:00
af5d25490a Merge pull request #2072 from sbwalker/dev
OIDC improvements
2022-03-21 10:39:51 -04:00
fb161ae783 OIDC improvements 2022-03-21 10:39:35 -04:00
b92b20e8d2 Merge pull request #2071 from sbwalker/dev
OIDC improvements
2022-03-21 09:12:40 -04:00
4b19059df1 OIDC improvements 2022-03-21 09:12:18 -04:00
baa6ec5cba Merge pull request #2069 from sbwalker/dev
More improvements to OIDC support
2022-03-19 13:42:37 -04:00
1a86b80c61 More improvements to OIDC support 2022-03-19 13:42:19 -04:00
3783da3647 Merge pull request #2067 from sbwalker/dev
OIDC improvements
2022-03-16 17:28:51 -04:00
39dfc00693 OIDC improvements 2022-03-16 17:28:32 -04:00
c7cad20aa7 Merge pull request #2065 from sbwalker/dev
Resolved issue in TenantManager resulting in "No database provider has been configured for this DbContext" error being logged during startup. Added logic to update email address in AspNetUsers when updating a User.
2022-03-16 09:54:39 -04:00
5901365e0e Resolved issue in TenantManager resulting in "No database provider has been configured for this DbContext" error being logged during startup. Added logic to update email address in AspNetUsers when updating a User. 2022-03-16 09:53:59 -04:00
6324aacba1 Merge pull request #2064 from sbwalker/dev
Improve Principal handling for OIDC and resolve Logout issue (caused by AntiForgeryToken)
2022-03-14 22:29:19 -04:00
d51ba8f6dd Improve Principal handling for OIDC and resolve Logout issue (caused by AntiForgeryToken) 2022-03-14 22:28:41 -04:00
9b69e135d9 Merge pull request #2053 from leigh-pointer/FileConstants
Fix for File Upload Failed {Error} .json file #2052
2022-03-13 22:56:50 -04:00
c3218b2f5a Merge pull request #2060 from sbwalker/dev
Added support for per site options and OpenID Connect
2022-03-13 22:56:29 -04:00
9bbbff31f8 Added support for per site options and OpenID Connect 2022-03-13 22:55:52 -04:00
432429026b Fix for File Upload Failed {Error} .json file #2052
Udate to FileUpload Constant 
added extensions json, xml, xslt, rss, html, htm, css
This is an interim fix with plans to make the upload extensions a soft implementation.
2022-03-09 14:27:14 +01:00
a47ecbdea9 Merge pull request #2048 from sbwalker/dev
Added password policy validation in install wizard
2022-03-08 08:20:15 -05:00
f250aff99b Added password policy validation in install wizard 2022-03-08 08:31:18 -05:00
003f14003e Fixed issue with IHostResources not being registered properly 2022-03-07 16:52:40 -05:00
fe4e245cda Merge pull request #2045 from sbwalker/dev
Fixed issue with IHostResources not being registered properly
2022-03-07 16:41:37 -05:00
668da62519 Fix #2032 - Fresh install with Postgres failed with "42703: column "settingname" does not exist POSITION: 43 2022-03-07 12:23:35 -05:00
fd89254d5a fix #2041 - Server restart post module install fails with null exception 2022-03-07 12:19:00 -05:00
b4338c1761 Merge pull request #2043 from sbwalker/dev
Fix #2032 - Fresh install with Postgres failed with "42703: column "settingname" does not exist POSITION: 43
2022-03-07 12:12:44 -05:00
fb3c79617f Merge pull request #2042 from sbwalker/dev
fix #2041 - Server restart post module install fails with null exception
2022-03-07 12:07:58 -05:00
b80fe428ac add show/hide password toggle on Login form 2022-03-04 11:43:54 -05:00
5806563ba4 Merge pull request #2040 from sbwalker/dev
add show/hide password toggle on Login form
2022-03-04 11:32:56 -05:00
5adecc307f Allow user identity password and lockout configuration to be customized. Included additional environment information in System Info. 2022-03-04 10:41:45 -05:00
12d1b5e849 Update README.md 2022-03-04 10:35:07 -05:00
3f2095870d Merge pull request #2039 from sbwalker/dev
Allow user identity password and lockout configuration to be customized. Included additional environment information in System Info.
2022-03-04 10:31:18 -05:00
1481c76a0d Update README.md 2022-03-03 09:19:57 -05:00
1cdc80e09b 2 factor authentication and user account lockout completed 2022-03-03 09:12:37 -05:00
e568aa8320 Merge pull request #2037 from sbwalker/dev
2 factor authentication and user account lockout completed
2022-03-03 09:01:54 -05:00
28629aa836 Adding 2 factor authentication 2022-02-28 16:00:52 -05:00
19f180331b Adding 2 factor authentication 2022-02-28 15:58:49 -05:00
3292f0b545 Merge pull request #2034 from sbwalker/dev
Adding 2 factor authentication
2022-02-28 15:50:04 -05:00
3333bfeeff Merge pull request #2033 from sbwalker/dev
Adding 2 factor authentication
2022-02-28 15:48:02 -05:00
eb1ac3bc9b Added support for User Account Lockout 2022-02-25 16:17:54 -05:00
65ae1a6177 Merge pull request #2031 from sbwalker/dev
Added support for User Account Lockout
2022-02-25 16:07:09 -05:00
0fba385b9e Enhanced Purge Job to include retention policy for Notifications 2022-02-24 12:37:06 -05:00
ee65a54684 Merge pull request #2028 from sbwalker/dev
Enhanced Purge Job to include retention policy for Notifications
2022-02-24 12:26:24 -05:00
82fef82c4f use consistent naming convention for System Update log file 2022-02-24 11:11:15 -05:00
70383a9b9d Merge pull request #2027 from sbwalker/dev
use consistent naming convention for System Update log file
2022-02-24 11:00:33 -05:00
15fdba060c Improvements to System Upgrade to preserve the processing details in a log file in the /Packages folder to improve troubleshooting abilities 2022-02-24 09:55:34 -05:00
c1065dab2d Merge pull request #2026 from sbwalker/dev
Improvements to System Upgrade to preserve the processing details in a log file in the /Packages folder to improve troubleshooting abilities
2022-02-24 09:44:55 -05:00
dfb4afc698 Merge pull request #2020 from leigh-pointer/ImportExportSettings
Fix for Module Settings Import and Export #2019
2022-02-24 08:51:20 -05:00
893b09e7e4 Merge pull request #2025 from sbwalker/dev
Added more constructors for convenience in creating  Notification objects. Refactored to use the new constructors where applicable. Fixed localization key issue in Site Settings and added scroll to top when testing SMTP.
2022-02-24 08:51:10 -05:00
938bcb2b62 Added more constructors for convenience in creating Notification objects. Refactored to use the new constructors where applicable. Fixed localization key issue in Site Settings and added scroll to top when testing SMTP. 2022-02-24 09:01:44 -05:00
ac45f67a21 enhancement to send log notifications to host users 2022-02-23 16:10:24 -05:00
36cd9664b1 Merge pull request #2022 from sbwalker/dev
enhancement to send log notifications to host users
2022-02-23 15:59:41 -05:00
073d330db4 Fix for Module Settings Import and Export #2019
Added the module Settings so they are available for the Import and Export Interface.
2022-02-23 14:33:24 +01:00
9ba356c47e moved AlterStringColumn to IDatabase interface so that it can be overridden in the Sqlite provider rather than requiring conditional logic in the migrations 2022-02-22 14:47:31 -05:00
f2bec9b478 Merge pull request #2017 from sbwalker/dev
moved AlterStringColumn to IDatabase interface so that it can be overridden in the Sqlite provider rather than requiring conditional logic in the migrations
2022-02-22 14:36:58 -05:00
3d0cbdd1a7 expand Url column in Visitor and UrlMapping to accomodate maximum url size of 2048 characters 2022-02-22 10:01:52 -05:00
c5f5bf0287 Merge pull request #2015 from sbwalker/dev
expand Url column in Visitor and UrlMapping to accomodate maximum url size of 2048 characters
2022-02-22 09:51:14 -05:00
99986c1b94 changed IsModule property name to ES6Module for clarity 2022-02-20 08:53:04 -05:00
7d669caa3c Merge pull request #2011 from sbwalker/dev
changed IsModule property name to ES6Module for clarity
2022-02-20 08:42:34 -05:00
b68e3cb10f Add support for ES6 module JavaScript resources 2022-02-19 17:24:41 -05:00
e305c488d4 Merge pull request #2010 from sbwalker/dev
Add support for ES6 module JavaScript resources
2022-02-19 17:14:21 -05:00
a2417bbe56 Merge pull request #2005 from leigh-pointer/BootstrapUpdate
Theme Template Updated
2022-02-18 11:00:58 -05:00
b3967b36c0 Corrected incorrect CDN 2022-02-18 14:52:51 +01:00
5fb33dfee9 Bootstrap reference updated to 5.1.3 2022-02-18 08:38:53 +01:00
c002768e5b Merge pull request #2001 from oqtane/master
Merge pull request #2000 from oqtane/dev
2022-02-15 14:31:40 -05:00
aff33c6a5d Merge pull request #2000 from oqtane/dev
3.0.3 release
2022-02-15 14:31:21 -05:00
a84b497fae Merge pull request #1999 from artmedia/patch-1
typo correction for closing tag
2022-02-15 09:37:39 -05:00
c33d1bcd3c typo correction for closing label
typo correction for closing label
2022-02-15 10:19:58 +01:00
4071e14a7e Update README.md 2022-02-14 16:25:58 -05:00
b5b3f190b7 Merge pull request #1998 from leigh-pointer/ModuleCount
null reference exception still occurring
2022-02-14 13:07:29 -05:00
d43a3e132c null reference exception still occurring
added a '?' operator after the m.ModuleDefinition
2022-02-14 19:06:00 +01:00
a90c21f80a Merge pull request #1997 from sbwalker/dev
prepare for 3.0.3 release
2022-02-11 16:49:21 -05:00
2b768165e5 prepare for 3.0.3 release 2022-02-11 16:59:48 -05:00
e8425ba03a improve performance by reducing database calls in initial client request scenarios 2022-02-11 15:42:34 -05:00
b0a6f402e9 Merge pull request #1996 from sbwalker/dev
improve performance by reducing database calls in initial client request scenarios
2022-02-11 15:32:16 -05:00
02e86a940b Merge pull request #1973 from 2sic-forks/refs
fix #1972 Missing Preprocessor Directives during Runtime Compile
2022-02-10 07:56:52 -05:00
79d03eb43e Merge pull request #1988 from 2sic-forks/content
fix #1987 Nuspec to include 'content'
2022-02-10 07:56:08 -05:00
b564955f85 Merge pull request #1994 from sbwalker/dev
fixed #1989 - installation on SQLite failing due to DropColumn, fixed #1986 - IClientStartup not getting called for External Modules, added ability to correlate new visitors by IP address
2022-02-10 07:55:51 -05:00
5aed64f614 fixed #1989 - installation on SQLite failing due to DropColumn, fixed #1986 - IClientStartup not getting called for External Modules, added ability to correlate new visitors by IP address 2022-02-10 08:05:55 -05:00
a823a4d9b7 remove precompile symbol OQTANE3_0_OR_GREATER as it have the same effect as simple OQTANE 2022-02-08 20:15:50 +01:00
4eed2193f4 Merge branch 'oqtane:dev' into refs 2022-02-08 19:55:34 +01:00
48e7a41af6 fix #1987 Nuspec to include 'content' 2022-02-08 19:38:31 +01:00
bba5caecf7 Merge branch 'oqtane:dev' into content 2022-02-08 19:34:15 +01:00
ede6a45f15 more RichTextEditor refactoring 2022-02-08 07:42:47 -05:00
9c65d23229 Merge pull request #1992 from sbwalker/dev
more RichTextEditor refactoring
2022-02-08 07:32:21 -05:00
5dedfe9295 fix oqtane#1987 Nuspec to include 'content' ('contentFiles') 2022-02-07 14:09:14 +01:00
95d8c368c8 Meta tags should not be HTML encoded 2022-02-06 18:54:09 -05:00
49fbfb8bbc Merge pull request #1985 from sbwalker/dev
Meta tags should not be HTML encoded
2022-02-06 18:43:52 -05:00
aa3d2a5289 Merge pull request #1969 from 2sic-forks/dev
fix #1272 - add support for refs folder in package installation
2022-02-06 12:11:29 -05:00
48ae6df4b7 Merge pull request #1984 from sbwalker/dev
resolved UI error when closing Event Log and Visitor Management, made button class consistent in Recycle Bin, refactored RichTextEditor, made use of ConfigManager consistently throughout framework, added support for deleted Sites, removed reference to Runtime in Startup as it is now set per Site, added versioning to Html/Text, added Meta tag support to Page Management
2022-02-06 12:09:40 -05:00
c635351a12 resolved UI error when closing Event Log and Visitor Management, made button class consistent in Recycle Bin, refactored RichTextEditor, made use of ConfigManager consistently throughout framework, added support for deleted Sites, removed reference to Runtime in Startup as it is now set per Site, added versioning to Html/Text, added Meta tag support to Page Management 2022-02-06 12:19:42 -05:00
d9ff77fd9a fix #1972 Missing Preprocessor Directives during Runtime Compile 2022-01-31 18:27:56 +01:00
e1a7954307 fix #1272 - add support for refs folder in package installation 2022-01-29 06:45:51 +01:00
efe6421133 Merge pull request #1957 from Rodien/dev
Added web.Release.config to include remove WebDAV during the publish stage of a release
2022-01-28 13:00:56 -05:00
79b62f4407 Merge pull request #1968 from sbwalker/dev
improved UX in Event Log by preserving criteria when viewing Details, added RowClass and ColumnClass parameters to Pager component, added initial-scale=1.0 to viewport specification in _host, added default visitor tracking filter, fixed "The given key 'level' was not present in the dictionary" issue in Visitor Management - Details by ensuring data was fully loaded
2022-01-27 18:02:20 -05:00
9d17804ac7 improved UX in Event Log by preserving criteria when viewing Details, added RowClass and ColumnClass parameters to Pager component, added initial-scale=1.0 to viewport specification in _host, added default visitor tracking filter, fixed "The given key 'level' was not present in the dictionary" issue in Visitor Management - Details by ensuring data was fully loaded 2022-01-27 18:12:04 -05:00
5986355504 Merge pull request #1965 from leigh-pointer/ModuleCount#1963
Fix for Version 3 module definitions error #1963
2022-01-25 13:38:58 -05:00
192e6fde92 Fix for Version 3 module definitions error #1963
The code was assuming that the ModuleDefinitionId exists in the PageState.Modules collection. Instead of using .Count()  code now uses .FirstOrDefault() != null
2022-01-25 06:23:07 +01:00
ad090e62cc enhance Pager to support pure responsive Grid format (Columns = 0) 2022-01-23 10:40:41 -05:00
5c072fea62 Merge pull request #1960 from sbwalker/dev
enhance Pager to support pure responsive Grid format (Columns = 0)
2022-01-23 10:30:54 -05:00
fd01a40810 Merge pull request #1958 from leigh-pointer/AddUserId
Add the Username to the User And Roles display.
2022-01-22 19:25:20 -05:00
7b9a83a273 Merge pull request #1959 from sbwalker/dev
added router support for url fragments, added language attribute to HTML document tag to improve validation, fixed Theme Settings so they can only be invoked via the Control Panel, added support for webp image files
2022-01-22 19:24:51 -05:00
f964e0e502 added router support for url fragments, added language attribute to HTML document tag to improve validation, fixed Theme Settings so they can only be invoked via the Control Panel, added support for webp image files 2022-01-22 19:34:30 -05:00
22acb7c74b Comments cleanup
Code cleanup. I removed the unnecessary comments.

This code will remove WebDAV during the publish stage of a release.
2022-01-21 11:58:24 +01:00
6a99e81e75 Add the Username to the display.
When looking through Users and Roles it would seem ideal to also show the username.
2022-01-21 09:36:32 +01:00
93b6de1caf Added web.Release.config to include remove WebDAV during the publish stage of a release 2022-01-21 02:32:48 +01:00
1fbab5db2b Merge pull request #1954 from sbwalker/dev
enhance Pager component with OnPageChanged event and implement in Visitor Management, allow PermissionGrid component to support Host role, fix unhandled exception in RichTextEditor component related to rerendering, make Quill resource declarations forward compatible, update Blazor theme to Boostrap 5.1.3, add missing RemoteIPAddress parameter in _Host app component, include logic to enable bypass of non-default alias redirection
2022-01-19 17:40:01 -05:00
950e852dee Merge branch 'dev' of https://github.com/sbwalker/oqtane.framework into dev 2022-01-19 17:47:39 -05:00
826898e3fe enhance Pager component with OnPageChanged event and implement in Visitor Management, allow PermissionGrid component to support Host role, fix unhandled exception in RichTextEditor component related to rerendering, make Quill resource declarations forward compatible, update Blazor theme to Boostrap 5.1.3, add missing RemoteIPAddress parameter in _Host app component, include logic to enable bypass of non-default alias redirection 2022-01-19 17:47:27 -05:00
1268149d83 Merge pull request #1944 from oqtane/master
Merge pull request #1943 from oqtane/dev
2022-01-16 11:06:34 -05:00
908299970f Merge pull request #1943 from oqtane/dev
3.0.2 release
2022-01-16 11:05:56 -05:00
861dde8627 Update README.md 2022-01-15 12:59:50 -05:00
cc9802a0d8 use PageState.Uri rather than creating a new Uri object 2022-01-15 12:58:47 -05:00
69d1f3aa53 Merge pull request #1940 from sbwalker/dev
use PageState.Uri rather than creating a new Uri object
2022-01-15 12:49:00 -05:00
ea4587d842 Update README.md 2022-01-15 12:38:23 -05:00
fb4c95f945 Update README.md 2022-01-15 12:37:52 -05:00
95a27af5f2 Update README.md 2022-01-15 12:34:34 -05:00
9d7b25ade6 Merge pull request #1939 from sbwalker/dev
improvement for updating private/public Settings
2022-01-15 09:34:56 -05:00
3a8f4199cd improvement for updating private/public Settings 2022-01-15 09:44:36 -05:00
11002efc02 hide deleted pages in Admin Dashboard, impove Settings API by replacing IsPublic with IsPrivate, isolate Setting updates to not affect PageState, make Pager horizintally scrollable on narrow viewports, improve LocalizableComponent to support embedded controls 2022-01-14 13:26:24 -05:00
367c1c3568 Merge pull request #1938 from sbwalker/dev
hide deleted pages in Admin Dashboard, impove Settings API by replacing IsPublic with IsPrivate, isolate Setting updates to not affect PageState, make Pager horizintally scrollable on narrow viewports, improve LocalizableComponent to support embedded controls
2022-01-14 13:16:42 -05:00
9e04230d99 added interop method for setting scroll position, persisted RemoteIPAddress in PageState so it is available on Blazor Server, added support for forwarded headers from load balancers and proxy servers, replaced DateTime.Now references DateTimeUtcNow for consistency, fixed issue where upgrade logic was being executed for prior version 2022-01-13 07:18:37 -05:00
21304db7c9 Merge pull request #1936 from sbwalker/dev
added interop method for setting scroll position, persisted RemoteIPAddress in PageState so it is available on Blazor Server, added support for forwarded headers from load balancers and proxy servers, replaced DateTime.Now references DateTimeUtcNow for consistency, fixed issue where upgrade logic was being executed for prior version
2022-01-13 07:10:15 -05:00
f4f6e98045 Merge pull request #1935 from leigh-pointer/DeadResxKey
Empty Resx Value on Page Edit
2022-01-12 16:13:00 -05:00
ad41eff38a Empty Resx Value on Page Edit 2022-01-12 20:42:59 +01:00
dbd6cc4148 Merge pull request #1934 from oqtane/revert-1931-dev
Revert "Fixed first render js bug"
2022-01-12 14:09:08 -05:00
dda71e5ccd Revert "Fixed first render js bug" 2022-01-12 14:07:50 -05:00
cfe8059176 Merge pull request #1931 from zzmzaizai/dev
Fixed first render js bug
2022-01-12 13:57:13 -05:00
8b00784ecc Merge pull request #1933 from sbwalker/dev
fix z-index for Blazor theme on mobile
2022-01-12 07:50:44 -05:00
9bcc6bbad0 fix z-index for Blazor theme on mobile 2022-01-12 08:00:25 -05:00
ce7995966d Fixed first render js bug
Solve the problem that when the page is rendered for the first time and JS is executed, the reference to the JS file has not been successful, and the page is abnormally wrong
2022-01-12 10:36:10 +08:00
cea5f86df4 prepare for 3.0.2 release 2022-01-11 17:46:36 -05:00
0912253b1b Merge pull request #1930 from sbwalker/dev
prepare for 3.0.2 release
2022-01-11 17:36:54 -05:00
5aecc4be03 remove invalid app tag, fix page title not being set on first render 2022-01-11 15:07:54 -05:00
e09178c14c Merge pull request #1927 from sbwalker/dev
remove invalid app tag, fix page title not being set on first render
2022-01-11 14:58:13 -05:00
477ded6a4a Merge pull request #1921 from zzmzaizai/dev
Fixed first render css bug
2022-01-11 14:49:57 -05:00
311c48becb Merge pull request #1926 from sbwalker/dev
improve UX of password reset
2022-01-11 10:48:18 -05:00
ec924a7ddf improve UX of password reset 2022-01-11 10:57:58 -05:00
e39416a786 Update README.md 2022-01-11 09:14:43 -05:00
51b356cc0e enhanced scheduler to support one-time jobs, fixed pager component so that top/bottom have consistent UX, fixed Blazor theme z-index issues caused by input-group in Bootstrap 5, improved password reset instructions in email notification 2022-01-10 19:58:58 -05:00
66b13bdb8b Merge pull request #1925 from sbwalker/dev
enhanced scheduler to support one-time jobs, fixed pager component so that top/bottom have consistent UX, fixed Blazor theme z-index issues caused by input-group in Bootstrap 5, improved password reset instructions in email notification
2022-01-10 19:49:25 -05:00
4ade58da01 Fixed first render css bug
Fixed the bug that CSS could not be render when the module was loaded for the first
2022-01-10 16:06:48 +08:00
efcfc0783c Merge pull request #1917 from leigh-pointer/LabelCSS
Fix for  #1914 Label Control appending Class to LabelClass
2022-01-08 14:03:28 -05:00
aa22db7fe5 Merge pull request #1916 from sbwalker/dev
add error handling in purge job
2022-01-08 10:12:27 -05:00
5e0f008b65 add error handling in purge job 2022-01-08 10:22:05 -05:00
eaf840e1da improvements to purge job 2022-01-08 10:17:10 -05:00
fc9e47778b Fix for #1914 Label Control appending Class to LabelClass
Modified so that the Class parameter is not constantly appended when a new Class is applied.
2022-01-08 16:12:27 +01:00
35edf78aed Merge pull request #1915 from sbwalker/dev
improvements to purge job
2022-01-08 10:07:36 -05:00
07718f0449 add option to Control Panel to specify module visibility 2022-01-08 08:44:18 -05:00
6759156519 Merge pull request #1913 from sbwalker/dev
add option to Control Panel to specify module visibility
2022-01-08 08:34:45 -05:00
e2688e6feb include purge job for maintaining event logs and visitor logs 2022-01-07 23:30:29 -05:00
65ba6423b1 Merge pull request #1912 from sbwalker/dev
include purge job for maintaining event logs and visitor logs
2022-01-07 23:21:06 -05:00
a2f8fe3694 convention shortcut to suppress title in container 2022-01-06 17:24:18 -05:00
5273a17ab6 Merge pull request #1911 from sbwalker/dev
convention shortcut to suppress title in container
2022-01-06 17:14:45 -05:00
f7c1e7b706 alias management improvements 2022-01-06 13:37:29 -05:00
45bbc4c681 Merge pull request #1910 from sbwalker/dev
alias management improvements
2022-01-06 13:27:51 -05:00
6af5682548 increment copyright date to 2022, allow scheduled jobs to support weekly interval, improve dynamic image generation, add defensive logic to router 2022-01-05 14:28:42 -05:00
24ed06626d Merge pull request #1909 from sbwalker/dev
increment copyright date to 2022, allow scheduled jobs to support weekly interval, improve dynamic image generation, add defensive logic to router
2022-01-05 14:19:16 -05:00
eeff4af167 make Url Mappings relative rather than absolute 2022-01-03 10:56:13 -05:00
17f46afe14 Merge pull request #1903 from sbwalker/dev
make Url Mappings relative rather than absolute
2022-01-03 10:46:42 -05:00
224618cf21 improve Scheduled Job start/stop user experience, utilize start time when setting next job execution 2022-01-02 21:01:55 -05:00
ea93ab2a83 Merge pull request #1902 from sbwalker/dev
improve Scheduled Job start/stop user experience, utilize start time when setting next job execution
2022-01-02 20:53:00 -05:00
b9f7c39550 improve capture of request attributes 2021-12-30 14:13:58 -05:00
86b4b8e43a Merge pull request #1901 from sbwalker/dev
improve capture of request attributes
2021-12-30 14:04:27 -05:00
f54d07548e separate PWA service worker script from manifest script 2021-12-23 09:46:03 -05:00
037db8a3e4 Merge pull request #1898 from sbwalker/dev
separate PWA service worker script from manifest script
2021-12-23 09:36:43 -05:00
8f00e85abd Merge pull request #1897 from leigh-pointer/MissingResx
Missing Resx Keys
2021-12-23 07:50:35 -05:00
9ccc4c4059 Missing Resx Keys
Added missing Keys for Login and Visitor
2021-12-23 11:36:20 +01:00
8408f98693 Merge pull request #1896 from sbwalker/dev
encode PWA Script
2021-12-22 15:43:13 -05:00
cde271fd5b encode PWA Script 2021-12-22 15:52:31 -05:00
c21a097fd2 added support for default alias specification, alias auto registration, alias redirect, alias line break delimiters 2021-12-22 15:43:59 -05:00
83c32d4963 Merge pull request #1895 from sbwalker/dev
added support for default alias specification, alias auto registration, alias redirect, alias line break delimiters
2021-12-22 15:34:49 -05:00
22c2d56da0 imrove custom entity support in settings 2021-12-20 07:58:15 -05:00
bd8d6e0480 Merge pull request #1886 from sbwalker/dev
imrove custom entity support in settings
2021-12-20 07:49:10 -05:00
825eb700b1 Merge pull request #1885 from chlupac/SearchUserFix
Search user work again
2021-12-20 07:46:06 -05:00
e59ee70f88 Search user work again 2021-12-20 13:06:33 +01:00
1173a29ed5 Merge pull request #1884 from sbwalker/dev
Add support for IsPublic to all Setting types, enable Url Mapping for internal links
2021-12-18 10:26:26 -05:00
6a2ff369ea Add support for IsPublic to all Setting types, enable Url Mapping for internal links 2021-12-18 10:35:22 -05:00
e22606ae79 Merge pull request #1882 from leigh-pointer/#1880GetModuleDefinitionSettings
#1880 Issue with new SettingService
2021-12-16 15:37:22 -05:00
bf56c2a9fa Merge pull request #1883 from leigh-pointer/RichTextContent
Rework to #1848 RawHTML not being saved
2021-12-16 15:37:14 -05:00
6567b55ea3 Removed RichTextEditor OnInitialized
Redundant procedure call.
2021-12-16 20:11:07 +01:00
20e90c0de4 Rework to #1848 RawHTML not being saved
Restructured the execution of code.
RawHTML now works as it did in previous versions as well as the new functionality.
2021-12-16 20:07:40 +01:00
2892d5ec6f Update README.md 2021-12-16 09:38:10 -05:00
e034811e92 #1880 Issue with new SettingService
Needed to update the SettingService to apply the IsPublic field when updating settings for the ModuleDefinition.
2021-12-15 18:54:26 +01:00
ee18bbd145 Merge pull request #1881 from sbwalker/dev
add logging for the logout event to the UI component, relocate module setting deletion to repository
2021-12-15 10:24:17 -05:00
e3ebbde767 add logging for the logout event to the UI component, relocate module setting deletion to repository 2021-12-15 10:33:12 -05:00
6a57980439 Merge pull request #1879 from leigh-pointer/#1877#1878-ModuleDelete
1877 Module data not being delete when recycle bin is purged
2021-12-15 10:14:38 -05:00
765760f3a5 Fix for #1877 #1878 Module data not being deleted
Fixed the permissions validation and added functionality to remove all the settings for the deleted module.
2021-12-15 08:26:00 +01:00
ab1ac7c995 Merge pull request #1875 from oqtane/master
Merge pull request #1874 from oqtane/dev
2021-12-12 20:46:54 -05:00
99b0c9c079 Merge pull request #1874 from oqtane/dev
3.0.1 release
2021-12-12 20:46:28 -05:00
e99ab431e1 Merge pull request #1872 from sbwalker/dev
create url mapping when page path changes
2021-12-12 09:50:33 -05:00
1e1aaaccca create url mapping when page path changes 2021-12-12 09:59:33 -05:00
318d6afb0e fix url mapping resx issue 2021-12-11 09:39:03 -05:00
ba353857eb Merge pull request #1869 from sbwalker/dev
fix url mapping resx issue
2021-12-11 09:30:19 -05:00
1fd42f343d Merge pull request #1867 from leigh-pointer/MissingRes-3.0.1
Missing resource Keys for URL mapping and Visitors
2021-12-11 09:25:45 -05:00
ec9686cfb8 Merge branch 'dev' into MissingRes-3.0.1 2021-12-11 09:25:03 -05:00
a1bff809f3 Merge pull request #1868 from sbwalker/dev
visitor improvements
2021-12-11 09:21:26 -05:00
76fe155c0a visitor improvements 2021-12-11 09:30:05 -05:00
0b0254aed9 Updated Resx file 2021-12-11 14:24:08 +01:00
9258c3849b Went through each Framework module updating Resources
New English resources added
2021-12-11 13:43:22 +01:00
d530f30bc9 Missing Res Keys
Added missing resource keys
2021-12-11 11:54:25 +01:00
7d8bbac04f remove quill 1.3.6 assets 2021-12-10 14:19:32 -05:00
7b0c0c3e17 prepare for 3.0.1 2021-12-10 14:16:16 -05:00
298c3097f7 Merge pull request #1866 from sbwalker/dev
remove quill 1.3.6 assets
2021-12-10 14:10:59 -05:00
3a3f221418 Merge pull request #1865 from sbwalker/dev
prepare for 3.0.1
2021-12-10 14:07:30 -05:00
78110791e1 Merge pull request #1863 from leigh-pointer/InstallManagerDelete
Fix for Installed packages not being removed correctly
2021-12-10 10:11:31 -05:00
95d4c3d0d5 Merge pull request #1864 from sbwalker/dev
adjust permissions for new settings
2021-12-10 10:11:16 -05:00
e95b49ba8f adjust permissions for new settings 2021-12-10 10:20:03 -05:00
92ccb7e463 Fix for Installed packages not being removed correctly
When a package is remove in some instance the system complains that a file still exists in the deleting directory but there is not file.
Added true parameter to the Directory delete for force the removal. 
Directory.Delete(Path.GetDirectoryName(filepath), true);
2021-12-10 16:06:12 +01:00
2f34bf69e3 moduledefinition settings and host settings 2021-12-09 15:50:00 -05:00
d093c03d92 Merge pull request #1862 from sbwalker/dev
moduledefinition settings and host settings
2021-12-09 15:41:19 -05:00
d1ade8789b Merge pull request #1832 from leigh-pointer/ModuleDefinitionSettings
Settings for ModuleDefinitions #1829
2021-12-09 13:35:54 -05:00
1291eb5b7c Merge pull request #1861 from sbwalker/dev
added support for url mapping and viitors
2021-12-09 08:40:15 -05:00
9c32937c83 added support for url mapping and viitors 2021-12-09 08:48:56 -05:00
1ec28e9825 Merge pull request #1855 from svendu/fix_postgres_installation
Make IsPublic of type bool to make PostgreSQL happy
2021-12-08 12:54:30 -05:00
86fce898e5 Merge pull request #1853 from leigh-pointer/PagerBoth
Update the ToolBar position on the Pager Component
2021-12-08 12:54:10 -05:00
bbee87f7df Make IsPublic of type bool 2021-12-07 12:07:26 +01:00
811ddb9b44 Update the ToolBar position on the Pager Component
Add the option "Both" to display the toolbar at the top and bottom of the pager.  Nice if the Pager is displaying large sets of data.
2021-12-06 19:18:07 +01:00
de798da074 Merge pull request #1848 from leigh-pointer/RichTextContentRefresh
Fix #1837 RichTextEditor Content not re-Rendering
2021-12-03 09:45:59 -05:00
65d468be33 Fix #1837 RichTextEditor Content not re-Rendering
Change to the OnAfterRenderAsync method and changed OnInitialized to OnParametersSet
2021-12-03 06:31:45 +01:00
9664ff67f3 Merge pull request #1842 from leigh-pointer/QuillEditor1.3.7-SecurityUpdate
Quill Security related bug fixes.
2021-12-02 16:24:49 -05:00
99f73cf31e Merge pull request #1846 from sbwalker/dev
Additional properties added to Route model to improve abstraction, modified Site Settings to support settings moved to the server.
2021-12-02 16:24:39 -05:00
a216e2b92e Additional properties added to Route model to improve abstraction, modified Site Settings to support settings moved to the server. 2021-12-02 16:33:16 -05:00
9dfd9ad519 Quill Security related bug fixes.
Upgraded Quill references to 1.3.7
Tabnabbing vulnerability in snow theme #2438
https://github.com/quilljs/quill/issues/2438

https://github.com/quilljs/quill/releases/tag/v1.3.7
2021-12-02 09:56:55 +01:00
97133510a7 Update README.md 2021-12-01 09:11:21 -05:00
43d166fb7d Route parsing abstraction and optimization, site router performance improvements, migrate site-based concepts (favicon, PWA support) to server for performance and prerendering benefits, move ThemeBuilder interop logic to OnAfterRenderAsync, upgrade SqlClient to release version, update installer to Bootstrap 5.1.3 2021-12-01 08:22:59 -05:00
2f8a580854 Merge pull request #1840 from sbwalker/dev
Route parsing abstraction and optimization, site router performance improvements, migrate site-based concepts (favicon, PWA support) to server for performance and prerendering benefits, move ThemeBuilder interop logic to OnAfterRenderAsync, upgrade SqlClient to release version, update installer to Bootstrap 5.1.3
2021-12-01 08:14:46 -05:00
a21a2ab3bb Settings for ModuleDefinitions #1829
Add Update settings for the ModuleDefinition
2021-11-24 16:06:52 +01:00
03106526e9 Enhance the default site template with a Develop page that makes the Module Creator more discoverable for new users 2021-11-24 09:07:43 -05:00
a9ac3917b3 Merge pull request #1831 from sbwalker/dev
Enhance the default site template with a Develop page that makes the Module Creator more discoverable for new users
2021-11-24 08:59:54 -05:00
53ff491efd Assorted enhancements 2021-11-24 08:08:39 -05:00
1feb6ec452 Merge pull request #1830 from sbwalker/dev
Assorted enhancements
2021-11-24 08:00:49 -05:00
df00f53e54 Merge pull request #1823 from hishamco/tab-panel-localizer
Fix heading localization in TabPanel
2021-11-22 16:03:50 -05:00
be32af7588 Merge pull request #1827 from sbwalker/dev
refactored ErrorBoundary implementation to support logging
2021-11-22 16:03:17 -05:00
19be77ed49 refactored ErrorBoundary implementation to support logging 2021-11-22 16:11:44 -05:00
1c43c095bc Fix heading localization in TabPanel 2021-11-20 09:47:49 +03:00
59850f4869 Merge pull request #1815 from chlupac/ErrorBoundary
Implementing ErrorBoundary in ModuleInstance component
2021-11-18 16:14:35 -05:00
804b61ff95 Merge pull request #1820 from hishamco/swagger
Handle SchemaId in Swagger
2021-11-18 08:54:57 -05:00
d431c607ba Handle SchemaId in Swagger 2021-11-18 14:50:17 +03:00
b87b0489e9 Merge pull request #1812 from leigh-pointer/PageModules
Modification to Page Management component
2021-11-17 08:52:31 -05:00
2e593d44ee Merge pull request #1813 from leigh-pointer/ModuleDefinitionsInUse
Modification to Module Management
2021-11-17 08:49:00 -05:00
71354464e3 Merge pull request #1810 from leigh-pointer/ControlPanel
Page management buttons resizing
2021-11-17 08:44:39 -05:00
c48b4788c6 Merge pull request #1805 from chlupac/AliasFix
Fix - site with default alias (*) edit fail
2021-11-17 08:44:05 -05:00
fe9a7333ed Merge pull request #1798 from leigh-pointer/BreadCrumbs
Fix for #1797 Breadcrumbs render clickable
2021-11-17 08:43:55 -05:00
16d9e06db2 Merge pull request #1793 from 2sic-forks/dev
Add many PrivateApi attributes to hide unimportant stuff in docs
2021-11-17 08:43:35 -05:00
b40ee19735 ErrorBoundary 2021-11-17 11:22:24 +01:00
d5b0356625 Modification to Module Management
The component now reports back if the module is in use.  This will assist in housekeeping and removal of unused modules.
2021-11-16 00:37:57 +01:00
5ca77c3f64 Modification to Page Management component
Add a new tabpane that lists all the module on that page.  From here you are able to modify the module settings and or delete the module from a page.  Delete will send the module to the recycle bin.
2021-11-15 23:26:20 +01:00
54e9307795 Page management buttons resizing
When the language is changed, in this instance Dutch the buttons are not resized to fit the caption.  This small fix rectifies this.
2021-11-15 21:14:40 +01:00
60d7e45048 Fix - site with default alias (*) edit fail 2021-11-14 10:22:01 +01:00
931559cca8 Update README.md 2021-11-12 09:42:34 -05:00
2567c2937d Fix for #1797 Breadcrumbs render clickable
This fixes the issue when the page property IsClickable is set to false the breadcrum for the page is not clickable.
2021-11-12 07:07:15 +01:00
5b8e6d4df6 Add many PrivateApi attributes to hide unimportant stuff in docs 2021-11-11 20:01:55 +01:00
087c053bd5 Merge pull request #1791 from oqtane/master
Merge pull request #1790 from oqtane/dev
2021-11-11 10:13:49 -05:00
7e699136d7 Merge pull request #1790 from oqtane/dev
version 3.0.0 release
2021-11-11 10:13:00 -05:00
b7bbfe2a46 Merge pull request #1789 from sbwalker/dev
updated database provider references
2021-11-11 09:12:49 -05:00
69783b0709 updated database provider references 2021-11-11 09:21:01 -05:00
614041d55e update Blazor theme with bootstrap bundle js 2021-11-11 07:50:24 -05:00
856f61c2ee Merge pull request #1787 from sbwalker/dev
update Blazor theme with bootstrap bundle js
2021-11-11 07:42:10 -05:00
b0b196a522 Merge pull request #1786 from leigh-pointer/ActionMenu
Fix for Action Menus not displaying. #1785
2021-11-11 07:38:25 -05:00
62f04d239f Fix for Action Menus not displaying. #1785
Dropdowns are built on a third party library, Popper, which provides dynamic positioning and viewport detection.  / bootstrap.bundle.js which contains Popper. Popper isn’t used to position dropdowns in navbars though as dynamic positioning isn’t required.

updated the Bootstrap to reference the ../5.1.3/js/bootstrap.bundle.min.js
2021-11-11 10:27:09 +01:00
4210d10fca Merge pull request #1782 from leigh-pointer/Bootstrap
Upgrade to 5.1.3 Bootstrap and Bootswatch Cyborg
2021-11-10 17:25:27 -05:00
d02842f0ea Merge branch 'dev' into Bootstrap 2021-11-10 17:25:16 -05:00
2543b7db79 Upgrade to 5.1.3 Bootstrap and Bootswatch Cyborg
Fixed issue with OffCanvas not rendering properly.
2021-11-10 22:34:19 +01:00
41f430429b Merge pull request #1781 from sbwalker/dev
fix UX in module/theme creators
2021-11-10 15:48:36 -05:00
4ed4f8d942 fix UX in module/theme creators 2021-11-10 15:56:51 -05:00
cc5396801b update Test project dependencies 2021-11-10 13:12:38 -05:00
a72dc36d67 Merge pull request #1780 from sbwalker/dev
update Test project dependencies
2021-11-10 13:04:23 -05:00
50989e4e1e Merge pull request #1778 from sbwalker/dev
use Cloudflare CDN for static resources
2021-11-10 08:52:38 -05:00
41487440e3 use Cloudflare CDN for static resources 2021-11-10 09:00:48 -05:00
af72750354 Merge pull request #1776 from leigh-pointer/ReplaceRoot
[RootFolder] was missing from Release.cmd
2021-11-10 08:44:15 -05:00
a58dc49acc [RootFolder] was missing from Release.cmd
One of the replace tokens was not added to the second command line.
2021-11-10 14:26:26 +01:00
6dbb493d10 updating module and theme templates 2021-11-08 15:12:41 -05:00
b8c37ff5d7 Merge pull request #1772 from sbwalker/dev
updating module and theme templates
2021-11-08 15:04:29 -05:00
04319195c6 update to official .NET 6 release 2021-11-08 14:55:24 -05:00
aadd78b7ac Merge pull request #1771 from sbwalker/dev
update to official .NET 6 release
2021-11-08 14:47:12 -05:00
e23da1f5fb Update README.md 2021-11-06 07:53:54 -04:00
50eeaf8497 add support for TrustServerCertificate connection string option for SQL Server 2021-11-05 16:01:00 -04:00
039202559f Merge pull request #1764 from sbwalker/dev
add support for TrustServerCertificate connection string option for SQL Server
2021-11-05 15:53:00 -04:00
5419032e8d upgrade module and theme templates to .NET6 2021-11-05 12:53:13 -04:00
017a92c4bc Merge pull request #1763 from sbwalker/dev
upgrade module and theme templates to .NET6
2021-11-05 12:45:10 -04:00
a16040a595 remove unnecessary cascading parameter to improve efficiency 2021-11-05 09:03:12 -04:00
3f6936a999 Merge pull request #1762 from sbwalker/dev
remove unnecessary cascading parameter to improve efficiency
2021-11-05 08:55:03 -04:00
d3f3359f66 fix #1745 - error on WebAssembly when logging out 2021-11-04 08:06:28 -04:00
3f110aaabd Merge pull request #1761 from sbwalker/dev
fix #1745 - error on WebAssembly when logging out
2021-11-04 07:58:22 -04:00
4e884d57ca Merge pull request #1760 from leigh-pointer/Navigation
Navigation
2021-11-04 07:34:10 -04:00
efbe0562f9 Navigation was not completed 2021-11-04 06:09:19 +01:00
096dfea1a6 Merge remote-tracking branch 'oqtane/dev' into dev 2021-11-04 05:53:42 +01:00
bd5a827593 fix #1746 - SQL Server installation needs to allow configuration of encryption setting on .NET 6 2021-11-03 16:37:37 -04:00
404bcaddd4 Merge pull request #1759 from sbwalker/dev
fix #1746 - SQL Server installation needs to allow configuration of encryption setting on .NET 6
2021-11-03 16:29:45 -04:00
d2d52a7eb3 update SqlClient to latest preview version 2021-11-03 14:42:24 -04:00
1761c47713 Merge pull request #1758 from sbwalker/dev
update SqlClient to latest preview version
2021-11-03 14:34:28 -04:00
82e97aa4fa Merge pull request #1750 from leigh-pointer/BlazorTheme
Fix for #1736 Blazor theme not rendering correctly
2021-11-03 12:32:45 -04:00
e598178869 Merge pull request #1752 from leigh-pointer/PView
Fix for #1749 navigate to sub sub pages
2021-11-03 12:32:34 -04:00
b6f89195ab Merge pull request #1754 from leigh-pointer/1753
Update for #1753 Date format for the Audit
2021-11-03 12:31:43 -04:00
7aa92c039a Merge remote-tracking branch 'oqtane/dev' into dev 2021-11-02 20:06:37 +01:00
fff36949b7 Fix for #1749 navigate to sub sub pages
Also added missing "Browse" localization from site/index,resx
2021-11-02 19:59:59 +01:00
c524f17978 Merge pull request #1757 from sbwalker/dev
Fix #1751 - error when creating site with new tenant
2021-11-02 14:41:21 -04:00
e0a0497dd2 Fix #1751 - error when creating site with new tenant 2021-11-02 14:49:06 -04:00
fce9220dcb Update for #1753 Date format for the Audit
Added Parameter DateTimeFormat with default value of  "MMM dd yyyy HH:mm:ss"
2021-11-02 07:01:24 +01:00
a8ddb64b49 Fix for #1749 navigate to sub sub pages
Added Open button that will navigate to sub pages
2021-11-02 05:57:05 +01:00
6d8df2661c modification for responsive theme
small modification to ensure theme is responsive
2021-10-31 07:08:19 +01:00
1659de3a2b Fix for #1736 Server Css
Update to the Server file Theme.css
2021-10-28 20:35:48 +02:00
9752c72998 Fix for #1736 Blazor theme not rendering correctly
Fix to the Default theme and container
2021-10-28 19:43:51 +02:00
db2e3a518d Update README.md 2021-10-27 10:04:00 -04:00
94b20662a4 Update README.md 2021-10-26 08:37:09 -04:00
7bfc0998fd fix #1713 - link to home path displays login page 2021-10-26 08:30:50 -04:00
6707f0efdf Update README.md 2021-10-26 08:27:18 -04:00
c7fe5a538f Merge pull request #1735 from sbwalker/dev
fix #1713 - link to home path displays login page
2021-10-26 08:23:12 -04:00
9b20006938 removed hidden form fields which are unnecessary as a result of recent changes 2021-10-22 10:33:09 -04:00
0b258bd384 Merge pull request #1730 from sbwalker/dev
removed hidden form fields which are unnecessary as a result of recent changes
2021-10-22 10:25:41 -04:00
2302c17273 Update README.md 2021-10-19 16:21:13 -04:00
b619699637 Update README.md 2021-10-19 16:19:43 -04:00
34434e03fe Merge pull request #1725 from sbwalker/dev
upgrade to .NET 6 and increment version to 3.0.0
2021-10-19 15:27:19 -04:00
29bd31f609 upgrade to .NET 6 and increment version to 3.0.0 2021-10-19 15:33:03 -04:00
cf69f9e4c4 Add proper help text to aliases field in default resource file for Site Settings. Set default value for new ShowLogin parameter in Login theme component. 2021-10-17 13:27:12 -04:00
028c9bf0a8 Merge pull request #1720 from sbwalker/dev
Add proper help text to aliases field in default resource file for Site Settings. Set default value for new ShowLogin parameter in Login theme component.
2021-10-17 13:20:24 -04:00
3e9a4f2c1a Fixed validation issue in Role Managment - Users. Modified FileManager component to allow Folder parameter to contain a folder path which is translated to a FolderId internally and refactored Packages folder logic. 2021-10-06 17:20:44 -04:00
960543d14d Merge pull request #1709 from sbwalker/dev
Fixed validation issue in Role Managment - Users. Modified FileManager component to allow Folder parameter to contain a folder path which is translated to a FolderId internally and refactored Packages folder logic.
2021-10-06 17:14:45 -04:00
299674f53b Update README.md 2021-10-06 09:55:47 -04:00
306b78b526 Added ability for Runtime and RenderMode to be set per Site - enabling the framework to support multiple hosting models concurrently in the same installation. Fixed WebAssembly Prerendering issue (this also resolved the issue where the component taghelper was not passing parameters correctly to the app when running on WebAssembly). Fix #1702 - remove web,config from upgrade package. 2021-10-05 14:32:05 -04:00
f369382a54 Merge pull request #1708 from sbwalker/dev
Added ability for Runtime and RenderMode to be set per Site - enabling the framework to support multiple hosting models concurrently in the same installation. Fixed WebAssembly Prerendering issue (this also resolved the issue where the component taghelper was not passing parameters correctly to the app when running on WebAssembly). Fix #1702 - remove web,config from upgrade package.
2021-10-05 14:25:12 -04:00
ac67d88e74 fix logic which sometimes results in System.InvalidOperationException: The value of IsFixed cannot be changed dynamically 2021-10-01 15:58:17 -04:00
1f4f70009c Merge pull request #1704 from sbwalker/dev
fix logic which sometimes results in  System.InvalidOperationException: The value of IsFixed cannot be changed dynamically
2021-10-01 15:51:26 -04:00
838d918451 Merge pull request #1701 from leigh-pointer/1690-1
1690 User Management Tab needs clicking to render UI when language is not default.
2021-10-01 11:23:01 -04:00
8e6c73d2bc Merge pull request #1703 from sbwalker/dev
Allow root page paths (rather than specifying a magic "home" string). More UX improvements to FileManager and Pager.
2021-10-01 11:22:02 -04:00
aeb599867c Allow root page paths (rather than specifying a magic "home" string). More UX improvements to FileManager and Pager. 2021-10-01 11:28:48 -04:00
2fe93d4e64 Fix for #1690 Tab needs clicking to render UI
User Management Tab needs clicking to render UI when language is not default.  Modification to the TabPanel fixes the issue without  forcing the Heading property to be populated.
2021-09-29 18:05:59 +02:00
3e789e0642 UX improvements to FileManager and Pager components 2021-09-29 10:46:23 -04:00
a762f206a1 Merge pull request #1699 from sbwalker/dev
UX improvements to FileManager and Pager components
2021-09-29 10:39:43 -04:00
c0b13a1f09 2.3.1 database provider packages 2021-09-27 14:22:23 -04:00
070ddff1b4 Merge pull request #1697 from sbwalker/dev
2.3.1 database provider packages
2021-09-27 14:15:37 -04:00
9d0770e360 Merge pull request #1696 from oqtane/master
Merge pull request #1695 from oqtane/dev
2021-09-27 14:04:23 -04:00
088cb2a30e Merge pull request #1695 from oqtane/dev
2.3.1 release
2021-09-27 14:03:55 -04:00
c2be84a367 increment version to 2.3.1 2021-09-27 11:43:57 -04:00
4f61dd7bb3 Merge pull request #1694 from sbwalker/dev
increment version to 2.3.1
2021-09-27 11:37:34 -04:00
30fb6fd8e2 Merge pull request #1693 from sbwalker/dev
fix #1691 - AntiForgeryToken header not being set during startup
2021-09-27 08:37:27 -04:00
4bfb5d9f34 fix #1691 - AntiForgeryToken header not being set during startup 2021-09-27 08:44:16 -04:00
023f29491d Update README.md 2021-09-25 09:08:20 -04:00
5166fe2b41 Update README.md 2021-09-25 09:04:36 -04:00
71aa41d55e Update README.md 2021-09-25 09:03:44 -04:00
f6fd50f449 Update README.md 2021-09-25 09:02:06 -04:00
81e2f7c288 Update README.md 2021-09-25 09:01:40 -04:00
895d5e50de Merge pull request #1689 from oqtane/master
Merge pull request #1688 from oqtane/dev
2021-09-24 17:12:22 -04:00
6cd1b1ceaa Merge pull request #1688 from oqtane/dev
2.3.0 release
2021-09-24 17:11:32 -04:00
82ae9409f1 Merge branch 'dev' of https://github.com/sbwalker/oqtane.framework into dev 2021-09-24 17:07:04 -04:00
764b879a77 changes to build/publish params for WebAssembly 2021-09-24 17:06:45 -04:00
d3e71b6a7e Merge pull request #1687 from sbwalker/dev
changes to build/publish params for WebAssembly
2021-09-24 17:00:39 -04:00
80d23d1c95 Add paging to SQL Manager results 2021-09-23 18:02:15 -04:00
531e89346e Merge pull request #1685 from sbwalker/dev
Add paging to SQL Manager results
2021-09-23 17:55:44 -04:00
f220cb52bb Merge pull request #1682 from gjwalk/dev
Sites Validation
2021-09-23 17:12:36 -04:00
58ff42f813 Merge pull request #1683 from nicpitsch/pr_user-management-profile
Profile properties as dropdown in User Management
2021-09-23 17:10:33 -04:00
6b82b03bf1 Merge pull request #1684 from sbwalker/dev
Use ComponentTagHelper parameters on Blazor Server for passing state to allow pre-rendering to function properly ( ComponentTagHelper parameters do not work on Blazor WebAssembly - likely a .NET 5 bug )
2021-09-23 17:10:24 -04:00
005843ef2d Use ComponentTagHelper parameters on Blazor Server for passing state to allow pre-rendering to function properly ( ComponentTagHelper parameters do not work on Blazor WebAssembly - likely a .NET 5 bug ) 2021-09-23 17:16:51 -04:00
10917644ab Profile properties as dropdown in User Management (same as User Profile). 2021-09-23 10:05:24 +02:00
9fa3ade832 Sites Validation 2021-09-22 18:22:30 -04:00
e10135271d Update README.md 2021-09-22 16:37:57 -04:00
c1b482e0c0 check in latest database provider packages 2021-09-22 14:47:14 -04:00
a3d7760a09 Merge pull request #1681 from sbwalker/dev
check in latest database provider packages
2021-09-22 14:40:54 -04:00
57db7c1efc update version to 2.3.0 in preparation for release 2021-09-22 11:55:01 -04:00
586c9b6db6 Merge pull request #1680 from sbwalker/dev
update version to 2.3.0 in preparation for release
2021-09-22 11:48:23 -04:00
58a86b67ee fix #1672 - releases need to be published with IL trimming disabled or else dynamic methods will be stripped. Unfortunately compression needs to be disabled as well as if it is not, a "None of the “sha256” hashes in the integrity attribute match the content of the subresource." error is thrown. This seems to be a bug - which I will pursue with Microsoft. 2021-09-22 10:24:13 -04:00
43ebf50b61 Merge pull request #1679 from sbwalker/dev
fix #1672 - releases need to be published with IL trimming disabled or else dynamic methods will be stripped. Unfortunately compression needs to be disabled as well as if it is not, a "None of the “sha256” hashes in the integrity attribute match the content of the subresource." error is thrown. This seems to be a bug - which I will pursue with Microsoft.
2021-09-22 10:17:48 -04:00
5071cf4752 modify method for determining Runtime in SiteRouter as ComponentTagHelper "param-" appears to only work on Blazor Server - not on WebAssembly 2021-09-21 12:48:15 -04:00
00e2e79fc5 Merge pull request #1676 from sbwalker/dev
modify method for determining Runtime in SiteRouter as ComponentTagHelper "param-" appears to only work on Blazor Server - not on WebAssembly
2021-09-21 12:41:31 -04:00
8d37444755 improve validation for public site settings 2021-09-21 07:45:43 -04:00
20d81bee00 Merge pull request #1675 from sbwalker/dev
improve validation for public site settings
2021-09-21 07:39:35 -04:00
ca387d7b26 fix Oqtane theme settings for page scope 2021-09-20 17:23:56 -04:00
a0580f6861 Merge pull request #1674 from sbwalker/dev
fix Oqtane theme settings for page scope
2021-09-20 17:17:09 -04:00
f739db1e42 Enhance Settings API for public Site Settings. Added Settings to Site model by default. Added new parameters to Login and UserProfile components. Enhanced Oqtane Theme settings to use new component parameters. Enhanced image download and resizing logic. 2021-09-20 17:15:52 -04:00
d5bfe7cfbd Merge pull request #1673 from sbwalker/dev
Enhance Settings API for public Site Settings. Added Settings to Site model by default. Added new parameters to Login and UserProfile components. Enhanced Oqtane Theme settings to use new component parameters. Enhanced image download and resizing logic.
2021-09-20 17:09:52 -04:00
db85e088bf fix #1659 installation issue on PostgreSQL by ntroducing a new RewriteValue method which can be overridden in a database provider to provide custom behavior. Updated PostgreSQL provide to utilize new method. Also added an Oqtane.Server project reference to the module and theme external templates to streamline the development experience (credit @leighpointer). 2021-09-17 13:56:19 -04:00
d053901b32 Merge pull request #1670 from 2sic-forks/dev
Documentation only
2021-09-17 13:50:02 -04:00
2957c7d6a9 Merge pull request #1671 from sbwalker/dev
fix #1659 installation issue on PostgreSQL by ntroducing a new RewriteValue method which can be overridden in a database provider to provide custom behavior. Updated PostgreSQL provide to utilize new method. Also added an Oqtane.Server project reference to the module and theme external templates to streamline the development experience (credit @leighpointer).
2021-09-17 13:49:52 -04:00
a69d52a389 undo accidental / internal commit 2021-09-17 15:40:05 +02:00
7b5dbbd7ed undo change by 2sic 2021-09-17 15:36:23 +02:00
6d0fb6ca80 undo change by 2sxc 2021-09-17 15:35:43 +02:00
b4f7344ae4 removed unnecessary message from top of module, theme, language installation pages 2021-09-17 09:28:27 -04:00
a5cecb7354 Merge pull request #1669 from sbwalker/dev
removed unnecessary message from top of module, theme, language installation pages
2021-09-17 09:21:57 -04:00
406a15c5bd constrain file logger size 2021-09-17 09:17:42 -04:00
ed0408de95 Merge pull request #1668 from sbwalker/dev
constrain file logger size
2021-09-17 09:11:15 -04:00
b5bba1fd11 improved method for determining Runtime in SiteRouter 2021-09-17 09:06:27 -04:00
9065bad2bb Merge pull request #1667 from sbwalker/dev
improved method for determining Runtime in SiteRouter
2021-09-17 09:00:06 -04:00
289034fd4f fix #1640 - prevent UX "flicker" which was caused by pre-rendering 2021-09-17 08:48:01 -04:00
f052f6696f Merge pull request #1666 from sbwalker/dev
fix #1640 - prevent UX "flicker" which was caused by pre-rendering
2021-09-17 08:41:44 -04:00
267ca178ed added basic xml comments to all Oqtane.Services interfaces 2021-09-17 10:13:26 +02:00
c01c16c7bc Merge pull request #1660 from gjwalk/dev
site validation
2021-09-16 18:00:50 -04:00
2ac069082d Merge pull request #1663 from sbwalker/dev
file manager component improvements
2021-09-16 17:58:20 -04:00
f00ea09b6e file manager component improvements 2021-09-16 18:04:50 -04:00
b9259ce6ca added optional event callback delegates to FileManager component to allow calling components to be notified on upload, change, or delete 2021-09-16 07:59:36 -04:00
0490638657 Merge pull request #1662 from sbwalker/dev
added optional event callback delegates to FileManager component to allow calling components to be notified on upload, change, or delete
2021-09-16 07:53:31 -04:00
467b6ba9da site validation 2021-09-15 19:10:14 -04:00
423a42d25b fixed invalid XML comment 2021-09-15 17:07:40 +02:00
b496dc488c Merge branch 'oqtane-dev' into dev 2021-09-15 15:23:28 +02:00
9750723035 Merge branch 'dev' of https://github.com/oqtane/oqtane.framework into oqtane-dev
# Conflicts:
#	Oqtane.Client/App.razor
2021-09-15 15:23:16 +02:00
a4f147b547 Merge pull request #1655 from gjwalk/dev
roles validation
2021-09-15 07:58:21 -04:00
0827fedb74 Merge pull request #1658 from sbwalker/dev
Added support for File descriptions, Folder capacity and image sizes. Added image resizing capability using ImageSharp - implemented in user profile. Added parameter to disable image preview in FileManager component. Overhauled Pager component and added Columns parameter for Grid mode. Populated PageState.User.IsAuthenticated in SiteRouter. Added support for zero price commercial extentions.
2021-09-15 07:57:06 -04:00
898b908c1b Added support for File descriptions, Folder capacity and image sizes. Added image resizing capability using ImageSharp - implemented in user profile. Added parameter to disable image preview in FileManager component. Overhauled Pager component and added Columns parameter for Grid mode. Populated PageState.User.IsAuthenticated in SiteRouter. Added support for zero price commercial extentions. 2021-09-15 08:02:55 -04:00
f21b70a51e roles validation 2021-09-11 18:18:23 -04:00
ba7524b754 Merge pull request #1651 from leigh-pointer/RecycleCheck
Validate if Page in Recycle Bin During Creation
2021-09-10 13:06:59 -04:00
eb068a8d53 Merge pull request #1652 from sbwalker/dev
fix #1647 - module reordering on page issue
2021-09-10 13:05:35 -04:00
14fbc3a5b4 fix #1647 - module reordering on page issue 2021-09-10 13:12:00 -04:00
d2fa8902f9 Auto stash before rebase of "origin/RecycleCheck"
correction
2021-09-10 18:59:23 +02:00
53e5728ad2 fix #1640 to resolve issue with server prerendering, upgrade Installer to Bootstrap5, add more defensive logic and logging to DatabaseManager, fix file logger issue, update Pager to use Bootstrap5 pagination, add expiry date support for commercial extensions 2021-09-10 08:24:05 -04:00
dd7de055f6 Merge pull request #1650 from sbwalker/dev
fix #1640 to resolve issue with server prerendering,  upgrade Installer to Bootstrap5, add more defensive logic and logging to DatabaseManager, fix file logger issue, update Pager to use Bootstrap5 pagination, add expiry date support for commercial extensions
2021-09-10 08:17:52 -04:00
3cd7249750 Page create - Recycle Bin Check
After Delete Page, Cant create page of same name #1645 issue. Added check and message if the page is in the recycle bin.
2021-09-08 08:08:24 +02:00
07165ce68d add support for trial periods 2021-09-03 15:24:51 -04:00
2c0fe71f14 Merge pull request #1642 from sbwalker/dev
add support for trial periods
2021-09-03 15:18:58 -04:00
c74a53b301 update fix https://github.com/oqtane/oqtane.framework/issues/1640 2021-09-02 20:50:16 +02:00
3663f723e7 fix https://github.com/oqtane/oqtane.framework/issues/1640 2021-09-02 20:32:04 +02:00
233da1508b Replacing dependency on System.Drawing with SixLabors.ImageSharp based on cross platform guidance from Microsoft 9b4520703c/accepted/2021/system-drawing-win-only/system-drawing-win-only.md 2021-09-02 11:58:31 -04:00
ad34e9aeb8 Merge pull request #1639 from sbwalker/dev
Replacing dependency on System.Drawing with SixLabors.ImageSharp based on cross platform guidance from Microsoft 9b4520703c/accepted/2021/system-drawing-win-only/system-drawing-win-only.md
2021-09-02 11:54:40 -04:00
d29dc9d036 make containing class overridable in Control Panel ( header and body are already overridable ) 2021-09-01 09:13:09 -04:00
d71030fdef Merge pull request #1638 from sbwalker/dev
make containing class overridable in Control Panel ( header and body are already overridable )
2021-09-01 09:07:02 -04:00
bb5ca475d3 fix #1628 - make DBContext Transient, modify Control Panel to use standard Bootstrap 5 offcanvas classes, add auto trimming to file logger, fix issue in File Repository related to populating Url on Add/Update. 2021-09-01 09:01:11 -04:00
01c7a8fcdb Merge pull request #1637 from sbwalker/dev
fix #1628 - make DBContext Transient, modify Control Panel to use standard Bootstrap 5 offcanvas classes, add auto trimming to file logger, fix issue in File Repository related to populating Url on Add/Update.
2021-09-01 08:55:06 -04:00
f6c46878c6 add new overloads to client-side logging methods to include LogFunction enum parameter so that it can be specified explicitly rather than only being inferred from the page action 2021-08-30 08:46:53 -04:00
acda6bba74 Merge pull request #1634 from gjwalk/dev
reset validation
2021-08-30 08:42:23 -04:00
c8ee066608 Merge pull request #1635 from sbwalker/dev
add new overloads to client-side logging methods to include LogFunction enum parameter so that it can be specified explicitly rather than only being inferred from the page action
2021-08-30 08:40:55 -04:00
ca9fffaa71 reset validation 2021-08-29 21:03:35 -04:00
e00b7c9be9 add some missing localization keys 2021-08-27 17:29:45 -04:00
ee1a2b1810 Merge pull request #1631 from sbwalker/dev
add some missing localization keys
2021-08-27 17:23:37 -04:00
14266a99b3 Merge pull request #1614 from gjwalk/dev
register validation
2021-08-27 12:57:09 -04:00
7b105107cc Merge pull request #1630 from sbwalker/dev
fix #1617 convert line break to comma when saving aliases, improve license acceptance user experience
2021-08-27 08:11:54 -04:00
bb75242a4f fix #1617 convert line break to comma when saving aliases, improve license acceptance user experience 2021-08-27 08:17:48 -04:00
39ccc30680 fix Type label in Add Folder UI, make Profile description required, fix misc Bootstrap 5 cosmetic issues, fix #1618 Alias case sensitivity in router, fix File add and update methods so they return Url, fix UrlCombine helper method to use proper slash, enhance package installation to support commercial options 2021-08-26 18:20:58 -04:00
41651075e6 Merge pull request #1627 from horacioj/typo-Message.Required.Smtp
Fix typo for RESX message Message.Required.Smtp
2021-08-26 18:15:08 -04:00
e3af463e65 Merge pull request #1629 from sbwalker/dev
fix Type label in Add Folder UI, make Profile description required, fix misc Bootstrap 5 cosmetic issues, fix #1618 Alias case sensitivity in router, fix File add and update methods so they return Url, fix UrlCombine helper method to use proper slash, enhance package installation to support commercial options
2021-08-26 18:14:59 -04:00
5cbb8b1fa3 Fix typo for RESX message Message.Required.Smtp 2021-08-24 17:05:08 -03:00
2a7b74a0e1 Merge pull request #1622 from oqtane/revert-1603-dev
Revert "EntityBuilder UpdateColumn to dynamic type of value"
2021-08-20 16:32:18 -04:00
21fc493322 Revert "EntityBuilder UpdateColumn to dynamic type of value" 2021-08-20 16:32:04 -04:00
ea85eae4ce register validation 2021-08-18 10:55:34 -04:00
35ee97c145 Update LICENSE 2021-08-17 10:02:00 -04:00
097318cf9e make profile category optional 2021-08-17 08:13:17 -04:00
31d4f3d1b3 Merge pull request #1613 from sbwalker/dev
make profile category optional
2021-08-17 08:07:29 -04:00
83b3235a6b Merge pull request #1611 from gjwalk/dev
profiles validation
2021-08-17 08:02:57 -04:00
e47fc64c33 profiles validation 2021-08-16 14:37:11 -04:00
151a49f1ec Merge pull request #1610 from sbwalker/dev
fix #1607 - issue with setting Site Root when adding/editing a page
2021-08-16 11:33:05 -04:00
b78644f7e2 fix #1607 - issue with setting Site Root when adding/editing a page 2021-08-16 11:39:00 -04:00
d744e36dde Merge pull request #1603 from tomsync/dev
EntityBuilder UpdateColumn to dynamic type of value
2021-08-16 09:42:04 -04:00
90f4bd5120 Merge pull request #1605 from gjwalk/dev
pages validation
2021-08-16 09:41:09 -04:00
b436fcf749 Merge pull request #1609 from sbwalker/dev
support for commercial modules, themes, translations
2021-08-16 09:40:58 -04:00
ffcc229c78 support for commercial modules, themes, translations 2021-08-16 09:46:02 -04:00
ffe724b32d add support for free/paid in module, theme, translation installation 2021-08-13 15:56:22 -04:00
154d32cd31 Merge pull request #1606 from sbwalker/dev
add support for free/paid in module, theme, translation installation
2021-08-13 15:50:39 -04:00
7f056277ae pages validation 2021-08-12 14:48:23 -04:00
b19cbf54e0 add error handling to module export 2021-08-12 14:47:51 -04:00
aef0e363d8 Merge pull request #1604 from sbwalker/dev
add error handling to module export
2021-08-12 14:42:35 -04:00
6324034259 Merge pull request #1600 from gjwalk/dev
modules validation
2021-08-12 14:21:20 -04:00
5a1bada10c EntityBuilder UpdateColumn to dynamic type of value 2021-08-12 16:59:15 +07:00
ef90305bd7 modules validation 2021-08-09 12:38:12 -04:00
fe06a29ad2 Merge pull request #1594 from gjwalk/dev
moduleDefinitions validation
2021-08-09 11:24:00 -04:00
f6ae9822f3 Merge pull request #1599 from sbwalker/dev
fix #1593 - remove duplicate form tag from edit.razor
2021-08-09 11:21:56 -04:00
eb3e4916a8 fix #1593 - remove duplicate form tag from edit.razor 2021-08-09 11:27:39 -04:00
5a5535ea98 format license terms 2021-08-06 15:28:48 -04:00
4f8d0b1e7a Merge pull request #1596 from sbwalker/dev
format license terms
2021-08-06 15:23:22 -04:00
b1d64eac88 moduleDefinitions validation 2021-08-06 13:32:40 -04:00
04673a4804 Merge pull request #1591 from gjwalk/dev
moduleCreator validation
2021-08-06 12:55:17 -04:00
4d2f9d038a Merge pull request #1592 from sbwalker/dev
allow host username to be specified during installation, allow user to be added to host role, refresh user list after delete, improve date/time entry in scheduled jobs, require license acceptance during module and theme install
2021-08-06 12:54:39 -04:00
e4201c1a4d allow host username to be specified during installation, allow user to be added to host role, refresh user list after delete, improve date/time entry in scheduled jobs, require license acceptance during module and theme install 2021-08-06 12:59:56 -04:00
030c001371 moduleCreator validation 2021-08-06 11:44:52 -04:00
bd351f770b Merge pull request #1588 from gjwalk/dev
langauges validation
2021-08-06 08:56:47 -04:00
63093cca3b langauges validation 2021-08-05 12:24:11 -04:00
5c42e8e5bc Merge pull request #1587 from gjwalk/dev
jobs validation
2021-08-05 08:38:18 -04:00
153934b311 Merge pull request #1582 from leigh-pointer/1579
Fixes #1579 Exception when browsing to /login when you are already logged in
2021-08-05 08:38:05 -04:00
4b1ead1a36 jobs validation 2021-08-04 19:15:52 -04:00
ddafd21706 Fixes #1579 Exception when browsing to /login when you are already logged in
Added PageState.User check
2021-08-04 19:33:54 +02:00
6059a944bf Merge pull request #1577 from gjwalk/dev
files validation
2021-08-03 08:45:48 -04:00
1cc26c3902 files validation 2021-07-31 16:59:03 -04:00
00ca3d856b reset admin 2021-07-31 15:09:14 -04:00
9af8ab92c9 themes - users validation changes 2021-07-29 16:54:32 -04:00
46fcfcc321 reset - systemInfo validation changes 2021-07-29 16:52:27 -04:00
cf40462531 moduleDefintions - profiles validation changes 2021-07-29 16:46:58 -04:00
2dbf9671d9 dashboard - moduleCretaor changes 2021-07-29 16:38:36 -04:00
e42a687c9b fixing spacing 2021-07-29 15:28:15 -04:00
72c154b048 fix appsettings 2021-07-27 21:17:13 -04:00
b0921513c1 fix to theme 2021-07-27 21:12:18 -04:00
33a76c61ca updated modules for input requirements 2021-07-27 16:24:01 -04:00
c0254d0b92 Merge pull request #1567 from ADefWebserver/dev
Removes writing database connection string to appsettings.json in AzureDeploy.json
2021-07-22 09:21:19 -04:00
99d05fe4f9 Update README.md 2021-07-21 06:56:10 -07:00
f8ba6a0c5f Update README.md
Temporarily pointing to my Dev version of azuredeploy (do not merge)
2021-07-21 06:18:34 -07:00
3a58ed63e9 Update azuredeploy.json
https://github.com/oqtane/oqtane.framework/issues/1547
2021-07-21 06:14:42 -07:00
8aac801af2 Merge pull request #1566 from sbwalker/dev
update install wizard to Bootstrap 5
2021-07-19 16:44:43 -04:00
1cc16a7ed4 update install wizard to Bootstrap 5 2021-07-19 16:49:31 -04:00
7fe04d9651 Merge pull request #1564 from nicpitsch/dev
Copy external Theme to Oqtane.Server.
2021-07-19 16:44:34 -04:00
01a9dc4d2d Merge pull request #1562 from leigh-pointer/OffCanvas
user experience updates
2021-07-19 16:44:25 -04:00
1456462ca8 Copy external Theme to Oqtane.Server. 2021-07-19 20:53:45 +02:00
77415dc0e0 user experience updates 2021-07-18 17:30:32 +02:00
696b1970fc Update README.md 2021-07-18 11:15:03 -04:00
0e6baae366 Merge pull request #1554 from leigh-pointer/OffCanvas
ConltolPanel to use Bootstrap Offcanvas component
2021-07-18 10:42:09 -04:00
437e9ee43b Modifcations for ControlPanel BS5
current styles in app.css and theme.css for app-controlpanel removed as no longer needed.

Removed the _display var as that is no longer beign used.
2021-07-15 16:28:12 +02:00
6546f47bb2 Merge pull request #1556 from leigh-pointer/UsernameReadOnly 2021-07-15 09:47:51 -04:00
88c866057f Fix for #1555 Username readonly on Register form
Removed the readonly attribute from the username field.
2021-07-15 15:41:20 +02:00
3521dd41cd ConltolPanel to use Bootstrap Offcanvas component 2021-07-14 10:18:39 +02:00
dff3e6aaca Merge pull request #1550 from leigh-pointer/ModificationsBS5 2021-07-12 10:24:42 -04:00
4b04e6c8dc Merge pull request #1551 from leigh-pointer/ExtModDiv 2021-07-12 10:23:57 -04:00
37672ea632 Modified External Module Template
replace tables in markup with responsive approach.
2021-07-11 14:27:18 +02:00
31f35ad902 Modifications for Bootstrap 5
replace tables in markup with responsive approach
2021-07-11 14:16:33 +02:00
0b7b34f336 Merge pull request #1549 from leigh-pointer/Bootstrap5
modifications for Bootstrap 5
2021-07-10 19:35:41 -04:00
fca290f8f5 Modifications for Bootstrap 5
Admin section now finished.  All Tables now replaced with div
2021-07-10 13:37:05 +02:00
9da3b77f7d modifications for Bootstrap 5
Updated Admin areas Users and Roles
2021-07-10 09:00:34 +02:00
7b796f4a5f Merge pull request #1548 from sbwalker/dev
modifications for Bootstrap 5
2021-07-09 11:38:42 -04:00
0ce81169a6 modifications for Bootstrap 5 2021-07-09 11:43:37 -04:00
d1c2abf7e3 Merge pull request #1545 from hishamco/fix
Fix loading satellite assemblies
2021-07-08 10:34:02 -04:00
010872ef35 Merge pull request #1546 from sbwalker/dev
bootstrap5 fix to theme creator template, modifications to updater app
2021-07-08 10:31:19 -04:00
f536033087 framework updater UX improvements 2021-07-08 10:36:08 -04:00
9083888686 bootstrap5 fix to theme creator template, modifications to updater app 2021-07-07 16:15:38 -04:00
cf2d8531a3 Fix loading satellite assemblies 2021-07-07 20:38:53 +03:00
48b9e2f97b Merge pull request #1538 from oqtane/master
Merge pull request #1537 from oqtane/dev
2021-07-06 15:31:55 -04:00
57ac20519a Merge pull request #1537 from oqtane/dev
2.2.0 release
2021-07-06 15:31:18 -04:00
792086140b fix horizontal menu highlighting issue 2021-07-06 14:21:54 -04:00
ddeb05dfe2 Merge pull request #1535 from sbwalker/dev
fix horizontal menu highlighting issue
2021-07-06 14:17:12 -04:00
276431b62d update theme creator template to Bootstrap5 2021-07-06 11:00:45 -04:00
a89e7c06d4 Merge pull request #1534 from sbwalker/dev
update theme creator template to Bootstrap5
2021-07-06 10:56:02 -04:00
a79535d7d1 prepare for 2.2.0 release 2021-07-05 15:22:24 -04:00
649a134214 Merge pull request #1533 from sbwalker/dev
prepare for 2.2.0 release
2021-07-05 15:17:43 -04:00
910630cd26 Merge pull request #1531 from leigh-pointer/ModuleTemplates
Fix for #1530 Error in Module templates
2021-07-05 14:56:18 -04:00
a1baf70524 fix #1530 for Error in Module templates
The Get public Models.[Module] Get(int id) method in the [Module]Controller has an incorrect IF statement which in turn returns nothing and logs an error
2021-07-05 08:25:16 +02:00
7348540c4d Update README.md 2021-07-02 20:07:41 -04:00
534c6794f2 Merge pull request #1529 from sbwalker/dev
upgrade to Boostrap 5
2021-07-02 19:59:10 -04:00
cb7d9a0371 upgrade to Boostrap 5 2021-07-02 20:03:51 -04:00
525cbb87b0 allow disabling of swagger and package service 2021-07-01 09:11:29 -04:00
7f420e8a8f Merge pull request #1528 from sbwalker/dev
allow disabling of swagger and package service
2021-07-01 09:06:44 -04:00
eea417ff44 added logging for startup issues 2021-07-01 07:37:03 -04:00
070e00b735 Merge pull request #1527 from sbwalker/dev
added logging for startup issues
2021-07-01 07:32:34 -04:00
5268c326a1 suppress Internal EF Core API usage warning messages on build 2021-06-28 10:27:29 -04:00
49b2c323d0 Merge pull request #1523 from sbwalker/dev
suppress Internal EF Core API usage warning messages on build
2021-06-28 10:22:49 -04:00
bf6edceb36 Fix issue where module definition version was not being loaded correctly on startup. Also user customizable module definition properties were being overwritten on upgrade. 2021-06-28 10:21:48 -04:00
91eeeaf064 Merge pull request #1522 from sbwalker/dev
Fix issue where module definition version was not being loaded correctly on startup. Also user customizable module definition properties were being overwritten on upgrade.
2021-06-28 10:17:40 -04:00
17c0aec1fb show friendly message when no packages match criteria 2021-06-27 20:20:01 -04:00
e4c98ba24f Merge pull request #1519 from sbwalker/dev
show friendly message when no packages match criteria
2021-06-27 20:15:23 -04:00
8ef83b2de8 improve register for updates 2021-06-27 18:33:41 -04:00
376482e66e Merge pull request #1518 from sbwalker/dev
improve register for updates
2021-06-27 18:29:05 -04:00
2433958a0f fixed issue in SharedResource file 2021-06-27 08:59:04 -04:00
50bddd072b Merge pull request #1517 from sbwalker/dev
fixed issue in SharedResource file
2021-06-27 08:54:35 -04:00
b77d313715 Merge pull request #1515 from gjwalk/dev
Shared resources added
2021-06-27 08:50:46 -04:00
b59706ab8b Merge pull request #1516 from sbwalker/dev
add ability to register for updates
2021-06-27 08:47:25 -04:00
9e004f5b3c add ability to register for updates 2021-06-27 08:48:18 -04:00
f989f63546 Merge branch 'dev' into dev 2021-06-25 17:56:21 -04:00
ef6f5f2769 update resources 2021-06-25 17:03:29 -04:00
ba9ca22aaa update to resources 2021-06-25 16:34:30 -04:00
db1808d3e9 additional system info 2021-06-25 15:06:52 -04:00
8ad61a23c8 Merge pull request #1514 from sbwalker/dev
additional system info
2021-06-25 15:02:38 -04:00
e1e4d82684 resx file corrections 2021-06-25 08:22:36 -04:00
5d84eeea1d Merge pull request #1513 from sbwalker/dev
resx file corrections
2021-06-25 08:18:05 -04:00
509f054961 package UI updates 2021-06-25 08:10:15 -04:00
3a85eed397 Merge pull request #1512 from sbwalker/dev
package UI updates
2021-06-25 08:05:51 -04:00
52bcdb12c5 package management modifications 2021-06-24 18:02:01 -04:00
30a667debf Merge pull request #1511 from sbwalker/dev
package management modifications
2021-06-24 17:57:23 -04:00
161ab56701 improve handling of response status and logging in package controller 2021-06-24 10:42:43 -04:00
55bf2f1b6a Merge pull request #1510 from sbwalker/dev
improve handling of response status and logging in package controller
2021-06-24 10:38:31 -04:00
fb2a8e987e default resx fixes 2021-06-24 08:02:39 -04:00
0608287b5f Merge pull request #1509 from sbwalker/dev
default resx fixes
2021-06-24 07:58:08 -04:00
7fa30ff23c Merge pull request #1501 from Gotiap/dev
Allowed pages for external modules.
2021-06-24 07:37:49 -04:00
b0f76ff4e8 Merge pull request #1508 from sbwalker/dev
Page IsClickable column must be nullable in order to support upgrades, add more defensive logic
2021-06-24 07:37:27 -04:00
8e7b553ca8 Page IsClickable column must be nullable in order to support upgrades, add more defensive logic 2021-06-24 07:41:34 -04:00
89cc389918 Undo changes for login 2021-06-24 11:30:09 +05:30
bfafffd8cb add search to package manager components 2021-06-23 13:00:44 -04:00
4ea92652dd Merge pull request #1499 from ijaz-saeed/rich-text-editor
OnInitialized is not the right method to do this, Content is not set yet
2021-06-23 12:58:25 -04:00
6fbb325c42 Merge pull request #1506 from sbwalker/dev
add search to package manager components
2021-06-23 12:56:16 -04:00
c2f7546488 add database diagram 2021-06-22 14:30:20 -04:00
90778f5e1e Update README.md 2021-06-22 14:28:06 -04:00
c7d5f95949 Update README.md 2021-06-22 14:27:17 -04:00
67dff508ef Merge pull request #1504 from sbwalker/dev
add database diagram
2021-06-22 14:25:43 -04:00
c4e6a4af49 fix remaining default resx differences, enhance module message with ability to dismiss, fix issue in ConfigManager.RemoveSetting, introduce package registry service 2021-06-22 14:14:46 -04:00
c236e80e95 Merge pull request #1498 from ijaz-saeed/dev
adding SaveChangesAsync overloads to support Async save
2021-06-22 14:10:33 -04:00
1906a0ee8a Merge pull request #1502 from sbwalker/dev
fix remaining default resx differences, enhance module message with ability to dismiss, fix issue in ConfigManager.RemoveSetting, introduce package registry service
2021-06-22 14:10:23 -04:00
d348e9715f Allowed pages for external module.
Login internal module while edit, resolved error to be edit.
2021-06-22 10:51:05 +05:30
91a1bfcab2 adding SaveChangesAsync overloads to support Async save 2021-06-20 17:52:41 +05:00
73f2fc4f13 OnInitialized is not the right method to do this, Content is not available yet 2021-06-20 17:51:25 +05:00
247e00ecd4 implement shared resources 2021-06-18 16:56:54 -04:00
3274ab6258 Merge pull request #1497 from sbwalker/dev
implement shared resources
2021-06-18 16:52:27 -04:00
6bff09d0ca fix Localizer class specification 2021-06-18 16:46:15 -04:00
19f3095483 Merge pull request #1496 from sbwalker/dev
fix Localizer class specification
2021-06-18 16:41:47 -04:00
2e947625cd fix issue with HtmlText module rendering 2021-06-18 16:36:18 -04:00
8198f36530 Merge pull request #1495 from sbwalker/dev
fix issue with HtmlText module rendering
2021-06-18 16:32:09 -04:00
8bc0402801 fix syntax error 2021-06-18 16:30:49 -04:00
87aadcff5b Merge pull request #1494 from sbwalker/dev
fix syntax error
2021-06-18 16:27:00 -04:00
dc44fcd0d9 Merge pull request #1493 from gjwalk/dev
create default rex files with static keys
2021-06-18 16:21:37 -04:00
f7363504c2 Merge branch 'dev' into dev 2021-06-18 15:35:20 -04:00
ae0edcfd2d create default rex files with static keys 2021-06-18 14:45:38 -04:00
b180c260e5 Merge pull request #1492 from sbwalker/dev
improved error handling, improved consistency of console error messages, added ability to add a Decimal column in Migrations
2021-06-18 12:57:21 -04:00
3bc5744007 improved error handling, improved consistency of console error messages, added ability to add a Decimal column in Migrations 2021-06-18 13:01:42 -04:00
32c49f74d3 fix module template issues 2021-06-17 12:12:19 -04:00
8b70d1ccdc Merge pull request #1491 from sbwalker/dev
fix module template issues
2021-06-17 12:08:03 -04:00
f330c4fcb6 add extension method for Localization which allows specification of key and value 2021-06-16 22:16:48 -04:00
a953ca752e Merge pull request #1490 from sbwalker/dev
add extension method for Localization which allows specification of key and value
2021-06-16 22:12:48 -04:00
d32b622f7e allow order to be defined in page templates 2021-06-16 17:24:45 -04:00
8354d66c84 Merge pull request #1489 from sbwalker/dev
allow order to be defined in page templates
2021-06-16 17:20:53 -04:00
7ee9923b52 Merge pull request #1483 from leigh-pointer/SResControlPanel
Introduce SharedResource Localisation to ControlPanel
2021-06-16 16:27:52 -04:00
31c412a886 Merge pull request #1488 from sbwalker/dev
improvements to refresh logic, module template enhancements
2021-06-16 16:26:53 -04:00
72ff6fa0e7 improvements to refresh logic, module template enhancements 2021-06-16 16:31:02 -04:00
c6e12a614a Merge pull request #1485 from hishamco/database-projects
Add missing Oqtane.Server into Databases solution
2021-06-16 10:09:26 -04:00
cec24e7446 improve multi-tenancy navigation 2021-06-16 08:30:41 -04:00
05d7c7fc74 Merge pull request #1484 from hishamco/localization-cookie
Fix parsing localization cookie when the value is not present
2021-06-16 08:26:50 -04:00
0d10645d57 Merge pull request #1486 from sbwalker/dev
improve multi-tenancy navigation
2021-06-16 08:26:36 -04:00
1bfe4fbd4f Add missing Oqtane.Server to Databases solutions 2021-06-16 11:55:36 +03:00
c62a4ae8ae Fix parsing localization cookie when the value is not present 2021-06-16 11:02:12 +03:00
4fcfb2ab4e Introduce SharedResource Localisation
Updated the ControlPanel to use Shared resources for;
 Add, Edit, Delete, Cancel

Corrected the SharedResources.cs namespace.
2021-06-16 09:46:33 +02:00
0f208f3c30 Merge pull request #1 from oqtane/dev
merge
2021-06-16 09:19:09 +02:00
65a14da5a9 improve validation and exception handling in API Controllers 2021-06-15 19:11:00 -04:00
53f3245f1d Merge pull request #1482 from sbwalker/dev
improve validation and exception handling in API Controllers
2021-06-15 19:06:52 -04:00
ffbabcfb28 Update README.md 2021-06-15 09:18:17 -04:00
0a2293119e added back missing ITenantManager registration removed in #1245 2021-06-15 08:32:39 -04:00
abd9e2798d Merge pull request #1480 from sbwalker/dev
added back missing ITenantManager registration removed in #1245
2021-06-15 08:28:44 -04:00
f6cc11bd3b add logic removed in #1245 back to HttpClient creation 2021-06-15 08:23:26 -04:00
3e3bf937fd Merge pull request #1479 from sbwalker/dev
add logic removed in #1245 back to HttpClient creation
2021-06-15 08:19:20 -04:00
0fd16fbb59 added Oqtane.Client to _Imports so it can find the new SharedResources class 2021-06-15 07:59:05 -04:00
b2098bb2db Merge pull request #1478 from sbwalker/dev
added Oqtane.Client to _Imports so it can find the new SharedResources class
2021-06-15 07:54:54 -04:00
87c99e2ba7 Merge branch 'oqtane:dev' into dev 2021-06-15 07:46:51 -04:00
4a11524db3 Merge pull request #1245 from hishamco/clean-startup
Clean Startup Class
2021-06-15 07:45:12 -04:00
a9efc2792e Merge pull request #96 from oqtane/dev
sync
2021-06-15 07:42:22 -04:00
9558894a4f moved SharedResources class to proper location 2021-06-15 07:43:12 -04:00
abfb451290 Merge branch 'dev' into dev 2021-06-15 07:42:02 -04:00
e279bca8ad Merge pull request #1476 from leigh-pointer/SharedResource
SharedResources to reside at the project root.
2021-06-15 07:40:27 -04:00
f2b3d6bc5f SharedResources to reside at the project root.
Namespace was changed from Oqtane to Oqtane.Client
2021-06-15 07:09:22 +02:00
28694fc11f added defensive logic to app.razor, relocated shared resource definition in preparation for utilizing shared resources 2021-06-14 17:29:23 -04:00
e99d62d5c7 Merge pull request #1475 from sbwalker/dev
added defensive logic to app.razor, relocated shared resource definition in preparation for utilizing shared resources
2021-06-14 17:25:23 -04:00
216dd39474 Merge branch 'oqtane:dev' into dev 2021-06-13 15:24:05 -04:00
643895b62b add icon for reuse 2021-06-12 09:21:24 -04:00
bd0ee1370c Merge pull request #1471 from sbwalker/dev
add icon for reuse
2021-06-12 09:17:10 -04:00
7c181b65cd Fix merge conflict 2021-06-12 00:18:57 +03:00
bdf36fc49c bug fixes 2021-06-11 17:07:54 -04:00
965b935128 Merge pull request #1470 from sbwalker/dev
bug fixes
2021-06-11 17:03:57 -04:00
126024991c Merge remote-tracking branch 'upstream/dev' into clean-startup
# Conflicts:
#	Oqtane.Client/Program.cs
#	Oqtane.Server/Startup.cs
2021-06-11 23:54:38 +03:00
8f944e29ac set the DefaultDBType as the default database option in the Installer and Add Site UI 2021-06-11 08:43:46 -04:00
7b26ecfec8 Merge pull request #1467 from sbwalker/dev
set the DefaultDBType as the default database option in the Installer and Add Site UI
2021-06-11 08:40:17 -04:00
aa5aca3a8e back out auth policy header support as Blazor HttpClient is registered as Scoped and can not support variable headers 2021-06-11 07:54:02 -04:00
c46ef0fbc4 Merge pull request #1466 from sbwalker/dev
back out auth policy header support as Blazor HttpClient is registered as Scoped and can not support variable headers
2021-06-11 07:50:00 -04:00
d82fc8be90 added IsClickable Page property #1092, improve validation in Role Management, display database information in SQL Management, improve HttpClient header support 2021-06-10 20:10:46 -04:00
a51e7c2b44 Merge pull request #1465 from sbwalker/dev
added IsClickable Page property #1092, improve validation in Role Management, display database information in SQL Management, improve HttpClient header support
2021-06-10 20:06:41 -04:00
52d9c14d78 Update README.md 2021-06-10 13:06:05 -04:00
4bee097e66 fix Site Settings issue 2021-06-10 10:55:59 -04:00
6899a7cbb2 Merge pull request #1464 from sbwalker/dev
fix Site Settings issue
2021-06-10 10:51:49 -04:00
edc0e2a8fe Merge pull request #1462 from albahadly/dev
fix issue: WebAssembly with IDM app
2021-06-10 10:46:52 -04:00
f5f374d2ae #1460 fix issue: WebAssembly with IDM app 2021-06-11 01:06:20 +12:00
ece90c39cb Merge pull request #1461 from sbwalker/dev
refactoring, enhancements, and some fixes
2021-06-10 08:13:35 -04:00
bc720555c4 refactoring, enhancements, and some fixes 2021-06-10 08:16:02 -04:00
25dc6b9b08 when set Runtime as WebAssembly, IDM app recognize oqtane.zip and download this file and this make an issue and oqtane not work correctly and for this I set diffrent extention that IDM cant recognize it 2021-06-09 12:45:31 +12:00
36bd8e4b7f Update README.md 2021-06-07 15:58:04 -04:00
82c05a841f Improve validation and error handling in Controller methods 2021-06-07 15:29:08 -04:00
dd3385c447 Update README.md 2021-06-07 15:25:57 -04:00
93031c9aaa Merge pull request #1457 from sbwalker/dev
Improve validation and error handling in Controller methods
2021-06-07 15:25:04 -04:00
54cd360bb5 allow host to change runtime and rendermode settings in System Info 2021-06-06 11:04:37 -04:00
aa30caa1a7 Merge pull request #1451 from sbwalker/dev
allow host to change runtime and rendermode settings in System Info
2021-06-06 11:00:58 -04:00
900ea8cfbc allow host to view tenant information in Site Settings 2021-06-06 10:36:13 -04:00
cf99f04451 Merge pull request #1450 from sbwalker/dev
allow host to view tenant information in Site Settings
2021-06-06 10:32:21 -04:00
357ef09dd1 new controller auth parameter should take precedence over legacy 2021-06-06 10:03:54 -04:00
42d653969d Merge pull request #1449 from sbwalker/dev
new controller auth parameter should take precedence over legacy
2021-06-06 10:00:09 -04:00
a2b808fde2 use new service auth pattern in module template 2021-06-04 15:01:25 -04:00
33405b9457 Merge pull request #1448 from sbwalker/dev
use new service auth pattern in module template
2021-06-04 14:57:23 -04:00
ffb5ca44ec Merge pull request #1447 from oqtane/master
Merge pull request #1446 from oqtane/dev
2021-06-04 13:05:35 -04:00
3f8a0d4933 Merge pull request #1446 from oqtane/dev
2.1.0 release
2021-06-04 12:56:13 -04:00
970845d640 Merge pull request #1445 from sbwalker/dev
create Public folder during installation
2021-06-04 12:26:42 -04:00
fab06a5279 create Public folder during installation 2021-06-04 12:30:46 -04:00
ff59a12443 UX clarification 2021-06-04 12:18:04 -04:00
b7af8d0d91 Merge pull request #1444 from sbwalker/dev
UX clarification
2021-06-04 12:14:38 -04:00
3401d33a35 Update README.md 2021-06-04 09:32:58 -04:00
69c948ad79 misc site settings UX fixes 2021-06-04 08:42:33 -04:00
07b684d49a Merge pull request #1443 from sbwalker/dev
misc site settings UX fixes
2021-06-04 08:38:51 -04:00
ab3af5f294 use full package name for manifest 2021-06-04 07:30:33 -04:00
aefdcdcd8a Merge pull request #1442 from sbwalker/dev
use full package name for manifest
2021-06-04 07:26:32 -04:00
7b32a16fd8 handle versionless package names in installer 2021-06-03 15:03:11 -04:00
7c7dbfe638 Merge pull request #1440 from sbwalker/dev
handle versionless package names in installer
2021-06-03 14:59:13 -04:00
e527f6e3d1 updater improvements 2021-06-03 11:05:40 -04:00
5f068081f3 Merge pull request #1439 from sbwalker/dev
updater improvements
2021-06-03 11:01:57 -04:00
02de8e0bf7 fix path 2021-06-03 09:01:52 -04:00
f412657987 Merge pull request #1438 from sbwalker/dev
fix path
2021-06-03 08:57:46 -04:00
ec462e2372 Merge pull request #1437 from sbwalker/dev
create all artifacts in Oqtane.Packages folder
2021-06-03 08:56:01 -04:00
0deffff370 create all artifacts in Oqtane.Packages folder 2021-06-03 08:58:45 -04:00
57885f71a7 Revert "create all artifacts in Oqtane.Package folder"
This reverts commit a05a1d6321.
2021-06-03 08:52:51 -04:00
a05a1d6321 create all artifacts in Oqtane.Package folder 2021-06-03 08:52:25 -04:00
060f764da7 separated updater from main solution 2021-06-03 08:37:56 -04:00
ae2caacc81 Merge pull request #1436 from sbwalker/dev
separated updater from main solution
2021-06-03 08:34:02 -04:00
dd9f2e6675 improve System Update user experience 2021-06-02 19:22:20 -04:00
b5a81d8328 Merge pull request #1435 from sbwalker/dev
improve System Update user experience
2021-06-02 19:19:22 -04:00
d1204c7dea Merge pull request #1434 from sbwalker/dev
use secure Packages location for upgrade process
2021-06-02 17:10:44 -04:00
3db12a225b use secure Packages location for upgrade process 2021-06-02 16:53:55 -04:00
912b775553 preserve backward compatibility of CreateAuthorizationPolicyUrl method 2021-06-02 12:20:31 -04:00
25952b53f2 Merge pull request #1433 from sbwalker/dev
preserve backward compatibility of CreateAuthorizationPolicyUrl method
2021-06-02 12:16:31 -04:00
9bccc402a0 use versionless package names for database providers to support future framework upgrades 2021-06-02 08:09:46 -04:00
b44cc06324 Merge pull request #1432 from sbwalker/dev
use versionless package names for database providers to support future framework upgrades
2021-06-02 08:05:48 -04:00
1b4934d623 Merge pull request #1431 from sbwalker/dev
fix issue in theme creator
2021-06-01 15:45:09 -04:00
8dfe8eba27 fix issue in theme creator 2021-06-01 15:49:06 -04:00
56a1c1a57d Update README.md 2021-06-01 14:51:13 -04:00
3c48657e73 version all DLLs and packages consistently and fix all deprecated iconurl warnings 2021-06-01 12:30:21 -04:00
c7442f12e8 Merge pull request #1430 from sbwalker/dev
version all DLLs and packages consistently and fix all deprecated iconurl warnings
2021-06-01 12:26:23 -04:00
c91b8e72c0 fix EF Core version value in upgrade scripts 2021-06-01 10:31:16 -04:00
dc4e3213b1 Merge pull request #1429 from sbwalker/dev
fix EF Core version value in upgrade scripts
2021-06-01 10:27:30 -04:00
5a46d6b842 Merge pull request #1428 from cnurse/dev 2021-05-31 21:50:11 -04:00
c6f4723ee3 Fix for Issue #1420 2021-05-31 15:55:09 -07:00
b76e8498d7 move logic for inserting migrations history from MigrateableModuleBase to MigrationUtils 2021-05-31 16:17:06 -04:00
0347aae140 Merge pull request #1427 from sbwalker/dev
move logic for inserting migrations history from MigrateableModuleBase to MigrationUtils
2021-05-31 16:13:12 -04:00
4576f056d5 Merge pull request #1424 from 2sic-forks/dev
More docs for #1382
2021-05-31 11:56:18 -04:00
879829b9bb Merge pull request #1425 from sbwalker/dev
added metadata support for Module and Theme templates
2021-05-31 11:55:54 -04:00
ddd657bfa7 added metadata support for Module and Theme templates 2021-05-31 11:59:19 -04:00
d52cbf6817 More docs for https://github.com/oqtane/oqtane.framework/issues/1382 - should not affect any code 2021-05-31 15:45:07 +02:00
276817c89d made RenderMode configurable 2021-05-30 15:37:23 -04:00
d8b811e09f Update appsettings.release.json 2021-05-30 15:35:19 -04:00
b21ffc2d63 Update appsettings.json 2021-05-30 15:35:04 -04:00
c402113df3 Merge pull request #1423 from sbwalker/dev
made RenderMode configurable
2021-05-30 15:34:04 -04:00
afcc5e2170 handle HtmlText module transition from SQL scripts to Migrations in module rather than in core framework 2021-05-30 13:16:26 -04:00
5a2ad4f827 Merge pull request #1422 from sbwalker/dev
handle HtmlText module transition from SQL scripts to Migrations in module rather than in core framework
2021-05-30 13:12:27 -04:00
967f0fe626 leave a copy of database provider packages in distribution folder 2021-05-29 17:38:58 -04:00
f8aeef06b2 Merge pull request #1421 from sbwalker/dev
leave a copy of database provider packages in distribution folder
2021-05-29 17:35:03 -04:00
7ed93b5ce6 package installer fix to handle .bak files 2021-05-29 15:13:27 -04:00
89cd0c760a Merge pull request #1418 from sbwalker/dev
package installer fix to handle .bak files
2021-05-29 15:09:29 -04:00
d73e1d21c7 prepare for 2.1.0 release 2021-05-29 13:00:36 -04:00
21ad5f4c1a Merge pull request #1417 from sbwalker/dev
prepare for 2.1.0 release
2021-05-29 12:56:55 -04:00
e84908485f add support for custom "internal" module and theme templates. fix package installer issue related to absolute paths 2021-05-29 11:48:29 -04:00
b05fbae401 Merge pull request #1416 from sbwalker/dev
add support for custom "internal" module and theme templates. fix package installer issue related to absolute paths
2021-05-29 11:44:30 -04:00
54a639d1d5 Module Creator external template changes for 2.1 - supporting mutliple databases, EF Core migrations, and other multi-tenancy improvements 2021-05-28 17:01:25 -04:00
ba61c3318b Merge pull request #1413 from sbwalker/dev
Module Creator external template changes for 2.1 - supporting mutliple databases, EF Core migrations, and other multi-tenancy improvements
2021-05-28 16:57:39 -04:00
8529a42075 fixed upgrade logic 2021-05-28 16:01:11 -04:00
b62a9fa1ff Merge pull request #1412 from sbwalker/dev
fixed upgrade logic
2021-05-28 15:57:16 -04:00
e559a11261 Delete Oqtane.Server/Content/Tenants/1/Sites/1 directory 2021-05-28 08:43:42 -04:00
e878db2f21 Merge pull request #1411 from sbwalker/dev
add new packages location to gitignore
2021-05-28 08:40:12 -04:00
e693f6b52b add new packages location to gitignore 2021-05-28 08:44:14 -04:00
e0c2763c9f refactoring in preparation for release 2021-05-28 07:53:49 -04:00
723ae68609 Merge pull request #1410 from sbwalker/dev
refactoring in preparation for release
2021-05-28 07:49:56 -04:00
9dbfbd78a4 Update README.md 2021-05-27 21:47:04 -04:00
9cd29b62ed Update README.md 2021-05-27 21:46:27 -04:00
4108c07862 moved Packages folder to secure location 2021-05-27 21:39:43 -04:00
01716099d6 Merge pull request #1408 from sbwalker/dev
moved Packages folder to secure location
2021-05-27 21:35:57 -04:00
a144a5c432 improved legacy support for module authorization policy 2021-05-27 21:01:25 -04:00
dbccfe4bf7 Merge pull request #1407 from sbwalker/dev
improved legacy support for module authorization policy
2021-05-27 20:57:46 -04:00
9aff82e504 Update appsettings.release.json 2021-05-27 16:17:09 -04:00
9ff4d9c143 Update appsettings.json 2021-05-27 16:16:48 -04:00
6c8703356f Merge pull request #1406 from sbwalker/dev
automate the 2.1.0 upgrade
2021-05-27 16:15:02 -04:00
fbce6c7248 automate the 2.1.0 upgrade 2021-05-27 16:18:45 -04:00
908d572cc9 Update appsettings.release.json 2021-05-26 17:43:02 -04:00
f0384732ac Update appsettings.json 2021-05-26 17:42:43 -04:00
c089283645 Merge pull request #1405 from sbwalker/dev
move database projects into their own solution to keep the streamline main solution
2021-05-26 17:42:18 -04:00
50ac9236af move database projects into their own solution to keep the streamline main solution 2021-05-26 17:46:08 -04:00
d520d50b75 Update appsettings.release.json
synchronized with appsettings.json
2021-05-26 12:00:49 -04:00
99838679bd Update appsettings.json
reorganized to move most relevant settings to the top of the file
2021-05-26 12:00:15 -04:00
4b49358968 Merge pull request #1404 from sbwalker/dev
add support for public content folders
2021-05-26 11:57:46 -04:00
c07e766e57 add support for public content folders 2021-05-26 12:01:35 -04:00
1d171d2e56 Merge pull request #1400 from 2sic-forks/dev
More documentation - almost all Models done #1382
2021-05-26 07:31:16 -04:00
6527d383db Merge pull request #1401 from cnurse/database-options
Move Available Databases to appsettings and use IOptions
2021-05-26 07:30:34 -04:00
d280a4aa01 Move Available Databases to appsettings and use IOptions 2021-05-25 15:03:27 -07:00
bcff9caf5c More documentation - almost all Models done
https://github.com/oqtane/oqtane.framework/issues/1382
Should not contain any code changes, just docs
2021-05-26 00:01:22 +02:00
bb92011641 Merge pull request #1398 from cnurse/dev
Merge AppVersions Information into __EFMigrationsHistory table
2021-05-25 17:46:19 -04:00
9c0cef870c Merge AppVersions information into EFMigrationsHistory table 2021-05-25 12:17:44 -07:00
077b866e8c Move Migrations into Master and Tenant folders so its clear what type of Migration is being applied 2021-05-25 12:16:10 -07:00
7ec3376308 Merge pull request #1397 from cnurse/dev
Fix Upgrade issue with new componentized Database projects
2021-05-25 07:39:24 -04:00
7753988f64 Remove log files from git 2021-05-24 16:02:45 -07:00
a62a1be1f3 Merge branch 'dev' of https://github.com/cnurse/oqtane.framework into dev
# Conflicts:
#	Oqtane.Server/Infrastructure/DatabaseManager.cs
2021-05-24 15:47:02 -07:00
f2ae1e3bff Merge commit '42265cdda4ea03541522bf5cf5d104059927393f' into dev
# Conflicts:
#	Oqtane.Server/Infrastructure/DatabaseManager.cs
2021-05-24 15:40:35 -07:00
a0838cbc84 3rd attempt to resolve conflicts 2021-05-24 15:14:58 -07:00
17f5f39a54 2nd attempt to Fix conflict 2021-05-24 15:12:41 -07:00
4853a64cf9 Fix conflict 2021-05-24 15:08:44 -07:00
69376c5baf Missing files from previous commit 2021-05-24 14:46:54 -07:00
42265cdda4 Fix Upgrade issue with new componentized Database projects 2021-05-24 14:46:12 -07:00
6283fc9abb Merge pull request #1396 from sbwalker/dev
remove Microsoft.EntityFrameworkCore.Relational from Oqtane.Shared as it is no longer needed
2021-05-24 16:39:33 -04:00
723002968a remove Microsoft.EntityFrameworkCore.Relational from Oqtane.Shared as it is no longer needed 2021-05-24 16:43:17 -04:00
1f7207bd5a Merge pull request #1395 from sbwalker/dev
fix #1272 - add support for ref folder in package installation
2021-05-24 15:51:02 -04:00
72b06b16cf fix #1272 - add support for ref folder in package installation 2021-05-24 15:50:38 -04:00
8c70913a72 Merge pull request #1394 from cnurse/dev
Rename IOqtaneDatabase interface (and related base class)
2021-05-24 15:19:33 -04:00
4a609b444e Rename IOqtaneDatabase interface (and related base class) 2021-05-24 11:57:47 -07:00
791e786db8 Update appsettings.release.json 2021-05-24 09:03:57 -04:00
e5229626ab Update appsettings.json 2021-05-24 09:03:04 -04:00
34ed19deda Merge pull request #1393 from sbwalker/dev
added PackageName property to IModule and ITheme interfaces to allow creators to specify the Nuget package name associated to a specific module/theme. This is necessary for packages which contain multiple extensions.
2021-05-24 08:55:57 -04:00
5c21ab37ee added PackageName property to IModule and ITheme interfaces to allow creators to specify the Nuget package name associated to a specific module/theme. This is necessary for packages which contain multiple extensions. 2021-05-24 08:59:50 -04:00
41ed069072 fix #1389 - exception in PrincipalValidator 2021-05-24 08:17:46 -04:00
80c82a9ec3 Merge pull request #1392 from sbwalker/dev
fix #1389 - exception in PrincipalValidator
2021-05-24 08:14:56 -04:00
d69ceecb41 Merge pull request #1388 from sbwalker/dev
implemented Label component in Installer for consistency and removed redundant logic
2021-05-23 11:13:42 -04:00
63378e1654 implemented Label component in Installer for consistency and removed redundant logic 2021-05-23 11:17:23 -04:00
3f48c1f8fe fix #1367 - provides support for multiple entities in auth policy and makes parameter names more intuitive - backward compatible with entityid 2021-05-23 10:29:05 -04:00
35aaf476d0 Merge pull request #1387 from sbwalker/dev
fix #1367 - provides support for multiple entities in auth policy and makes parameter names more intuitive - backward compatible with entityid
2021-05-23 10:25:17 -04:00
fc3ba14d0f Merge pull request #1385 from 2sic-forks/dev 2021-05-22 08:25:06 -04:00
76879163d4 Merge pull request #1386 from cnurse/dev 2021-05-22 08:21:26 -04:00
342dae4aa7 Fix bug with MySQL Installation caused by new Migration 2021-05-21 16:38:48 -07:00
f533279dec Merge branch 'oqtane:dev' into dev 2021-05-21 18:30:03 +02:00
1bccf449fc Add docs to 2 core interfaces IAliasService and IFileService 2021-05-21 18:29:25 +02:00
de6acf0029 Tell all concrete implementations to be private / not show in the docs 2021-05-21 18:29:06 +02:00
074b998bbc Document most models 2021-05-21 18:28:21 +02:00
e4b12aa87f Document most core interfaces 2021-05-21 18:28:14 +02:00
6f123c0fff Merge pull request #1383 from cnurse/dev
Convert Database projects so they build installable Packages
2021-05-20 17:04:06 -04:00
47c04dc150 Convert Database projects so they build installable Packages rather than deploy to bin and modify installation to deploy Databases on demand as needed. 2021-05-20 12:39:09 -07:00
4474d49c6a Merge pull request #1379 from sbwalker/dev
fix #1359 - Image bug in src attribute - image is not displayed - caused by multi-tenancy refactoring
2021-05-19 13:28:48 -04:00
0b6efdbc57 fix #1359 - Image bug in src attribute - image is not displayed - caused by multi-tenancy refactoring 2021-05-19 13:32:34 -04:00
6f981e0928 revert unnecessary code change in router 2021-05-19 09:15:05 -04:00
bc53c9e443 Merge pull request #1374 from sbwalker/dev
revert unnecessary code change in router
2021-05-19 09:13:06 -04:00
9256c88fc4 update template to remove ASP.NET Core 3 reference 2021-05-19 09:08:59 -04:00
9d877bc072 Merge pull request #1373 from sbwalker/dev
update template to remove ASP.NET Core 3 reference
2021-05-19 09:05:16 -04:00
470c7bb2a9 Merge pull request #1355 from hishamco/folder-columns
Change Folder Name & Path length
2021-05-19 08:50:56 -04:00
bb195e4796 Merge pull request #1357 from hishamco/database-type
Database type name should use type AssemblyQualifiedName instead of magic string
2021-05-19 08:44:12 -04:00
4d59460fbb Merge pull request #1358 from hishamco/unit-tests
Fix broken unit tests
2021-05-19 08:42:59 -04:00
ddc4254053 Merge pull request #1372 from sbwalker/dev
auth improvements related to multi-tenancy
2021-05-19 08:42:50 -04:00
09537ab0e4 auth improvements related to multi-tenancy 2021-05-19 08:46:02 -04:00
07e8215919 Fix broken unit tests 2021-05-16 22:54:34 +03:00
2324ae1ccb Database type name should use type AssemblyQualifiedName instead of maigic string 2021-05-16 22:50:39 +03:00
b3d367329e Fix migration version name 2021-05-16 21:47:34 +03:00
795e71278b Change Folder Name & Path length 2021-05-16 20:28:41 +03:00
943adec3a0 fixes for running on WebAssembly 2021-05-13 07:58:57 -04:00
6e21eb7327 Merge pull request #1347 from sbwalker/dev
fixes for running on WebAssembly
2021-05-13 07:55:31 -04:00
fe3b42feed Merge pull request #1345 from cnurse/dev
Remove DbConfig and new constructors on DbContextBase and refactor Migrations
2021-05-12 20:20:02 -04:00
c036a9d11f Remove DbConfig and new constructors on DbContextBase and refactor Migrations to use explcit generation of IOqtaneDatabase instance 2021-05-12 15:17:40 -07:00
c958f90ee2 Merge pull request #1342 from cnurse/dev
Switch DBType to use the fully-qualified type name rather than a simple name
2021-05-12 14:41:47 -04:00
92dd8354ba Switch DBType to use the fully-qualified type name rather than a simple name 2021-05-12 10:22:17 -07:00
c926fa0d27 Merge pull request #1340 from cnurse/dev 2021-05-11 18:39:40 -04:00
4ffdcf1e52 Remove dependency of Oqtane.Server on SqlClient 2021-05-11 13:56:49 -07:00
efe803f147 Merge branch 'oqtane:dev' into dev 2021-05-11 13:29:23 -07:00
0bd6fea476 Merge pull request #1339 from sbwalker/dev
added DatabaseService to get list of database types from server
2021-05-11 15:53:19 -04:00
bae6120e3b added DatabaseService to get list of database types from server 2021-05-11 15:56:41 -04:00
7c0721797c Update README.md 2021-05-11 09:07:19 -04:00
d88bd87aea add support for Blazor pre-rendering 2021-05-11 09:03:05 -04:00
dab94defa0 Merge pull request #1338 from sbwalker/dev
add support for Blazor pre-rendering
2021-05-11 08:59:39 -04:00
6eaa3d259e Merge pull request #1337 from sbwalker/dev
optimizing tenant resolution and routing
2021-05-11 08:37:44 -04:00
d88b6987a1 Update README.md 2021-05-11 08:35:27 -04:00
b003e3734d Update README.md 2021-05-11 08:33:49 -04:00
a5de639d15 optimizing tenant resolution and routing 2021-05-10 17:45:39 -04:00
75c336454b Merge pull request #1323 from hishamco/tiny-fixes
Few Enhancements in Language Management
2021-05-07 12:17:20 -04:00
15b0bed257 fix #1319 - module title is required 2021-05-07 12:14:54 -04:00
7b15c0a542 Merge pull request #1325 from sbwalker/dev
fix #1319 - module title is required
2021-05-07 12:11:33 -04:00
9f3b6197fe Fix the UX for add a new language 2021-05-07 14:32:41 +03:00
4c4553a1d1 Ability to delete a default language if there's one language alongside with English 2021-05-07 14:10:15 +03:00
c5f65e4767 Fix IsDefault for English 2021-05-07 13:55:45 +03:00
d86beecf5c Add default language by default 2021-05-07 13:43:21 +03:00
be38d2cd70 add upgrade support for language packages 2021-05-06 08:20:09 -04:00
5a511e63ad Merge pull request #1320 from sbwalker/dev
add upgrade support for language packages
2021-05-06 08:16:52 -04:00
38aebf5aff Allow installation of Language packages through Language Management 2021-05-05 19:03:06 -04:00
6625fa7c23 Merge pull request #1318 from sbwalker/dev
Allow installation of Language packages through Language Management
2021-05-05 18:59:46 -04:00
3d5a7fdc21 Merge branch 'dev' of https://github.com/cnurse/oqtane.framework into dev 2021-05-05 10:13:05 -07:00
e836e27a5a fix #1305 - tabpanel loses focus 2021-05-03 08:19:25 -04:00
71e004aca6 Merge pull request #1310 from sbwalker/dev
fix #1305 - tabpanel loses focus
2021-05-03 08:17:59 -04:00
42c4b351f3 Merge pull request #95 from oqtane/dev
sync
2021-05-02 09:21:15 -04:00
3f28282ab6 Merge pull request #1261 from hishamco/sql-server
Move SqlServer databases into a separate project
2021-05-02 09:20:43 -04:00
d83eac5af3 Merge remote-tracking branch 'upstream/dev' into sql-server 2021-05-01 21:36:08 +03:00
4dc364b623 Merge pull request #1304 from leigh-pointer/NuGetPackageIcon
NuGet Icon Warning
2021-04-30 10:55:31 -04:00
d1abbde20c Merge pull request #1303 from leigh-pointer/AddModulePermissions
Permissions for edit applied from the page permissions.
2021-04-30 10:55:22 -04:00
2be48e910e Set module view permissions to page edit permissions 2021-04-30 14:15:56 +02:00
a310ac4ed6 Merge remote-tracking branch 'origin/AddModulePermissions' into AddModulePermissions 2021-04-30 13:53:07 +02:00
bc2e3a7333 Permissions for edit are applied from the page permissions. 2021-04-30 13:52:50 +02:00
9180ceaeb7 Merge pull request #94 from oqtane/dev
sync
2021-04-30 07:36:10 -04:00
b710ac8705 Merge pull request #1301 from leigh-pointer/AddModulePermissions
Permissions for edit are applied from the page permissions.
2021-04-30 07:35:37 -04:00
2244fcc814 Merge pull request #1259 from hishamco/more-localization
Localize Page Template Module Titles
2021-04-30 07:35:21 -04:00
c02e83547b Merge pull request #1302 from leigh-pointer/AddPageWarning
Check now displays warning instead of an Error
2021-04-30 07:32:12 -04:00
14801e7f0d NuGet Icon Warning
The IconURL is depreciate in favor of an embedded icon file in the package
2021-04-30 10:50:12 +02:00
c36cd77ab4 Check now displays warning instead of an Error 2021-04-30 09:49:51 +02:00
9e814fad64 Permissions for edit are applied from the page permissions. 2021-04-30 09:36:50 +02:00
18aa8d48fe Use SharedResources 2021-04-29 02:44:41 +03:00
d7966f2acf Revert changes in SiteRepository 2021-04-29 02:42:01 +03:00
9d3b460a6c Merge branch 'dev' of https://github.com/oqtane/oqtane.framework into dev 2021-04-28 15:14:36 -07:00
7296f94360 Merge remote-tracking branch 'upstream/dev' into dev 2021-04-28 15:08:00 -07:00
9037f49680 Merge pull request #1294 from cnurse/dev
Adding new DatabaseConfig components in the Client project for supported Databases
2021-04-28 15:30:22 -04:00
c759d22b3d Merge pull request #1295 from leigh-pointer/dev
Make container fluid to fill the pane
2021-04-28 15:25:53 -04:00
6ae5777e1c Revert "Fix NuGet Warning NU5048"
This reverts commit cad5ce51fc.
2021-04-28 20:31:52 +02:00
cad5ce51fc Fix NuGet Warning NU5048
Icon URL is deprecated in favor of embedding the icon inside the NuGet package.
2021-04-28 09:17:01 +02:00
a79ba591fe Make container fluid to fill the pane 2021-04-28 07:01:39 +02:00
1efd623a99 Adding new DatabaseConfig components in the Client project for supported Databases to avoid deploying server dlls to client 2021-04-27 15:35:10 -07:00
c32003320d Merge pull request #1284 from iJungleboy/dev
Make version static-readonly
2021-04-27 07:56:28 -04:00
307f97c60c Merge pull request #1281 from hishamco/localization-manager
LocalizationManager enhancements
2021-04-27 07:51:01 -04:00
722c234cb5 Merge pull request #1285 from leigh-pointer/dev.fork
Fix Error with Footer on Oqtane Theme #1282
2021-04-27 07:50:36 -04:00
189dcf5b90 Fix for Error with Footer on Oqtane Theme #1282 2021-04-26 15:38:33 +02:00
a531a235a0 Make version static-readonly
https://github.com/oqtane/oqtane.framework/issues/1283
2021-04-26 13:51:37 +02:00
d7569aa41a Merge pull request #3 from oqtane/dev
Merge with Fork
2021-04-26 11:31:42 +02:00
55b69f0afc Order the cultures alphabatically 2021-04-26 01:55:55 +03:00
76c2a2f2f9 Add English to supported cultures by default 2021-04-26 01:55:27 +03:00
d42c7a5ea5 user and role management improvements 2021-04-24 13:47:20 -04:00
60f386838e Merge pull request #1280 from sbwalker/dev
user and role management improvements
2021-04-24 13:44:22 -04:00
5a519510a9 improve comments and logging 2021-04-23 16:29:18 -04:00
a3449f5beb Merge pull request #1275 from sbwalker/dev
improve comments and logging
2021-04-23 16:26:22 -04:00
ffafe5d14c Merge pull request #93 from oqtane/dev
sync
2021-04-23 16:10:06 -04:00
9d083726be user and role management improvements 2021-04-23 16:11:35 -04:00
310c782326 Merge pull request #1274 from sbwalker/dev
user and role management improvements
2021-04-23 16:09:19 -04:00
65aac34f8c Merge pull request #1267 from sbwalker/dev
modify nuget package installer to support satellite assemblies in subfolders
2021-04-23 09:34:17 -04:00
856b11b574 Merge pull request #1265 from hishamco/language-switcher
Add English to the language switcher
2021-04-23 09:34:01 -04:00
1088e9adda Merge pull request #1264 from hishamco/language-management-exculde
Exclude English from the languages list
2021-04-23 09:33:22 -04:00
7470513892 Merge pull request #2 from oqtane/dev
Updates
2021-04-22 05:49:01 +02:00
2780e4d029 modify nuget package installer to support satellite assemblies in subfolders 2021-04-21 19:31:02 -04:00
c52f6c92f1 Add English to the language switcher 2021-04-21 17:47:50 +03:00
3cafb68f6b Localize module titles in UI 2021-04-21 17:31:22 +03:00
6e5496e969 Exclude English from the languages list 2021-04-21 16:41:24 +03:00
f9f0999315 Merge pull request #1260 from hishamco/supported-cultures
Remove supported cultures entry from appsettings.json
2021-04-20 17:14:21 -04:00
e7c5ca2c1a Merge pull request #1254 from chlupac/alias
Default Alias
2021-04-20 17:07:20 -04:00
d2ffb93fa4 Merge pull request #92 from oqtane/dev
sync
2021-04-20 14:13:41 -04:00
c4680c1972 Merge pull request #1262 from cnurse/dev
Fix bug with installs due to missing Migrations
2021-04-20 14:13:09 -04:00
8f5beaf3fe Fix bug with installs due to missing Migrations 2021-04-20 10:58:26 -07:00
97fb6ede7e Reuse AddOqtaneScopedServices() 2021-04-20 19:10:06 +03:00
f7d8888232 Refactor Program.cs 2021-04-20 19:01:56 +03:00
e7f5fe9827 Merge branch 'database' into clean-startup
# Conflicts:
#	Oqtane.Server/Startup.cs
2021-04-20 17:42:39 +03:00
35225b2bb9 Move SqlServer databases into a separate project 2021-04-20 17:29:24 +03:00
0b32dcf9b3 Make English default culture instead of current installed culture 2021-04-20 16:27:18 +03:00
e33c9e417d Remove SupportedCultures entry from appsettings.json 2021-04-20 16:26:17 +03:00
9d9a5a0275 Localize modules title 2021-04-20 16:20:24 +03:00
8069d838d5 Merge pull request #4 from oqtane/master
sync
2021-04-20 08:50:44 -04:00
a5494be8f1 Merge pull request #1 from oqtane/dev
Update to 2.0.2
2021-04-20 06:44:31 +02:00
bc6be52ae7 Merge pull request #91 from oqtane/dev
sync
2021-04-19 21:13:47 -04:00
40f8436947 Merge pull request #1239 from cnurse/dev
Implement Database Migrations and add Multi-Database Support
2021-04-19 21:11:11 -04:00
13f7db7b19 Resolve conflict 2021-04-19 11:57:45 -07:00
6b204cc988 Second attempt to resolve conflcit in Server project 2021-04-19 11:56:51 -07:00
a11d30b1e4 Attempt to resolve conflict in Server project file 2021-04-19 11:53:45 -07:00
2402cab3f3 Attempt to resolve conflict in DatabaseManager 2021-04-19 11:50:25 -07:00
20b5a10882 Resolve name of variable in AddSite 2021-04-19 11:15:53 -07:00
4598d0d6ba Resolve conflict in AddSite 2021-04-19 11:13:10 -07:00
7516be41d9 Update README.md 2021-04-19 14:10:13 -04:00
74c403cef1 Merge remote-tracking branch 'upstream/dev' into dev 2021-04-19 11:08:35 -07:00
468f186511 Default Alias
When alias is not found in alias table, Oqtane fails with exception. This solution allows define default alias (*) for default site with unknown alias.
2021-04-19 20:03:18 +02:00
5455fadd65 Merge pull request #90 from oqtane/dev
sync
2021-04-19 09:33:34 -04:00
58ac86db8d Merge pull request #1253 from oqtane/master
Merge pull request #1252 from oqtane/dev
2021-04-19 09:28:24 -04:00
d8a65e9422 Merge pull request #1252 from oqtane/dev
2.0.2 release
2021-04-19 09:24:01 -04:00
a85376afb1 2.0.2 release testing 2021-04-19 08:40:58 -04:00
da3b83acf8 Merge pull request #1251 from sbwalker/dev
2.0.2 release testing
2021-04-19 08:38:08 -04:00
0fe931d772 prepare for 2.0.2 release 2021-04-19 08:04:33 -04:00
2c69392f43 Merge pull request #1248 from sbwalker/dev
prepare for 2.0.2 release
2021-04-19 08:01:50 -04:00
3b54d17286 Merge pull request #89 from oqtane/dev
sync
2021-04-18 14:10:17 -04:00
7a3b2e6dfc Merge pull request #1246 from leigh-pointer/dev.fork
Redirect on log out #1225 Fix
2021-04-18 14:07:55 -04:00
82b85ab24d optimize GetSupportedCultures 2021-04-18 11:51:33 -04:00
8899504d05 Merge pull request #1247 from sbwalker/dev
optimize GetSupportedCultures
2021-04-18 11:48:59 -04:00
1e7e2c8848 Redirect on log out #1225 Fix 2021-04-18 16:58:58 +02:00
7417e8dd27 Merge branch 'dev' of https://github.com/oqtane/oqtane.framework into dev 2021-04-18 02:29:39 +03:00
a018e853a8 Register configuration in startup 2021-04-18 02:27:31 +03:00
73b13d7a54 Add Oqtane extension methods for clean startup 2021-04-18 02:25:40 +03:00
cbe843bafc User experience improvements 2021-04-17 19:18:24 -04:00
8dac6fab54 Merge pull request #1244 from sbwalker/dev
User experience improvements
2021-04-17 19:16:13 -04:00
096f8249c3 Resolve conflict in Constants 2021-04-14 16:05:59 -07:00
e11a65c6ca Rollback removal of script files for Html Module to resolve conflict 2021-04-14 16:03:00 -07:00
23bab67bd3 Resolve new conflict 2021-04-14 15:59:31 -07:00
713b19e0e9 Remove Html Module Script files 2021-04-14 15:57:07 -07:00
f8b607911d Resolve conflict in project file 2021-04-14 15:53:07 -07:00
0222bbdeae Resolve conflict with main Oqtane repo 2021-04-14 15:48:54 -07:00
a0329b1b6c Fix bug in new Migration to support PostgreSQL 2021-04-08 14:58:02 -07:00
8c45b7e42f Added support for migrating existing Oqtane installations from DbUp to Migrations. Also added a Migration for version 2.0.2, and set current version to 2.1.0 2021-04-08 12:20:21 -07:00
1d3a79437c add theme creator module to simplify the scaffolding of external themes 2021-04-07 13:05:18 -04:00
947c254e12 Merge pull request #1230 from sbwalker/dev
add theme creator modules to simplify the scaffolding of external themes
2021-04-07 13:03:04 -04:00
d05747af1e enhanced ModuleActions component to display panes in a submenu, added more containers to Oqtane theme, added more panes to MultiPane layout, added module outline in edit mode to distinguish modules in panes, consolidated to use a single default AdminPane named "Content", fixed bug related to custom Admin Container behavior 2021-04-06 17:45:11 -04:00
0bf85a7a14 Merge pull request #1228 from sbwalker/dev
enhanced ModuleActions component to display panes in a submenu, added more containers to Oqtane theme, added more panes to MultiPane layout, added module outline in edit mode to distinguish modules in panes, consolidated to use a single default AdminPane named "Content", fixed bug related to custom Admin Container behavior
2021-04-06 17:42:43 -04:00
6b90e0f37b fix #1197 - move folder path logic from Client Service to Server Controller 2021-04-05 08:53:22 -04:00
224f0c3ceb Merge pull request #1227 from sbwalker/dev
fix #1197 - move folder path logic from Client Service to Server Controller
2021-04-05 08:52:29 -04:00
fc145a167d organize theme components into folders 2021-04-03 19:46:29 -04:00
6354c9ebd0 Merge pull request #1226 from sbwalker/dev
organize theme components into folders
2021-04-03 19:43:49 -04:00
61b73060e5 login form validation 2021-04-02 16:14:02 -04:00
b5c1184fa4 Merge pull request #1224 from sbwalker/dev
login form validation
2021-04-02 16:11:38 -04:00
d12b18350f Fixed bug in AddSite due to missing assignment of database type 2021-04-02 11:49:38 -07:00
985987d8f4 Updated initial appsettings.json 2021-04-02 11:28:34 -07:00
e6530ee127 Added support for MySQL and ProgreSQL and AddSite/Tenant 2021-04-02 10:55:00 -07:00
6606ebb58a Merge pull request #88 from oqtane/dev
sync
2021-04-02 13:19:36 -04:00
14480edd67 added globally unique identifier for Site ( used string data type to ensure compatibility with multiple database engines ) 2021-04-02 12:30:20 -04:00
d990a9fc30 Merge pull request #1221 from sbwalker/dev
added globally unique identifier for Site ( used string data type to ensure compatibility with multiple database engines )
2021-04-02 12:27:43 -04:00
00f8f2cb89 fix #1211 - add message to indicate Module Creator is only intended for use in development environments 2021-04-02 08:37:37 -04:00
57575945cd Merge pull request #1219 from sbwalker/dev
fix #1211 - add message to indicate Module Creator is only intended for use in development environments
2021-04-02 08:35:04 -04:00
9995066628 Merge pull request #1216 from leigh-pointer/dev.fork
Added Keypress event to catch Enter key on Login page #1198
2021-04-02 08:20:42 -04:00
c794f77d65 fix #1217 - ensure parent page cannot be set to current page 2021-04-02 08:19:55 -04:00
6d443842b2 Merge pull request #1218 from sbwalker/dev
fix #1217 - ensure parent page cannot be set to current page
2021-04-02 08:17:17 -04:00
60a1f4ed15 Added functionality, when the EnterKey is press the login command is run. 2021-04-02 07:01:27 +02:00
59e5eabeb8 Merge pull request #3 from oqtane/dev
Pull from oqtane.dev
2021-04-02 06:43:44 +02:00
8da55e1926 Merge pull request #3 from oqtane/dev
sync
2021-04-01 19:31:21 -04:00
af5f79d343 fix dropdown list UX behavior where there is a default option 2021-04-01 17:58:59 -04:00
39d0afa321 Merge pull request #1215 from sbwalker/dev
fix dropdown list UX behavior where there is a default option
2021-04-01 17:56:29 -04:00
0a7fe5d82e Merge pull request #2 from oqtane/dev
Pull from source
2021-04-01 16:45:16 +02:00
58c84da9c9 add ability to test SMTP connection in Site Settings 2021-04-01 09:44:07 -04:00
46219df6b6 Merge pull request #1213 from sbwalker/dev
add ability to test SMTP connection in Site Settings
2021-04-01 09:41:45 -04:00
49f21e235b Merge pull request #87 from oqtane/dev
sync
2021-03-31 15:37:15 -04:00
bd48e1d8f1 if running on WebAssembly reload the client application if the server application is restarted 2021-03-31 15:39:01 -04:00
710d1be64b Merge pull request #1212 from sbwalker/dev
if running on WebAssembly reload the client application if the server application is restarted
2021-03-31 15:36:32 -04:00
bde1ff44f8 Merge pull request #1206 from hishamco/localizer
Fix localizer in Admin pages
2021-03-31 10:16:53 -04:00
c92a81fcb6 Remove unnecessary localizer from RecycleBin page 2021-03-31 14:15:36 +03:00
ec0b317f80 Fix localizer in Admin pages 2021-03-31 00:50:19 +03:00
09c040128a Ensure Install Wizard will only be displayed if the Master database connection string in appsettings.json is not specified. This addresses a potential security issue where the Install Wizard could be displayed in an existing installation if the Master database connection failed during startup. 2021-03-30 17:48:49 -04:00
c037614917 Merge pull request #1205 from sbwalker/dev
Ensure Install Wizard will only be displayed if the Master database connection string in appsettings.json is not specified. This addresses a potential security issue where the Install Wizard could be displayed in an existing installation if the Master database connection failed during startup.
2021-03-30 17:46:42 -04:00
3c5e7f997b Merge pull request #1204 from hishamco/typo
thene -> theme
2021-03-30 15:50:56 -04:00
367a23171d thene -> theme 2021-03-30 17:26:03 +03:00
0e20cad2d1 Merge pull request #1 from oqtane/dev
pull from source dev
2021-03-30 16:22:55 +02:00
5cd1d3a7af Merge pull request #86 from oqtane/dev
sync
2021-03-30 10:05:35 -04:00
62362b9194 make module creator templates extensible 2021-03-30 10:06:25 -04:00
40501c6ebd Merge pull request #1202 from hishamco/resources
Add Resources folder to Oqtane.Client
2021-03-30 10:04:38 -04:00
82b8c86fe3 Merge pull request #1203 from sbwalker/dev
make module creator templates extensible
2021-03-30 10:03:56 -04:00
40f9437ea5 Add Resources folder to Oqtane.Client 2021-03-29 20:15:04 +03:00
d8bcc32239 refactor user deletion 2021-03-29 12:58:40 -04:00
77694da100 Merge pull request #1201 from sbwalker/dev
refactor user deletion
2021-03-29 12:56:18 -04:00
2fb63e8117 Added suuport to inject an IOqtaneDatabase in EntityBuilders to allow each Database to control certain Migration behaviors. Also updated Installer to dynamically build Database Configuration section 2021-03-27 11:16:16 -07:00
7223952eb2 Merge pull request #85 from oqtane/dev
sync
2021-03-25 13:49:47 -04:00
1271064872 Merge pull request #1178 from Raceeend/user-delete
fix: user delete
2021-03-25 13:49:11 -04:00
095d2e5f45 Merge pull request #1188 from erw13n/dev
Remove admin border after edit
2021-03-25 08:33:06 -04:00
4152b5c360 Merge pull request #1177 from hishamco/profile
Delete profile should refresh profiles list
2021-03-25 08:12:53 -04:00
3a032f401a Added IDatabase interface and refactored to use it to handle database type - updated Installer to dynamically add databases to selector 2021-03-24 11:45:44 -07:00
cbcfc88492 Add support for Sqlite - Installation path tested but AddSite not supported yet 2021-03-23 11:06:18 -07:00
8f1c760e87 Updated the Installation of Oqtane to use Migrations 2021-03-21 14:52:45 -07:00
83e5502111 Creation of EF Core Migrations - these execute using EF Tools, but are not integrated to run programmatically 2021-03-19 17:01:49 -07:00
63140bce81 Remove admin border after edit
After finish Edit, there's a class "container" which is conflict with Bootstrap that cause an issue on Full-width pane.
2021-03-17 19:26:50 +07:00
c527f28a6d Address feedback 2021-03-13 17:02:24 +03:00
801615c981 fix: user delete 2021-03-13 12:34:47 +01:00
c5e3c9b35e Delete profile should refresh profiles list 2021-03-13 13:02:40 +03:00
86ce8994d9 fix #1156 add defensive coding for scenario where host name does not match any alias 2021-03-11 20:21:15 -05:00
51687c382d Merge pull request #1174 from sbwalker/dev
fix #1156 add defensive coding for scenario where host name does not match any alias
2021-03-11 20:19:07 -05:00
6d3e17a5f5 Fix Pager component issue which manifested itself in Event Log. This reverts a fix from #1160 and addresses the root problem. 2021-03-11 11:21:47 -05:00
32eaa90e5e Merge pull request #1171 from sbwalker/dev
Fix Pager component issue which manifested itself in Event Log. This reverts a fix from #1160 and addresses the root problem.
2021-03-11 11:19:58 -05:00
ed12194ea2 Merge pull request #84 from oqtane/dev
sync
2021-03-10 17:01:33 -05:00
6bde83fab1 Merge pull request #1163 from leigh-pointer/dev
Issue with menu Icon Spacing. #1160
2021-03-10 17:00:08 -05:00
b58c7386b3 Fixed issue Event Log strange behavior with the Paging control #1158 2021-03-10 17:00:49 +01:00
3ff1dc4a21 MenuItems updated with HTML markup in place of the FontIcon component 2021-03-09 17:16:25 +01:00
78aabaafb3 Merge pull request #11 from oqtane/dev
Merge from source
2021-03-09 15:50:08 +01:00
81b76f03ee Add folder structure to external module template client project to organize code and emphasize that a module project can contain multiple modules. 2021-03-09 09:47:01 -05:00
c9fa022279 Merge pull request #1161 from hishamco/fix#1152
Rows -> Maximum Records
2021-03-09 09:46:35 -05:00
7e4a37b07c Merge pull request #1168 from cnurse/dev
Create new UseOqtaneDatabase extension method
2021-03-09 09:46:14 -05:00
642bafb2fc Merge pull request #1170 from sbwalker/dev
Add folder structure to external module template client project to organize code and emphasize that a module project can contain multiple modules.
2021-03-09 09:46:05 -05:00
7f1f4ec4fb Rows -> Records 2021-03-08 20:57:06 +03:00
c64f350f36 Create new DbContextUtils class and move common SaveChanges code to this class. While MasterDbContext has no entities that support IDeletable it does not hurt to check and minimizes duplication 2021-03-06 16:06:29 -08:00
8376a09ad6 Create new UseOqtaneDatabase extension method and replace all uses of UseSqlServer.
This is a preparative step to locate all database configuration in one file.
2021-03-06 14:13:06 -08:00
13b45453c6 Fixed Issue with menu Icon Spacing. #1160 2021-03-05 15:31:38 +01:00
4c9960b983 Rows -> Maximum Rows 2021-03-05 16:41:53 +03:00
541bd5a279 Merge pull request #10 from oqtane/dev
Merge
2021-03-05 06:32:14 +01:00
745575c1f1 Fix UX issue where the Location field was not being updated when the user selected Create Module 2021-03-04 08:30:09 -05:00
af896e0fa8 Merge pull request #1155 from sbwalker/dev
Fix UX issue where the Location field was not being updated when the user selected Create Module
2021-03-04 08:29:54 -05:00
ab102f1883 Merge pull request #1154 from leigh-pointer/dev
Delete all Modules and Pages from Recycle bin
2021-03-04 08:29:45 -05:00
04caa8f725 Merge pull request #1151 from cnurse/dev
Add gitignore and README to Solution files and ad support for Jetbrains Rider
2021-03-04 08:28:23 -05:00
63fc1cd042 Update Index.razor 2021-03-03 17:15:00 +01:00
442a8018ce Merge branch 'dev' of https://github.com/leigh-pointer/oqtane.framework into dev 2021-03-03 17:07:04 +01:00
0fd46d28b5 Delete all modules and pages in recycle bin 2021-03-03 16:55:13 +01:00
a03434ac41 recycle bin and log paging 2021-03-03 16:39:32 +01:00
b08fdf8690 Merge branch 'dev' of https://github.com/leigh-pointer/oqtane.framework into dev 2021-03-03 13:26:01 +01:00
7205246718 Added Delete all pages and modules 2021-03-03 13:25:49 +01:00
a4f0afa0ab Merge branch 'master' into dev 2021-03-02 12:14:41 -08:00
dbc4e3ea66 Add the Jetbrains Rider "idea" folder to gitignore. 2021-03-02 12:07:04 -08:00
0d5ecb7427 Include gitignore and README files in Solution Files folder, so they are more accessible for editing 2021-03-02 12:03:26 -08:00
e1b04f5dae Merge pull request #9 from oqtane/dev
Merge pull request #1149 from leigh-pointer/dev
2021-03-02 16:52:28 +01:00
ea1bcba32f Merge pull request #1149 from leigh-pointer/dev
Fix for #1148 LangVersion set to 7.3
2021-03-02 10:48:13 -05:00
cccb0806e1 LangVersion Fix #1148
removed the LangVersion property from project
2021-03-02 16:17:33 +01:00
92a1804846 Merge pull request #8 from oqtane/dev
2.0.1
2021-02-28 08:29:21 +01:00
191a1dea4d Update README.md 2021-02-27 12:50:36 -05:00
be782ee001 Merge pull request #1143 from oqtane/master
sync with master
2021-02-27 12:34:28 -05:00
0d6413e8a5 Merge pull request #1142 from oqtane/dev
merge dev with master for 2.0.1 release
2021-02-27 12:32:37 -05:00
d69a392141 Merge pull request #7 from oqtane/dev
Commits on Feb 25,26,  2021
2021-02-26 15:49:06 +01:00
12fd845ed5 Fix issue when creating assets.json and folder does not exist. Improve module/theme uninstall to remove empty folders. 2021-02-26 09:08:25 -05:00
0eae1b690e Merge pull request #1139 from sbwalker/dev
Fix issue when creating assets.json and folder does not exist. Improve module/theme uninstall to remove empty folders.
2021-02-26 09:06:49 -05:00
5b9196cfd4 Update README.md 2021-02-26 08:05:36 -05:00
ba54076c61 Prepare for 2.0.1 release 2021-02-26 08:04:44 -05:00
8762809a83 Update README.md 2021-02-26 08:04:39 -05:00
c65bc1f4b1 Merge pull request #1138 from sbwalker/dev
Prepare for 2.0.1 release
2021-02-26 08:02:59 -05:00
99665800c4 remove SVG from allowable upload files 2021-02-26 07:48:16 -05:00
127a9c8deb Merge pull request #1137 from sbwalker/dev
remove SVG from allowable upload files
2021-02-26 07:46:35 -05:00
af1eebbf0d update copyright content 2021-02-26 07:45:10 -05:00
e5272d9725 Merge pull request #1136 from sbwalker/dev
update copyright content
2021-02-26 07:43:43 -05:00
4a2d3e452a Merge pull request #83 from oqtane/dev
sync
2021-02-25 14:27:51 -05:00
579992d8f2 Merge pull request #6 from oqtane/dev
Merge pull request #1135 from leigh-pointer/dev
2021-02-25 15:49:43 +01:00
dbecfc1c9f Merge pull request #1135 from leigh-pointer/dev
Fix for #1134 Files size incorrect when less than 1000 bytes
2021-02-25 08:31:29 -05:00
6c79006dd7 fix for #1134 Files size incorrect when less than 1000 bytes 2021-02-25 07:44:19 +01:00
53af3f2a14 Merge pull request #5 from oqtane/dev
Commits 19, 24 Feb
2021-02-25 06:54:59 +01:00
385ec178eb Merge pull request #1132 from oqtane/revert-1121-dev
Revert "Fix Upload SVG throw error #1120"
2021-02-24 17:27:20 -05:00
eda2a5637f Revert "Fix Upload SVG throw error #1120" 2021-02-24 17:26:54 -05:00
f60c60ac1d Merge pull request #1121 from leigh-pointer/dev
Fix Upload SVG throw error #1120
2021-02-24 17:22:23 -05:00
75a5262259 Merge pull request #1124 from PhilipMur/dev
Fixed site Favicon not saving
2021-02-24 17:22:02 -05:00
12b44f6fa5 Merge pull request #2 from oqtane/dev
sync
2021-02-23 18:50:55 -05:00
60d685416d Fixed site Favicon not saving
The saved function for the favicon was not there
2021-02-19 13:09:29 +00:00
b04cee22cd Merge branch 'dev' of https://github.com/leigh-pointer/oqtane.framework into dev 2021-02-18 09:27:57 +01:00
3af095997f Fixed when file size is less that 1 Kb displays 0. This can be misleading as many svg files are less that 1 kb. File size now displays to 2 deciaml places. 2021-02-18 09:27:51 +01:00
1aae8a1373 Update FileController.cs 2021-02-18 08:55:13 +01:00
bd762cb5c9 stream not needed 2021-02-18 08:52:57 +01:00
59ba4b2e05 doesnt need to open the stream if svg 2021-02-18 08:51:05 +01:00
45974a9c80 Update FileController.cs 2021-02-18 08:48:33 +01:00
9411f9a62e Merge branch 'dev' of https://github.com/leigh-pointer/oqtane.framework into dev 2021-02-18 08:39:18 +01:00
e3fc7c0ad1 #1120 Fix forUpload SVG throw error 2021-02-18 08:38:53 +01:00
a60859ba19 Merge pull request #4 from oqtane/dev
Login changes and log out path
2021-02-17 06:52:57 +01:00
eef26d02d3 Merge pull request #4 from oqtane/dev
Login changes
2021-02-17 06:46:35 +01:00
b7ce7bb3e4 Improve Login user experience when running on WebAssembly and address Logout scenario 2021-02-16 08:11:36 -05:00
e7b65aad19 Merge pull request #1114 from sbwalker/dev
Improve Login user experience when running on WebAssembly and address Logout scenario
2021-02-16 08:10:19 -05:00
cd89b2bf7b Merge pull request #82 from oqtane/dev
sync
2021-02-16 06:42:56 -05:00
8cd355135b Merge pull request #1 from oqtane/dev
sync
2021-02-15 13:49:36 -05:00
4b3c488fb9 Merge pull request #3 from oqtane/dev
WebAssembly startup issue
2021-02-15 17:30:38 +01:00
9e8c574fb5 fix #1103 reported by @PhilipMur - incorrect life cycle method for Control Panel loading 2021-02-15 10:38:38 -05:00
dfa74f7eb6 Merge pull request #1111 from hishamco/lang-version
Remove LangVerion from Oqtane.Server
2021-02-15 10:37:58 -05:00
2b92dd51a1 Merge pull request #1112 from sbwalker/dev
fix #1103 reported by @PhilipMur - incorrect life cycle method for Control Panel loading
2021-02-15 10:37:27 -05:00
a47aa28c89 Merge pull request #2 from oqtane/dev
Section head and Languages
2021-02-15 05:49:29 +01:00
510f475816 Remove LangVerion from Oqtane.Server 2021-02-15 03:27:47 +03:00
de1107f046 Unauthenticated users need to be able to retrieve the list of languages 2021-02-14 18:35:42 -05:00
0f640dd68b Merge pull request #1110 from sbwalker/dev
Unauthenticated users need to be able to retrieve the list of languages
2021-02-14 18:34:33 -05:00
a50363fec7 Merge pull request #1107 from leigh-pointer/dev
#1106 Fix issue where Section would not initialize Expanded.
2021-02-14 15:03:09 -05:00
22c6ccffb8 Merge pull request #1 from oqtane/dev
Merge from base
2021-02-13 07:53:23 +01:00
fcd795be3d #1106 Fix issue where Section would not initialize collapsed. 2021-02-13 07:33:12 +01:00
6adda2b1a9 Merge pull request #1102 from leigh-pointer/dev
DirectorySeparator issue when black or forward slash.
2021-02-12 10:30:15 -05:00
0af8f427e1 Merge pull request #1101 from 2sic-forks/dev
fix typo memeber = member
2021-02-12 10:29:22 -05:00
c6e2c2e501 DirectorySeparator issue when black or forward slash.
Tested on Apple mac and Windows
2021-02-11 15:38:37 +01:00
278aab537f fix typo memeber = member 2021-02-11 10:41:43 +01:00
2fc877a99e fix #1097 - made PWA manifest Urls absolute rather than relative 2021-02-10 14:50:06 -05:00
22830a2cc1 Merge pull request #1098 from sbwalker/dev
fix #1097 - made PWA manifest Urls absolute rather than relative
2021-02-10 14:49:35 -05:00
478e4044b8 Fix #1094 - localization fallback logic 2021-02-08 08:17:13 -05:00
1fcb2ee2b3 Merge pull request #1096 from sbwalker/dev
Fix #1094 - localization fallback logic
2021-02-08 08:15:58 -05:00
05a98a9854 Merge pull request #81 from oqtane/dev
sync
2021-02-08 07:58:37 -05:00
00893459b2 Merge pull request #1095 from hishamco/localization-manager
Fix the localization manager resolution
2021-02-06 16:53:50 -05:00
7db1fe226d Fix the localization manager resolution 2021-02-06 22:40:11 +03:00
d0f3d388fe Merge pull request #1071 from hishamco/default-language-fix
Set default language if the culture not supported
2021-02-05 14:29:42 -05:00
13e356f510 Use LocalizationManager.GetDefaultCulture() 2021-02-05 21:47:50 +03:00
c3e7fa67f3 Performance improvement - set IsFixed="true" on ModuleState CascadingValues so that Blazor will not monitor them for changes 2021-02-05 09:37:10 -05:00
91be2ff4a0 Merge pull request #1090 from sbwalker/dev
Performance improvement - set IsFixed="true" on ModuleState CascadingValues so that Blazor will not monitor them for changes
2021-02-05 09:36:17 -05:00
3f29fd1b9f Merge remote-tracking branch 'upstream/dev' into default-language-fix 2021-02-05 15:35:52 +03:00
988639b603 module creator owner and module name cannot be the same 2021-02-04 09:36:19 -05:00
170289cc8e Merge pull request #1089 from sbwalker/dev
module creator owner and module name cannot be the same
2021-02-04 09:35:15 -05:00
077c40ee05 Merge pull request #1088 from sbwalker/dev
performance and user experience improvements
2021-02-04 08:55:51 -05:00
531cba715e performance and user experience improvements 2021-02-04 08:54:59 -05:00
1fb58296d8 Merge pull request #80 from oqtane/dev
sync
2021-02-01 14:40:42 -05:00
9ba2328a04 Merge pull request #1074 from Jayson-Furr/dev
Fixes to horizontal menu logic. Now supports two levels of menu items.
2021-01-28 09:02:49 -05:00
901d4ca5c4 Merge pull request #1070 from hishamco/default-language
Reset IsDefault per site Id for newly added language
2021-01-26 09:57:10 -05:00
033ee0497b Merge branch 'dev' of https://github.com/Jayson-Furr/oqtane.framework into dev 2021-01-23 21:16:27 -06:00
5a02ce6124 Fixes to vertical menu logic. Now supports multiple levels of menu items. Added FontIcon component to reduce duplicate code. 2021-01-23 21:15:54 -06:00
f60a4af6d2 Fixes to horizontal menu logic. Now supports multiple levels of menu items. Added FontIcon component to reduce duplicate code. 2021-01-23 21:14:44 -06:00
6fdbbeb8ce Fixes to horizontal menu logic. Now supports two levels of menu items. 2021-01-23 18:24:07 -06:00
90ca6aafe9 Set default language if the culture not supported 2021-01-24 01:06:50 +03:00
5a660f2634 Reset IsDefault per site Id for new language 2021-01-23 23:48:10 +03:00
7057f93f13 Merge pull request #1069 from sbwalker/dev
added HTML5 date picker to input controls
2021-01-22 14:21:41 -05:00
f637c9137c added HTML5 date picker to input controls 2021-01-22 14:19:43 -05:00
fbf2820571 Merge pull request #1067 from sbwalker/dev
Localization fixes - table definition, SQL script naming, SQL script not marked as Embedded Resource, changed column name from IsCurrrent to IsDefault to reflect intent, set default language for site in _Host
2021-01-22 13:01:37 -05:00
c0ed7c7934 Localization fixes - table definition, SQL script naming, SQL script not marked as Embedded Resource, changed column name from IsCurrrent to IsDefault to reflect intent, set default language for site in _Host 2021-01-21 17:09:34 -05:00
892d9c1ecf Merge pull request #1065 from sbwalker/dev
notification improvements
2021-01-18 14:41:52 -05:00
82a118b603 notification improvements 2021-01-18 14:39:56 -05:00
fc8f200c32 Merge pull request #79 from oqtane/dev
sync
2021-01-18 10:21:04 -05:00
b664bc2dbb remove Add Job component and make Type read-only in Edit 2021-01-18 10:19:42 -05:00
350d2cec96 Merge pull request #1061 from sbwalker/dev
set SiteState in HostedServiceBase for scheduled jobs
2021-01-18 10:18:47 -05:00
8be9fd6eb2 set SiteState in HostedServiceBase for scheduled jobs 2021-01-18 08:59:07 -05:00
b4aec286ed Merge pull request #1045 from hishamco/language-management
Add Languages Management
2021-01-18 08:30:31 -05:00
6a4fd26787 Merge pull request #1059 from sbwalker/dev
auto registration of scheduled jobs
2021-01-18 08:30:14 -05:00
a2029a3ca3 auto registration of scheduled jobs 2021-01-17 11:46:09 -05:00
bc0ba92303 Revert the changes in the LanguageController 2021-01-15 01:35:53 +03:00
e938d4f801 Add Admins role 2021-01-15 00:28:59 +03:00
54ff8eced1 Fix the relationship 2021-01-13 23:41:08 +03:00
a2943d083b Set culture when added language set to current 2021-01-13 18:43:26 +03:00
b3152ee3e5 LanguageSwitcher should have the cultures from language management 2021-01-13 18:26:36 +03:00
c5ae8c979b Cultures should come from supported cultures 2021-01-13 18:19:56 +03:00
4fd49ab028 Merge pull request #1046 from chlupac/ContentUrl
Add missing ContentUrl method
2021-01-12 09:41:38 -05:00
edbdfe454e Merge pull request #1047 from chlupac/GetPath
Introduce GetFolderPath and GetFilePath repository methods
2021-01-12 09:41:09 -05:00
f1a1a21d74 Introduce GetFolderPath and GetFilePath repository methods 2021-01-11 16:32:13 +01:00
1dcb14811d Add missing ContentUrl method 2021-01-11 16:31:37 +01:00
932c5590af Make sure one language is set to current 2021-01-11 00:11:30 +03:00
3a8fc428a6 Use TriaStateCheckBox for language IsCurrent 2021-01-11 00:04:43 +03:00
7d090e51a1 Add language page 2021-01-10 23:51:15 +03:00
128729d4a0 TenantId -> SiteId 2021-01-10 23:50:34 +03:00
70595eb90a Fix Language table 2021-01-10 23:50:21 +03:00
8ab511fda7 Return empty list if languages list are null 2021-01-10 23:17:35 +03:00
91a844c910 Add language management page template 2021-01-10 23:17:03 +03:00
21e09d95da Add migration script 2021-01-10 21:32:25 +03:00
9b4316d6cd Fix errors 2021-01-10 21:32:11 +03:00
3059e8c763 Add language service 2021-01-10 20:17:35 +03:00
aa19a35834 Add language repository & controller 2021-01-10 20:09:04 +03:00
1276c0269e add SMTP sender email 2021-01-07 15:06:48 -05:00
047fa9ac4e Merge pull request #1044 from sbwalker/dev
add SMTP sender email
2021-01-07 15:06:21 -05:00
b8fb230a0e Merge pull request #78 from oqtane/dev
sync with upstream
2021-01-05 17:12:40 -05:00
289c71d36f Merge pull request #1041 from sbwalker/dev
support for shared razor class library static resources in external module template
2021-01-05 17:11:52 -05:00
e3e5f782aa support for shared razor class library static resources in external module template 2021-01-05 17:11:45 -05:00
778f9cb356 added better validaton and user feedback related to SMTP configuration 2021-01-05 16:57:36 -05:00
767431fdab Merge pull request #1040 from sbwalker/dev
added better validaton and user feedback related to SMTP configuration
2021-01-05 16:57:03 -05:00
27f24160e4 Merge pull request #1039 from sbwalker/dev
fix navigation usability issue for shared add/edit page UI invoked by Control Panel and Page Management
2021-01-05 14:48:44 -05:00
1979a6dc4b Merge pull request #1021 from chlupac/UpdateSettings
Settings Fix
2021-01-05 14:47:46 -05:00
de25e3fbf1 fix navigation usability issue for shared add/edit page UI invoked by Control Panel and Page Management 2021-01-05 14:47:09 -05:00
91c5ff7b00 UpdateSettings bugfix
ISettingControl introduction
2021-01-05 19:52:14 +01:00
78f36c9f95 Merge pull request #1038 from sbwalker/dev
fixed issue with Sql Management and System Info missing icons after new installation
2021-01-05 09:00:55 -05:00
fb258805d0 Merge pull request #1037 from hishamco/resources
Fix ResourceKey property
2021-01-05 09:00:43 -05:00
a61a2f748c fixed issue with Sql Management and System Info missing icons after new installation 2021-01-05 09:00:42 -05:00
c82d6de40e Merge pull request #1033 from hishamco/list-entries-order
Order users by display name
2021-01-05 09:00:32 -05:00
c86a8cbd2d Fix ResourceKey property 2021-01-05 03:02:02 +03:00
b8622e5943 Order users by display name 2021-01-03 14:02:48 +03:00
98eff1f84e Merge pull request #77 from oqtane/dev
sync
2021-01-02 15:03:25 -05:00
a9a66155e2 Merge pull request #981 from hishamco/readme
Update README.md
2021-01-02 14:07:47 -05:00
9f829e3100 Merge pull request #1032 from sbwalker/dev
fix script order
2021-01-02 14:07:21 -05:00
ab2a317728 Merge pull request #1028 from hishamco/localization
Make external module localize ready
2021-01-02 14:07:05 -05:00
7d84f156f1 Merge pull request #1025 from hishamco/language-switcher
Show LanguageSwitcher if more than one culture
2021-01-02 14:06:34 -05:00
35d1adae99 fix script order 2021-01-02 13:26:36 -05:00
18b528c1af Merge pull request #76 from oqtane/dev
Merge pull request #1009 from sbwalker/dev
2021-01-02 13:22:51 -05:00
842442d27d Make external module localize ready 2021-01-01 00:19:58 +03:00
56e86edf9f Address feedback 2020-12-28 19:59:58 +03:00
f05b955c34 Show LanguageSwitcher if more than one culture 2020-12-28 18:15:28 +03:00
8ab01228ed Merge pull request #1009 from sbwalker/dev
allow developers to use custom icon libraries (Open Iconic is the default)
2020-12-22 08:37:43 -05:00
df382ce7a3 allow developers to use custom icon libraries (Open Iconic is the default) 2020-12-22 08:37:33 -05:00
05b0b74578 Merge pull request #75 from oqtane/dev
sync
2020-12-15 15:25:29 -05:00
3f8b9ef0c5 Merge pull request #997 from chlupac/content-disposition
FileController - content disposition
2020-12-15 09:02:12 -05:00
9d658e9166 Merge pull request #1001 from hishamco/revert-log-localization
Revert LogManager localization changes
2020-12-15 08:56:16 -05:00
07711c082e FileController - content disposition 2020-12-15 11:06:52 +01:00
eec680a151 Revert LogManager localization changes 2020-12-15 00:22:33 +03:00
deaaa74fc8 Update README.md 2020-12-14 08:52:01 -05:00
5dcfead4af Merge pull request #999 from sbwalker/dev
make QueryString parameter keys case insensitive - resolves #992
2020-12-12 15:59:19 -05:00
144c33bcab make QueryString parameter keys case insensitive - resolves #992 2020-12-12 15:58:58 -05:00
6c34c62e48 Merge pull request #74 from oqtane/dev
sync
2020-12-09 14:02:46 -05:00
01eab8fcfd Merge pull request #991 from hishamco/localize-alert-messages
Localize alert messages
2020-12-09 14:00:32 -05:00
e94069e8a5 Localize alert messages in UI 2020-12-09 21:17:33 +03:00
cf68d7320f Localize alert messages in controls 2020-12-09 21:15:35 +03:00
a29d7b524c Localize alert messages in admin pages 2020-12-09 21:12:00 +03:00
3c71282379 Merge pull request #980 from chlupac/file-controller
FileController fix
2020-12-09 11:48:38 -05:00
08f2877e80 Merge pull request #983 from hishamco/translations
Add missing localization strings
2020-12-09 09:54:36 -05:00
3c13122c37 Merge pull request #987 from hishamco/localizable-component
Localizable Component Enhancement
2020-12-09 09:54:15 -05:00
7ca69be41a Merge pull request #990 from hishamco/language-switcher
Replace Visible with ShowLanguageSwitcher property
2020-12-09 09:53:53 -05:00
7c70055b83 Merge pull request #988 from hishamco/ignore
Add Content folder to .gitignore
2020-12-09 09:52:44 -05:00
dd89296713 Replace Visible with ShowLanguageSwitcher property 2020-12-09 17:47:49 +03:00
941d08f0a2 Add missing Control Panel localization strings 2020-12-08 22:57:58 +03:00
3caf06d8ff Add Content folder to .gitignore 2020-12-08 22:50:36 +03:00
c35b5d861a Add missing User Profile localization strings 2020-12-08 22:46:28 +03:00
169a4b00a4 Add missing FileManager localization strings 2020-12-08 22:45:20 +03:00
62f6082525 Localize TriStateCheckBox control 2020-12-08 21:23:03 +03:00
c27e8b55df Add missing Users localization strings 2020-12-08 21:16:37 +03:00
2d15f5d185 Add missing Themes localization strings 2020-12-08 20:55:38 +03:00
836ba5eeb9 Add missing Tenanat localization strings 2020-12-08 20:55:28 +03:00
0e95e94cab Add missing Sql localization strings 2020-12-08 20:50:14 +03:00
8e4a7549ed Add missing Sites localization strings 2020-12-08 20:48:39 +03:00
29c37575f1 Add missing Roles localization strings 2020-12-08 20:45:54 +03:00
299e28abc4 Avoid Label.Text to be empty 2020-12-08 20:40:54 +03:00
5ce7284a6b Returns English version if the value is empty 2020-12-08 16:45:53 +03:00
df1d646083 Refactor LocalizableComponent 2020-12-08 16:37:55 +03:00
f123ac89ef Add missing RecylceBin localization strings 2020-12-08 15:08:21 +03:00
055ae26bc1 Add missing Logs localization strings 2020-12-08 14:41:03 +03:00
e0087c1dbb Add missing Jobs localization strings 2020-12-08 14:37:54 +03:00
87ba77fdba Localize AuditInfo 2020-12-08 13:43:05 +03:00
d953587e4b Merge pull request #986 from chlupac/returnurl
Fix - return to url during login fail when returnurl contains "/"
2020-12-07 17:06:04 -05:00
35e776b150 Fix - return to url during login fail when returnurl contains "/" 2020-12-07 21:27:00 +01:00
86beef305e Merge pull request #976 from jimspillane/FixAureDeploy
Fix Azure deploy
2020-12-07 14:06:25 -05:00
a526719663 Merge pull request #982 from hishamco/action-dialog
Localize ActionDialog.Text
2020-12-07 13:28:02 -05:00
f0f3055869 Add PermissionGrid localization strings 2020-12-06 21:46:19 +03:00
5e49206828 Add FileManager localization strings 2020-12-06 21:46:03 +03:00
5678a1796a Add missing Files localization strings 2020-12-06 21:45:33 +03:00
b878b3ee2f Localize ActionDialog.Text 2020-12-06 19:51:25 +03:00
8c9fc952d8 Update README.md 2020-12-06 19:28:12 +03:00
14f8155df6 FileController fix
- using PhysicalFile framework method (current implementation causes file locks and 500 error at heavy load)
- Add correct mimetype to header based on file extension
2020-12-06 16:23:28 +01:00
5273ae8c45 Merge pull request #975 from jimspillane/FixAureDeploy
Fix Azure deploy
2020-12-04 14:54:05 -05:00
1968b0283d Merge pull request #967 from hishamco/language-switcher
Add Language switcher
2020-12-04 14:53:48 -05:00
1b017a9651 Fix Azure Deploy
Add 5.0 to framework App Service siteConfig
2020-12-04 10:43:29 -05:00
2fe474268e Revert "Fix Azure Deploy"
This reverts commit d688a7c10da81d42fe92b8e1ca7ee266199b3705.
2020-12-04 10:34:52 -05:00
dc7cea1db0 Merge pull request #23 from oqtane/master
Sync Master
2020-12-04 10:20:02 -05:00
0ba348d73e Merge pull request #974 from sbwalker/dev
fix #957 related to loading resources within a Settings component
2020-12-03 15:19:44 -05:00
9f590b32f7 fix #957 related to loading resources within a Settings component 2020-12-03 15:19:23 -05:00
5e293ee298 Fix SupportedCultures bug 2020-12-03 17:25:01 +03:00
20f1a6175f Use cookie everywhere 2020-12-03 17:15:08 +03:00
049ded6f7e Fallback to default culture if its required 2020-12-03 16:14:23 +03:00
1a8125c26d Use REST style 2020-12-03 15:50:25 +03:00
5ee38e4ae7 Add Visible property to control the visibility 2020-12-03 14:13:01 +03:00
a37eb8a44a Introduce Culture model to avoid CultureInfo.DisplayName issue 2020-12-03 14:05:49 +03:00
1b3cc2c44e Interop local storage APIs should be generic 2020-12-03 13:37:18 +03:00
863c13d1d8 Merge pull request #968 from sbwalker/dev
Fixes to make site alias, page path, and module action Url resolutions case insensitive. Optimized logic for Settings component which fixed localization rendering issue.
2020-12-02 09:16:33 -05:00
fd60b40c53 Fixes to make site alias, page path, and module action Url resolutions case insensitive. Optimized logic for Settings component which fixed localization rendering issue. 2020-12-01 19:36:02 -05:00
fa3cc48fd0 Avoid to select the current selected culture 2020-12-02 02:19:47 +03:00
d4dd80ff32 Add missing event args 2020-12-02 02:15:52 +03:00
330499dda5 Use Interop 2020-12-02 02:10:01 +03:00
75556070d6 Ability to change culture 2020-12-02 02:04:34 +03:00
c4d1b16abb Add LanguageSwitcher component 2020-12-02 01:52:46 +03:00
c67e893b6e Add LocalizationService APIs 2020-12-02 01:38:32 +03:00
418c9888c4 Add LocalizationController 2020-12-02 01:38:00 +03:00
a875a5ad32 Merge pull request #73 from oqtane/dev
sync
2020-12-01 14:34:11 -05:00
e9a58138fc Update README.md 2020-11-30 18:59:44 -05:00
e57f0675c6 Merge pull request #954 from hishamco/localize-logs
Localize log messages
2020-11-30 08:14:35 -05:00
d964c25596 Add Resources folder 2020-11-27 22:06:54 +03:00
d5e48296ed Set RootNamespace 2020-11-27 22:06:40 +03:00
2ea0b7199b Localize log messages 2020-11-27 21:48:52 +03:00
a6b45014a4 Merge pull request #72 from oqtane/dev
sync
2020-11-25 16:53:03 -05:00
f6fafbfcfa Merge pull request #950 from hishamco/fix-action-link-localization
Fix localization issue in ActionLink
2020-11-25 16:52:24 -05:00
2f943546ba Merge pull request #951 from sbwalker/dev
Module Creator activation improvement
2020-11-25 16:52:08 -05:00
3fcbc07406 Module Creator activation improvement 2020-11-25 16:51:39 -05:00
7fd0c6c3aa Fix localization issue in ActionLink 2020-11-26 00:04:47 +03:00
23d273f3f7 Merge pull request #949 from sbwalker/dev
improve user experience of Module Creator flow
2020-11-25 11:59:45 -05:00
4401dba4ec improve user experience of Module Creator flow 2020-11-25 11:59:17 -05:00
4bf7dcc835 Merge pull request #947 from sbwalker/dev
improve user experience by delegating application restart responsibility to the host user
2020-11-24 16:23:25 -05:00
5e42ab8cca improve user experience by delegating application restart responsibility to the host user 2020-11-24 16:22:53 -05:00
1e1a2aa145 Update README.md 2020-11-24 10:48:30 -05:00
fa59ec1b24 Merge pull request #71 from oqtane/dev
sync
2020-11-22 10:41:36 -05:00
03d246340f Merge pull request #940 from sbwalker/dev
fix ModuleCreator Invalid character use in naming fields #889
2020-11-20 16:40:58 -05:00
19f924c3d3 fix ModuleCreator Invalid character use in naming fields #889 2020-11-20 16:40:25 -05:00
6185750aeb Merge pull request #938 from sbwalker/dev
missing IStringLocalizer<Index> causing compilation error
2020-11-20 10:30:32 -05:00
710aab9b93 missing IStringLocalizer<Index> causing compilation error 2020-11-20 10:30:07 -05:00
6d913c842c Merge pull request #70 from oqtane/dev
sync
2020-11-20 10:27:20 -05:00
8311d01f32 Merge pull request #935 from hishamco/localize-RTE
Localize RichTextEditor Component
2020-11-20 10:26:08 -05:00
9a3528a208 Merge pull request #934 from hishamco/localize-permission-grid
Localize PermissionGrid Component
2020-11-20 10:25:52 -05:00
acd77b79ba Merge pull request #932 from hishamco/localize-control-panel
Localize ControlPanel Component
2020-11-20 10:25:38 -05:00
50959199bd Merge pull request #931 from hishamco/localize-oqtane-theme
Localize Login & UserProfile components
2020-11-20 10:25:25 -05:00
5d06c356cd Merge pull request #930 from hishamco/localize-installer-page
Localizer Installer Page
2020-11-20 10:25:14 -05:00
066f6095e6 Merge pull request #929 from hishamco/localize-html-text
Localize HtmlText
2020-11-20 10:25:02 -05:00
2ead8fc850 Merge pull request #928 from hishamco/localize-modules-pages
Localize Modules Pages
2020-11-20 10:24:49 -05:00
6c3726be0c Merge pull request #927 from hishamco/localize-module-definitions-pages
Localize Module Definitions Pages
2020-11-20 10:24:36 -05:00
16b713ad6c Merge pull request #926 from hishamco/localize-module-creator-page
Localize Module Creator Page
2020-11-20 10:24:23 -05:00
7cad2e9bd6 Merge pull request #925 from hishamco/localize-reset-page
Localize Reset Page
2020-11-20 10:24:06 -05:00
93cd2e563a Merge pull request #924 from hishamco/localize-register-page
Localizer Register Page
2020-11-20 10:23:52 -05:00
b7e40373b4 Merge pull request #923 from hishamco/localize-files-pages
Localize Files Pages
2020-11-20 10:23:36 -05:00
0a7e2dba84 Merge pull request #922 from hishamco/localize-jobs-pages
Localize Jobs Pages
2020-11-20 10:23:21 -05:00
fe3801dcfb Merge pull request #921 from hishamco/localize-login-page
Localize Login Page
2020-11-20 10:23:05 -05:00
c205b9f930 Merge pull request #920 from hishamco/localize-logs-pages
Localize Logs Pages
2020-11-20 10:22:51 -05:00
7db52ce49a Merge pull request #919 from hishamco/localize-pages
Localize Pages
2020-11-20 10:22:36 -05:00
6cf6e312a8 Merge pull request #918 from hishamco/localize-profiles-pages
Localize Profiles Pages
2020-11-20 10:22:21 -05:00
88ba43557c Merge pull request #917 from hishamco/localize-recycle-bin-page
Localize Recycle Bin
2020-11-20 10:22:03 -05:00
13e98e9d51 Merge pull request #937 from sbwalker/dev
missing using statement causing compilation error
2020-11-20 10:21:00 -05:00
d64f06eb71 missing using statement causing compilation error 2020-11-20 10:20:29 -05:00
26f610e43b Localize RichTextEditor component 2020-11-20 02:25:45 +03:00
33c8fe6e33 Localize PermissionGrid component 2020-11-20 02:22:21 +03:00
5cee11accb Localize ControlPanel component 2020-11-20 02:11:16 +03:00
f8e1c8c53d Localize Login & UserProfile components 2020-11-20 02:05:48 +03:00
f9a0ecca61 Localizer installer page 2020-11-20 01:56:25 +03:00
c7cb3ad53a Localize HtmlText 2020-11-20 01:53:24 +03:00
d108cc3990 Localize non components for the modules pages 2020-11-20 01:45:09 +03:00
867c8f84ad Localize components for the modules pages 2020-11-20 01:43:02 +03:00
4599e9a0fc Localize non components for the module definitions pages 2020-11-20 01:39:56 +03:00
a77a86a439 Localize components for the module definitions pages 2020-11-20 01:37:18 +03:00
46bf682819 Localize module creator page 2020-11-20 01:32:15 +03:00
d45035ce56 Localize reset page 2020-11-20 01:27:30 +03:00
d5d13c6def Localizer register page 2020-11-20 01:26:01 +03:00
6b61713205 Localize non components for the files pages 2020-11-20 01:20:59 +03:00
fb3bd51227 Localize components for the files pages 2020-11-20 01:17:36 +03:00
177dcad5a1 Localize non components for the jobs pages 2020-11-20 01:12:15 +03:00
bc570de9e6 Localize components for jobs pages 2020-11-20 01:06:57 +03:00
be1237f748 Localize login page 2020-11-20 01:00:50 +03:00
db6e550c86 Localize non components for the logs pages 2020-11-20 00:56:37 +03:00
e1b02ee405 Localize components for the logs pages 2020-11-20 00:53:55 +03:00
9a3fd94c11 Localize non components for the pages 2020-11-20 00:50:14 +03:00
917caab7a1 Localize components of the pages 2020-11-20 00:44:44 +03:00
fcfcd46d8e Localize non components for the profiles pages 2020-11-20 00:37:10 +03:00
387c1aa57f Localize component for the profiles pages 2020-11-20 00:34:39 +03:00
09d84bc12a Localize Recylce Bin 2020-11-20 00:30:07 +03:00
2bf5e6c6b3 Merge pull request #69 from oqtane/dev
sync
2020-11-19 15:54:32 -05:00
301051898b Merge pull request #916 from hishamco/runtime
Runtime enum should be in Oqtane.Shared
2020-11-19 15:37:19 -05:00
217bb972e1 Merge pull request #901 from hishamco/localize-site-setiings-page
Localize Site Settings Page
2020-11-19 15:34:38 -05:00
3b62ffd4f0 Merge pull request #900 from hishamco/localize-sites-pages
Localize Sites Pages
2020-11-19 15:34:25 -05:00
ab5bf3cda5 Merge pull request #899 from hishamco/localize-sql-page
Localize SQL Page
2020-11-19 15:34:12 -05:00
db50a2de5f Merge pull request #898 from hishamco/localize-system-info-page
Localize system info page
2020-11-19 15:34:01 -05:00
4a8dd2dc6a Merge pull request #897 from hishamco/localize-tenants-pages
Localize Tenants Pages
2020-11-19 15:33:48 -05:00
6c445b1202 Merge pull request #896 from hishamco/localize-themes-pages
Localize Themes Pages
2020-11-19 15:33:36 -05:00
4973dbb9a5 Merge pull request #895 from hishamco/localize-upgrade-page
Localize Upgrade Page
2020-11-19 15:33:21 -05:00
bd198fef7b Merge pull request #894 from hishamco/localize-user-profiles-pages
Localize User Profile Pages
2020-11-19 15:33:08 -05:00
e25146cd68 Merge pull request #893 from hishamco/localize-users-pages
Localize Users Pages
2020-11-19 15:32:55 -05:00
a849ee283e Merge pull request #892 from hishamco/localize-roles-pages
Localize Roles Pages
2020-11-19 15:32:41 -05:00
57357de2a7 Merge pull request #891 from hishamco/default-localized-string
Fallback to English as default culture
2020-11-19 15:32:25 -05:00
34fb41fac7 Merge pull request #67 from oqtane/dev
sync
2020-11-19 15:02:16 -05:00
66b2718fbb Merge pull request #914 from sbwalker/master
Fix #904 - module title not updating in UI after modification
2020-11-19 14:29:26 -05:00
48aa051a11 Merge pull request #913 from sbwalker/master
Fix #904 - module title not updating in UI after modification
2020-11-19 14:24:32 -05:00
3967c7c783 Fix #904 - module title not updating in UI after modification 2020-11-19 14:22:30 -05:00
80dd3cae92 Update README.md 2020-11-19 14:20:44 -05:00
322d45dd12 Runtime enum should be in Oqtane,Shared 2020-11-19 17:33:49 +03:00
a38cb25804 Merge pull request #21 from oqtane/master
sync master
2020-11-18 22:36:01 -05:00
1f91d7d1d2 Merge pull request #66 from oqtane/master
sync
2020-11-17 17:15:15 -05:00
e94741d049 Localize site settings page 2020-11-18 00:17:16 +03:00
5155cb214f Localize non component of the sites pages 2020-11-18 00:13:46 +03:00
236a4bd3d9 Localize components of sites page 2020-11-18 00:09:51 +03:00
1518afbd93 Localize SQL page 2020-11-17 23:57:58 +03:00
a14616a7c1 Localize system info page 2020-11-17 23:54:59 +03:00
2672f47cdf Localize non components of the tenants pages 2020-11-17 23:47:38 +03:00
bbda300952 Localize components for the tenants pages 2020-11-17 23:46:14 +03:00
c1fa6589af Localize non components for themes pages 2020-11-17 23:42:27 +03:00
1b44de6972 Localize components for the themes pages 2020-11-17 23:40:23 +03:00
2d9ad076d2 Localize upgrade page 2020-11-17 23:34:49 +03:00
dca607b22f Localize non components for user profile pages 2020-11-17 23:24:14 +03:00
5c3e22ab34 Localize components of the user profile pages 2020-11-17 23:13:13 +03:00
086e3623c3 Localize non components in users pages 2020-11-17 23:04:16 +03:00
261f48e842 Localize components for the users pages 2020-11-17 22:56:41 +03:00
b4333a743d Localize non components strings in roles pages 2020-11-17 22:44:44 +03:00
c70f37d33c Fix resource keys 2020-11-17 22:43:53 +03:00
16b5dd99cc Localize components for the roles pages 2020-11-17 22:39:38 +03:00
d8d1412a8f Fallback to English as default culture 2020-11-17 22:28:17 +03:00
c44bc8709d Update README.md 2020-11-16 08:30:02 -05:00
d9f9e73480 Update README.md 2020-11-13 10:00:31 -05:00
2b371b2a9f Update README.md 2020-11-11 11:35:57 -05:00
232cf77e84 Update README.md 2020-11-11 11:35:21 -05:00
080c9ff38b Update README.md 2020-11-11 11:33:38 -05:00
9250a03aea Update README.md 2020-11-11 11:32:56 -05:00
07ae0edd30 Merge pull request #879 from sbwalker/master
removed unnecessary file
2020-11-11 10:24:39 -05:00
32e8052079 removed unnecessary file 2020-11-11 10:24:10 -05:00
60ccad3106 Merge pull request #878 from sbwalker/master
fixed regression issue which was preventing proper handling of situations where module assembly is missing
2020-11-11 10:19:40 -05:00
bcc00a2dbb fixed regression issue which was preventing proper handling of situations where module assembly is missing 2020-11-11 10:19:04 -05:00
5080040590 Merge pull request #65 from oqtane/master
sync
2020-11-11 09:02:02 -05:00
0d71a3878f Merge pull request #877 from jimspillane/UpgradeExternalModuleTemplateToNET50
Upgrade external module template to net50
2020-11-11 09:00:36 -05:00
82b16d28ff Upgrade External Module Template to NET5.0 2020-11-10 21:02:51 -05:00
e34ffb716d Merge pull request #20 from oqtane/master
sync master
2020-11-10 20:52:37 -05:00
6f8c2fb2ed Merge pull request #875 from hishamco/net5
Update README.md
2020-11-10 16:29:21 -05:00
3970722abf Merge pull request #876 from sbwalker/master
include syncevents on module add/update/delete to trigger reload in UI
2020-11-10 16:27:37 -05:00
880ad0486a include syncevents on module add/update/delete to trigger reload in UI 2020-11-10 16:26:50 -05:00
a02786b8b0 Update README.md 2020-11-11 00:22:07 +03:00
2bea59fc66 Merge pull request #874 from hishamco/net5
Upgrade packages to .NET 5 RTM
2020-11-10 16:15:20 -05:00
45819aae07 Upgrade packages to .NET 5 RTM 2020-11-10 23:47:43 +03:00
4762fac0ce Merge pull request #873 from sbwalker/master
improve user experence of Module Creator during app restart
2020-11-09 15:53:14 -05:00
8b97872100 improve user experence of Module Creator during app restart 2020-11-09 15:52:40 -05:00
b921ec24ab Merge pull request #872 from sbwalker/master
fixed issue where modulestate was being modified and not treated as a readonly cache
2020-11-09 15:36:36 -05:00
07519bccde fixed issue where modulestate was being modified and not treated as a readonly cache 2020-11-09 15:35:32 -05:00
a8932ec1e0 Merge pull request #64 from oqtane/master
sync
2020-11-09 10:51:23 -05:00
a9bb82347d Merge pull request #871 from sbwalker/master
Removed comment and added defensive logic in the eent that the moduletype is not valid. Also changed default behavior to display the name if the key is missing. Will need an option in the future to enable the display of missing keys.
2020-11-09 09:43:52 -05:00
2c58a97ec1 fixed malformed tokens in external module template 2020-11-09 09:42:01 -05:00
41b30bfab2 Removed comment and added defensive logic in the eent that the moduletype is not valid. Also changed default behavior to display the name if the key is missing. Will need an option in the future to enable the display of missing keys. 2020-11-09 09:27:52 -05:00
a77aa5fe18 Merge pull request #63 from oqtane/master
sync
2020-11-09 08:29:14 -05:00
780b0c704c Merge pull request #870 from hishamco/localization
Use IStringLocalizerFactory for simplicity
2020-11-08 14:58:42 -05:00
26c054c22d Use IStringLocalizerFactory for simplicity 2020-11-08 22:26:04 +03:00
047336ad21 Merge pull request #62 from oqtane/master
sync
2020-11-08 10:52:36 -05:00
2d344975ff Merge pull request #869 from sbwalker/master
Module Creator should only include Framework References for 2.0.0 and above
2020-11-07 16:45:30 -05:00
e0017065af Module Creator should only include Framework References for 2.0.0 and above 2020-11-07 16:44:41 -05:00
f0a9739b37 Merge pull request #868 from sbwalker/master
upgrade Module Creator external template to .NET 5 RC2 for testing. In order to use it you must choose Local as the Target Version in the Module Creator.
2020-11-07 16:36:48 -05:00
5e801bd5ee upgrade Module Creator external template to .NET 5 RC2 for testing. In order to use it you must choose Local as the Target Version in the Module Creator. 2020-11-07 16:35:44 -05:00
824df0e849 Update README.md 2020-11-05 10:27:20 -05:00
a24fd099c0 Update README.md 2020-11-05 09:25:46 -05:00
c6fdc99690 Merge pull request #866 from sbwalker/master
move version to 2.0.0 and target to net5.0
2020-11-05 09:20:59 -05:00
b602113cd1 move version to 2.0.0 2020-11-05 09:19:56 -05:00
b6886116ad Merge pull request #865 from sbwalker/master
fixed JavaScript issue when loading scripts dynamically which caused only the first script to be loaded for a module
2020-11-05 08:51:58 -05:00
f976910730 fixed JavaScript issue when loading scripts dynamically which caused only the first script to be loaded 2020-11-05 08:50:52 -05:00
6726a42406 Merge pull request #864 from sbwalker/master
resolve Login UI issue #794
2020-11-04 17:44:09 -05:00
23a35cf3c4 resolve Login UI issue #794 2020-11-04 17:43:27 -05:00
f5b99bf9d1 Merge pull request #863 from sbwalker/master
implement optional Security parameter for TabPanel #797
2020-11-04 17:27:58 -05:00
d7135ad4f9 implement optional Security parameter for TabPanel #797 2020-11-04 17:27:15 -05:00
0d03f59cd4 Merge pull request #862 from sbwalker/master
use logo with glow effect so it is visible on both black and white backgrounds
2020-11-04 16:59:03 -05:00
5b49e1bc7c use logo with glow effect so it is visible on both black and white backgrounds 2020-11-04 16:58:02 -05:00
a3215e286a Merge pull request #61 from oqtane/master
sync
2020-11-04 16:00:53 -05:00
b10140f513 Merge pull request #861 from sbwalker/master
performance optimization to reduce calls from client to server unless content is changed
2020-11-04 15:59:49 -05:00
8eaa298d8b performance optimization to reduce calls from client to server unless content is changed 2020-11-04 15:58:13 -05:00
c52d255a30 Merge pull request #860 from sbwalker/master
load module settings automatically so that they are part of the ModuleState and can be easily accessed by developers
2020-11-04 15:41:48 -05:00
97cec46ec1 load module settings automatically so that they are part of the ModuleState and can be easily accessed by developers 2020-11-04 15:40:57 -05:00
46c1564e3d Merge pull request #859 from sbwalker/master
optimize performance when running on WebAssembly by caching assembly payload that needs to be served to new clients
2020-11-04 08:11:03 -05:00
700b6e2d68 optimize performance when running on WebAssembly by caching assembly payload that needs to be served to new clients 2020-11-04 08:10:21 -05:00
3cfb27b2bc Merge pull request #857 from sbwalker/master
fixed compatibility issue in .NET5/WebAssembly where assemblies were not being loaded into the default AppDomain, optimized service registration on WebAssembly, fixed spelling mistake for satellite assemblies constant and fixed issue in LocalizableComponent
2020-11-03 14:44:23 -05:00
b4b73b7e5a fixed compatibility issue in .NET5/WebAssembly where assemblies were not being loaded into the default AppDomain, optimized service registration on WebAssembly, fixed spelling mistake for satellite assemblies constant and fixed issue in LocalizableComponent 2020-11-03 14:41:49 -05:00
8c2338e590 Update README.md 2020-10-28 07:54:35 -04:00
89875516e6 Update README.md 2020-10-25 21:07:56 -04:00
15aa2c2e47 Merge pull request #60 from oqtane/master
sync
2020-10-25 13:11:01 -04:00
1bf4bd0022 Merge pull request #850 from hishamco/patch-1
Update README.md
2020-10-25 13:09:23 -04:00
570b885c09 Merge pull request #849 from hishamco/section-localization
Localize section component
2020-10-25 13:08:40 -04:00
90de3949d2 Merge pull request #848 from hishamco/tab-panel-localization
Localize TabPanel component
2020-10-25 13:08:20 -04:00
38eb7c05b3 Update README.md 2020-10-24 10:12:48 +03:00
5948e7ba76 Localize section component 2020-10-24 10:05:57 +03:00
3cbf55e1ce Move DisplayHeading() from TabStrip to TabPanel 2020-10-24 09:52:17 +03:00
ec270fbff0 Localize TabPanel component 2020-10-24 09:44:56 +03:00
03926bccb0 Merge pull request #846 from sbwalker/master
fix folder parsing issue specific to Azure environment where WebRootPath contains 2 wwwroot nested folders
2020-10-22 16:31:41 -04:00
cdb7de84fa fix folder parsing issue specific to Azure environment where WebRootPath contains 2 wwwroot nested folders 2020-10-22 16:30:27 -04:00
76eccececa Update README.md 2020-10-21 09:20:47 -04:00
2f17945020 Merge pull request #843 from sbwalker/master
Fixed issue where Page Url expansion script for 1.0.4 was not implemented properly - it was not tagged as an embedded resource.
2020-10-21 08:02:57 -04:00
cbd7caa6df Merge branch 'master' of https://github.com/sbwalker/oqtane.framework into master 2020-10-21 08:01:39 -04:00
0ef04e81ff Fixed issue where Page Url expansion script for 1.0.4 was not implemented properly - it was not tagged as an embedded resource. 2020-10-21 08:01:17 -04:00
4dbe16bee5 Merge pull request #841 from hishamco/action-link-localization
Localize ActionDialog
2020-10-20 16:47:34 -04:00
3f78c99ed4 Localize ActionDialog 2020-10-20 23:16:53 +03:00
eaa8649699 Merge pull request #59 from oqtane/master
sync
2020-10-20 12:54:28 -04:00
5835e037a7 Merge pull request #839 from hishamco/action-link-localization
Fix issue with ActionLink localization
2020-10-20 12:50:42 -04:00
af41e8bcfb Fix issue with ActionLink localization 2020-10-20 18:36:06 +03:00
d19f3f358b Update README.md 2020-10-20 09:13:43 -04:00
fc7000394f Merge pull request #58 from oqtane/master
sync
2020-10-20 09:05:32 -04:00
892b79833b Merge pull request #837 from mikecasas/master
Deleted some white space.
2020-10-20 07:53:58 -04:00
ef51d5f05d Merge pull request #836 from TonyValenti/master
Factor out Policy Names
2020-10-20 07:53:19 -04:00
40d8315cff Merge pull request #834 from hishamco/lang
Remove LangVersion
2020-10-20 07:52:55 -04:00
544475c489 Merge pull request #828 from hishamco/action-link-localization
Action link localization
2020-10-20 07:52:40 -04:00
e61cd3d366 Merge pull request #824 from hishamco/localizable-component
Localizable component
2020-10-20 07:52:11 -04:00
01fc60d35d Merge remote-tracking branch 'upstream/master' into master 2020-10-20 07:32:33 -04:00
17a9710c14 Delete white space. 2020-10-20 07:31:24 -04:00
8cf846ba90 Factor out Policy Names
Change AppDomain to AppContext
2020-10-19 20:04:13 -05:00
70a345d2a9 Remove LangVersion 2020-10-19 22:11:51 +03:00
79b584f268 Check needed if the component is localizable 2020-10-19 21:47:59 +03:00
3b09699618 Merge pull request #831 from mikecasas/master
Update template to use the new constants.
2020-10-19 09:48:32 -04:00
1315e0382e Update template to use the new constants. 2020-10-19 09:26:28 -04:00
c733707adc Merge pull request #830 from sbwalker/master
modify comment
2020-10-19 08:51:21 -04:00
9294537e23 modify comment 2020-10-19 08:50:37 -04:00
2abc2cdf20 Merge pull request #829 from sbwalker/master
introduce Resource Declaration and Location properties to offer more resource management options for developers
2020-10-19 08:04:00 -04:00
ecacb681b4 introduce Resource Declaration and Location properties to offer more resource management options for developers 2020-10-19 08:03:04 -04:00
34b9903b15 Localize ActionLink 2020-10-19 12:16:35 +03:00
fed56098a0 Avoid resource check in child components 2020-10-19 11:36:05 +03:00
fd5d777d3a Label should use LocalizableComponent 2020-10-19 11:17:34 +03:00
5bb7c63d44 Introduce LocalizableComponent 2020-10-19 11:16:46 +03:00
34122a344d Merge pull request #818 from sbwalker/master
upgrade to .NET5 RC2
2020-10-18 09:31:16 -04:00
74026401a6 upgrade to .NET5 RC2 2020-10-18 09:30:24 -04:00
f5beb54ddb Merge pull request #817 from sbwalker/master
fixed compilation warnings in AuditInfo, fixed issue in ModuleMessage triggered in InstallWizard, fixed PWA JavaScript in ThemeBuilder for all browsers
2020-10-18 09:10:06 -04:00
d082c5427b fixed compilation warnings in AuditInfo, fixed issue in ModuleMessage triggered in InstallWizard, fixed PWA JavaScript in ThemeBuilder for all browsers 2020-10-18 09:09:18 -04:00
f3e2177423 Merge pull request #57 from oqtane/master
sync
2020-10-18 08:54:34 -04:00
7c8beac3dc Merge pull request #788 from sbwalker/master
Changes for .NET 5
2020-10-18 08:53:11 -04:00
1293b98226 Merge pull request #801 from hishamco/localizable-labels
Use ServiceActivator instead of IHttpContextAccessor
2020-10-18 08:52:13 -04:00
63f43bc27e Merge pull request #802 from iJungleboy/master
Add Documentation attributes #570
2020-10-18 08:52:01 -04:00
f9296ec5c5 Merge pull request #816 from hishamco/editor-config
Add .editorconfig
2020-10-18 08:51:48 -04:00
9543cd7031 Merge pull request #805 from TonyValenti/master
Factored out Contants.*** Role into RoleNames.***
2020-10-18 08:51:23 -04:00
857d699c0d Add .editorconfig 2020-10-18 00:55:16 +03:00
c683de2cda Refactor TenantNames.Master 2020-10-16 10:45:13 -05:00
3e71bdfef3 Replace string with System.Net.Mime.MediaTypeNames.Application.Octet 2020-10-16 10:38:19 -05:00
766be6c929 Factor out default controller route. 2020-10-16 10:37:17 -05:00
f33fb4d001 Factoring out Constants.AdminPane and Constants.HostUser 2020-10-16 10:23:17 -05:00
becc779db8 Extracted "ViewModule" and "EditModule" into PolicyNames class. 2020-10-16 10:07:01 -05:00
955e7a3856 Factored out Contants.*** Role into RoleNames.***
Renamed 'AllUsers' to 'Everyone'
2020-10-16 06:22:52 -05:00
06c041dd4e Add Documentation attributes
part of https://github.com/oqtane/oqtane.framework/issues/570
2020-10-15 10:38:25 +02:00
4a90e6e64f Use ServiceActivator instead of IHttpContextAccessor 2020-10-15 06:07:11 +03:00
81475fd835 Merge pull request #796 from hishamco/localizable-labels
Support label localization
2020-10-13 07:52:24 -04:00
edc65e66c9 Use AddHttpContextAccessor() 2020-10-12 18:26:04 +03:00
4b11bdc4be Support label localization 2020-10-12 18:15:08 +03:00
67067a884b Merge pull request #791 from hishamco/localization-configuration
Simplify localization settings configurations
2020-10-11 20:34:56 -04:00
86bb6d1ea8 Simplify localization settings configurations 2020-10-10 22:19:21 +03:00
7b1a2fb887 Merge pull request #789 from hishamco/debug
Add blazor error details on DEV environment
2020-10-09 14:28:34 -04:00
b3db92ee95 Add blazor error details on DEV environment 2020-10-09 19:17:42 +03:00
aad10ab1c4 Changes for .NET 5 2020-10-08 11:20:43 -04:00
3ab9510e2a Update README.md 2020-10-08 09:59:05 -04:00
fde43b6c39 Merge pull request #783 from mikecasas/master
Refactor to eliminate repetitive code.
2020-10-07 09:24:43 -04:00
7b3dfc49b2 Refactor to eliminate repetitive code. 2020-10-06 08:11:00 -04:00
0a9edd8916 Merge pull request #781 from sbwalker/master
Fixed build warnings related to ModuleMessage component changes
2020-10-05 09:12:52 -04:00
0c0916c6ab Fixed build warnings related to ModuleMessage component changes 2020-10-05 09:11:47 -04:00
ece8f3a57e Merge pull request #56 from oqtane/master
sync
2020-10-04 10:57:24 -04:00
3d7630d3d4 Update README.md 2020-10-04 10:43:09 -04:00
8b6d0d3c7f Merge pull request #779 from hishamco/supported-cultures
Skip missed satellite assemblies forlders
2020-10-04 10:29:44 -04:00
ce37d2f2d2 Skip missed satellite assemblies forlders 2020-10-03 23:26:44 +03:00
40524300bf Merge pull request #777 from hishamco/remove-warning
Avoid Building ServiceProvider in ConfigureServices
2020-10-03 15:52:04 -04:00
5ae9daf5f2 Merge pull request #778 from sbwalker/master
added DefaultAction property to IModule (#765)
2020-10-03 15:51:30 -04:00
6a7be12758 added DefaultAction property to IModule (#765) 2020-10-03 15:50:15 -04:00
bcb6c81e43 Avoid Building ServiceProvider in ConfigureServices 2020-10-03 22:41:48 +03:00
26c40fb367 Merge pull request #55 from oqtane/master
sync
2020-10-03 15:15:16 -04:00
e934a28c39 Merge pull request #770 from PoisnFang/flexible-index-page-in-custom-modules
Allows page to find Custom Index page in Module from Actions Property
2020-10-03 15:14:18 -04:00
c2ca55627e comment where index page is specifed if no action 2020-10-03 12:12:23 -07:00
4a6ffacf56 Merge pull request #54 from oqtane/master
sync
2020-10-03 14:27:02 -04:00
bc72e28d11 Merge pull request #767 from PoisnFang/fix-pane-div-default-class
add default class 'container' for div in pane to avoid content squishing
2020-10-03 14:19:16 -04:00
2a402497cf only add div on admin border 2020-10-01 16:02:14 -07:00
49985dcf9e Merge pull request #53 from oqtane/master
sync
2020-10-01 10:08:22 -04:00
666721bf1a Merge pull request #762 from hishamco/localization-support
Localization support
2020-10-01 10:06:01 -04:00
5f56bc288b Merge pull request #750 from hishamco/alert-component
Use ModuleMessage component everywhere
2020-10-01 10:05:43 -04:00
6e41cd850e allows page to find Custom Index page in Module from Actions Property 2020-09-30 22:53:41 -07:00
f70fed66ae add default class 'container' for div in pane to avoid content squishing 2020-09-30 16:22:46 -07:00
2e2d46996a Refactoring 2020-09-30 00:07:00 +03:00
f83c1b1741 Use invariant culture by default 2020-09-29 22:12:03 +03:00
2924e7849f Read supported cultures from appsettings.json 2020-09-29 21:23:22 +03:00
437170671f Support server-sider localization 2020-09-29 20:20:38 +03:00
b52dd571ee Fix loading bug 2020-09-29 19:18:56 +03:00
ad9146ead1 Fix stallite assemblies folder path 2020-09-29 19:14:48 +03:00
52d1d5841e Avoid looking for en-US culture resources 2020-09-29 18:50:06 +03:00
468327d597 Set localization RootNamespace to make it works 2020-09-29 18:29:18 +03:00
7f28c5f2ff Add localization service to Oqtane.Client 2020-09-29 18:28:30 +03:00
accf947afd LoadClientAssemblies adds satellite assemblies 2020-09-29 18:28:02 +03:00
ec73c958c9 AddOqtaneParts -> AddOqtane 2020-09-29 18:03:24 +03:00
396d584615 Dowanlod satellite assemblies to the browser 2020-09-29 18:01:57 +03:00
edecfa10cd Load satellite assemblies on startup 2020-09-29 17:31:54 +03:00
0796ce54a9 Add localization settings 2020-09-29 17:30:56 +03:00
0044f031aa Set component params instead of SetModuleMessage 2020-09-23 11:29:05 +03:00
913ad53302 Use ModuleMessage everywhere 2020-09-20 15:43:01 +03:00
ad5f5fbc24 Replace Alert with ModuleMessage component 2020-09-20 15:10:48 +03:00
14746f47da Merge pull request #746 from mikecasas/patch-2
Update Constants.cs
2020-09-17 18:53:15 -04:00
0d76070663 Use alert component in FileManager 2020-09-17 15:42:03 +03:00
c01cd3b46c Add dismissible option 2020-09-17 15:41:34 +03:00
3613ce62eb Add Alert component 2020-09-17 15:09:20 +03:00
61839d8e46 Merge pull request #748 from sbwalker/master
fixed Theme install/uninstall issue, fixed Layout inheritance issue, fixed File server performance issue, cleaned up remaining hardcoded permission strings
2020-09-16 15:25:33 -04:00
8196112a59 fixed Theme install/uninstall issue, fixed Layout inheritance issue, fixed File server performance issue, cleaned up remaining hardcoded permission strings 2020-09-16 15:24:07 -04:00
465cbe3c96 Update Constants.cs
Hopefully, nothing wrong with uploading a csv file.
2020-09-16 14:18:22 -04:00
38f2fa5733 Merge pull request #735 from sbwalker/master
prepare for 1.0.4 release
2020-09-09 12:02:11 -04:00
7f15a5f464 prepare for 1.0.4 release 2020-09-09 12:01:16 -04:00
0c5d992d18 Merge pull request #52 from oqtane/master
sync
2020-09-09 11:49:45 -04:00
57dd983c1f Update README.md 2020-09-03 15:59:29 -04:00
d89927ca96 Update README.md 2020-09-02 15:20:17 -04:00
63744d9ec2 Update README.md 2020-09-02 15:17:56 -04:00
c67526b5b0 Update README.md 2020-09-01 16:44:33 -04:00
1cb6bf2a6b Merge pull request #724 from sbwalker/master
removed background color
2020-09-01 16:28:16 -04:00
ac9969c1b6 removed background color 2020-09-01 16:27:42 -04:00
510cd23d5e Update README.md 2020-09-01 16:24:27 -04:00
c94ccbff69 Merge pull request #723 from sbwalker/master
created architecture diagram
2020-09-01 16:23:21 -04:00
93d0cc5e1a created architecture diagram 2020-09-01 16:22:40 -04:00
075ea0aafd Merge pull request #51 from oqtane/master
sync
2020-08-31 10:04:27 -04:00
e75fe19103 Merge pull request #720 from sbwalker/master
add support for SVG and ICO files
2020-08-31 10:01:15 -04:00
e76f1b9663 use Label component in Module Creator templates 2020-08-31 10:00:30 -04:00
cb1c725ec1 add support for SVG and ICO files 2020-08-31 09:48:51 -04:00
98cd361fc0 Merge pull request #716 from sbwalker/master
enhanced Module Creator to allow developer to specify framework reference version so that modules can target any version including the local development environment
2020-08-29 11:30:53 -04:00
d0c8399dd9 enhanced Module Creator to allow developer to specify framework reference version so that modules can target any version including the local development environment 2020-08-29 11:30:16 -04:00
4effa8ec66 Merge pull request #715 from sbwalker/master
improved module/theme installation by saving the list of files which are in the Nuget package and using that list to remove them during uninstall
2020-08-29 10:56:26 -04:00
4065d87a74 improved module/theme installation by saving the list of files which are in the Nuget package and using that list to remove them during uninstall 2020-08-29 10:55:40 -04:00
eb9acc770c Merge pull request #714 from sbwalker/master
added support for dynamic inclusion of global resources in _host.cshtml ( ie. global stylesheets and scripts such as those required by UI component suites )
2020-08-28 11:25:38 -04:00
a8cd84e798 added support for dynamic inclusion of global resources in _host.cshtml ( ie. global stylesheets and scripts such as those required by UI component suites ) 2020-08-28 11:24:43 -04:00
74e5b83026 Merge pull request #711 from sbwalker/master
wired up JavaScript support in Module Creator templates
2020-08-27 17:17:32 -04:00
4aa0b83807 wired up JavaScript support in Module Creator templates 2020-08-27 17:16:54 -04:00
fd592e8d9f Merge pull request #707 from sbwalker/master
script file name should reflect next framework version
2020-08-26 15:25:54 -04:00
bb21eba39f script file name should reflect next major version 2020-08-26 15:24:44 -04:00
b09cb9d655 Merge pull request #50 from oqtane/master
sync
2020-08-26 15:16:28 -04:00
bbbe48b976 Merge pull request #700 from nohorse/patch-1
Create Tenant.01.00.02.02.sql
2020-08-26 15:08:35 -04:00
a036ee19a4 Merge pull request #698 from hishamco/logo
Fix logo
2020-08-26 15:02:43 -04:00
5b45c79357 Merge pull request #705 from sbwalker/master
Ensure folder does not contain files during deletion and remove directory during deletion, fix validation issue in add page which would allow a user to create a page without selecting a layout, modify action dialog to use its own CSS class name so it can be styled independently from the Admin Modal, rollback "container" CSS class assigment on panes
2020-08-26 15:01:09 -04:00
760fc3b8d4 Ensure folder does not contain files during deletion and remove directory during deletion, fix validation issue in add page which would allow a user to create a page without selecting a layout, modify action dialog to use its own CSS class name so it can be styled independently from the Admin Modal, rollback "container" CSS class assigment on panes 2020-08-26 15:00:07 -04:00
fc50a45ecd Create Tenant.01.00.02.02.sql
Proposed fixed for #699
2020-08-22 14:55:43 -07:00
e3fe8c5914 Fix logo 2020-08-22 04:19:11 +03:00
2624b9c105 Merge pull request #691 from mikecasas/plural-fix
Delete module pluralization in the location display.
2020-08-19 05:09:54 -07:00
2f9f823330 Delete module pluralization in the location display. 2020-08-18 17:02:40 -04:00
6cc144d733 Merge pull request #49 from oqtane/master
sync
2020-08-18 13:38:24 -07:00
df404c12a4 Merge pull request #686 from mikecasas/master
Add project reference for dotnet publish to work without errors.
2020-08-18 13:37:36 -07:00
faec53b3c5 Merge pull request #688 from mikecasas/patch-1
Rename MenuHorizontal.Razor to MenuHorizontal.razor
2020-08-18 13:37:23 -07:00
e1ec58b297 Rename MenuHorizontal.Razor to MenuHorizontal.razor 2020-08-18 09:34:26 -04:00
69abce7ce4 Merge pull request #19 from oqtane/master
sync master
2020-08-18 09:14:20 -04:00
38738e0844 Add project reference for dotnet publish to work without errors. 2020-08-16 22:35:09 -04:00
abe0a1a806 Merge pull request #685 from sbwalker/master
resolved #604 - added support for renaming files and moving to a different folder. Also added support for renaming folders and moving to a different parent folder.
2020-08-16 16:03:10 -07:00
809946685a resolved #604 - added support for renaming files and moving to a different folder. Also added support for renaming folders and moving to a different parent folder. 2020-08-16 19:00:49 -04:00
20c8f1528d Merge pull request #683 from sbwalker/master
resolve #526 remove pluralization from module creation templates
2020-08-14 09:44:44 -07:00
282579fcf2 resolve #526 remove pluralization from module creation templates 2020-08-14 12:44:37 -04:00
c8e3fa88e7 Merge pull request #679 from sbwalker/master
Fix #676 - fix creation of new profile fields, add support for required and private profile fields, integrate field level help for consistency
2020-08-13 07:06:28 -07:00
aec5882de1 Fix #676 - fix creation of new profile fields, add support for required and private profile fields, integrate field level help for consistency 2020-08-13 10:06:15 -04:00
bc231b18cf Update README.md 2020-08-07 14:56:58 -04:00
6bcb769fe5 Merge pull request #675 from sbwalker/master
prepare for 1.0.3 release
2020-08-07 10:40:00 -07:00
90110a653c prepare for 1.0.3 release 2020-08-07 13:39:19 -04:00
3c561cc413 Merge pull request #48 from oqtane/master
sync
2020-08-07 10:25:15 -07:00
73f9622ba2 Merge pull request #674 from sbwalker/master
prepare for 1.0.3 release
2020-08-07 10:24:31 -07:00
cf198ff781 prepare for 1.0.3 release 2020-08-07 13:23:58 -04:00
648fc56495 Merge pull request #673 from sbwalker/master
fixed very large file upload
2020-08-07 08:46:57 -07:00
ea6dc6b983 fixed very large file upload 2020-08-07 11:46:11 -04:00
c0e8d09ce1 Merge pull request #672 from sbwalker/master
allow user to reinstall current version
2020-08-06 13:48:07 -07:00
a471784cf3 allow user to reinstall current version 2020-08-06 16:46:22 -04:00
1d2a4bf484 Merge pull request #671 from sbwalker/master
include logging during module and theme installation
2020-08-06 13:37:55 -07:00
3fa620f3bc include logging during module and theme installation 2020-08-06 16:37:27 -04:00
35f186b532 Merge pull request #670 from sbwalker/master
fix regression bug caused by #649 related to installing nupkg packages
2020-08-06 13:10:51 -07:00
5cf35fd70a fix regression bug caused by #649 related to installing nupkg packages 2020-08-06 16:10:19 -04:00
1eef08eaeb Merge pull request #669 from sbwalker/master
modifications for System Update
2020-08-06 10:30:40 -07:00
1750f28a9f modifications for System Update 2020-08-06 13:30:06 -04:00
41edbc5e22 Merge pull request #668 from sbwalker/master
modifications for System Update feature
2020-08-04 10:07:35 -07:00
04257f75e7 modifications for System Update feature 2020-08-04 13:06:54 -04:00
5fb602f733 Merge pull request #667 from sbwalker/master
Improvements to System Update
2020-08-04 05:48:19 -07:00
94f0bdcce9 Improvements to System Update 2020-08-04 08:47:39 -04:00
0ba24f9a3a Update README.md 2020-08-04 08:42:28 -04:00
aac7d6b97a Merge pull request #664 from sbwalker/master
create 1.0.2 packages
2020-07-23 15:32:17 -04:00
bcc33af52b create 1.0.2 packages 2020-07-23 15:31:28 -04:00
24fd42636a Merge pull request #663 from sbwalker/master
preparing for 1.0.2 release
2020-07-23 15:08:27 -04:00
8d539d058c preparing for 1.0.2 release 2020-07-23 15:07:18 -04:00
abda377f6f Merge pull request #662 from sbwalker/master
fix regression bug caused by #648  - the entries within a nupkg (zip) package use the '/' separator - the fix in #648 was causing a wwwroot\wwwroot\... folder to be created on Windows
2020-07-23 14:59:25 -04:00
51bf822392 fix regression bug caused by #648 - the entries within a nupkg (zip) package use the '/' separator - the fix in #648 was causing a wwwroot\wwwroot\... folder to be created on Windows 2020-07-23 14:58:33 -04:00
d3f135a9c7 Merge pull request #47 from oqtane/master
sync
2020-07-23 14:41:29 -04:00
07ba99cc41 Merge pull request #661 from sbwalker/master
increase wait time for browser redirects during app restarts
2020-07-23 14:40:46 -04:00
336550c571 increase wait time for browser redirects during app restarts 2020-07-23 14:39:53 -04:00
679cc04178 Merge pull request #660 from sbwalker/master
optimize NotificationJob so that it only processes the sites for each tenant once.
2020-07-23 14:15:24 -04:00
75fe4e7c89 optimize NotificationJob so that it only processes the sites for each tenant once. 2020-07-23 14:14:29 -04:00
410f8c74e5 Merge pull request #649 from JoergH66/feature/LoadDependDlls_InstallManager
Fixes 2 external module installation problems
2020-07-23 11:39:35 -04:00
05f67d6a2a Merge pull request #659 from sbwalker/master
fixed scheduler so that it does not set NextExecution until after the job has finished executing
2020-07-23 11:39:19 -04:00
3a6cde0e24 fixed scheduler so that it does not set NextExecution until after the job has finished executing 2020-07-23 11:38:20 -04:00
fe1de2b243 Merge pull request #658 from sbwalker/master
Allow scheduled jobs to set next execution date, fix issue in site settings where logo field was not being populated, fixed compositing issue where deleted modules were being rendered.
2020-07-22 16:10:23 -04:00
62a6b5f28a Allow scheduled jobs to set next execution date, fix issue in site settings where logo field was not being populated, fixed compositing issue where deleted modules were being rendered. 2020-07-22 16:09:39 -04:00
d648fa0f02 Merge pull request #657 from ADefWebserver/master
Make a Deploy to Azure Button #168
2020-07-21 11:07:36 -04:00
e706e8cf1f Update README.md
Points the button to the Oqtane repository
2020-07-18 09:55:27 -07:00
9eb8a7e65c Update azuredeploy.json 2020-07-18 09:40:40 -07:00
11c610edf0 Update .deployment 2020-07-18 09:18:02 -07:00
a65cdbd7ad Rename azure.deployment to .deployment 2020-07-18 08:12:18 -07:00
97c56ba142 Create azure.deployment 2020-07-18 08:02:03 -07:00
9fe72a1c98 Update azuredeploy.json 2020-07-17 18:45:57 -07:00
7b40725534 Update README.md 2020-07-17 18:15:08 -07:00
5e1671afe3 Create azuredeploy.json 2020-07-17 18:10:22 -07:00
50d74cbcee Merge pull request #656 from sbwalker/master
modifications to ActionLink and ActionDialog controls, added logic to prevent IHostedService from blocking startup, made controller route prefix consistent in module template
2020-07-17 15:11:32 -04:00
bc73e5e3d0 modifications to ActionLink and ActionDialog controls, added logic to prevent IHostedService from blocking startup, made controller route prefix consistent in module template 2020-07-17 15:09:05 -04:00
b02bdee8cb Merge pull request #46 from oqtane/master
sync
2020-07-17 10:10:23 -04:00
9db4985b14 Merge pull request #655 from alexhendel/fix-path-handling
Fix directory separator for path operations
2020-07-16 10:27:34 -04:00
6f281c256b Merge pull request #654 from mikecasas/upstream-local
Should be moduleid as the entity id is added in the CreateAuthPolicyU…
2020-07-16 10:27:19 -04:00
807252c9e5 Fix directory separator for path operations 2020-07-15 16:09:19 +02:00
23e7f66188 Delete module id as it is getting added in CreateAuthPolicyUrl method. 2020-07-14 11:47:59 -04:00
57c500f4bc Merge remote-tracking branch 'github-mike/upstream-local' into upstream-local 2020-07-14 11:42:55 -04:00
fe302aa9e4 Should be moduleid as the entity id is added in the CreateAuthPolicyUrl method. 2020-07-12 18:59:20 -04:00
f14f927df7 Update README.md 2020-07-09 10:19:20 -04:00
c3f74a5217 Update README.md 2020-07-09 10:18:06 -04:00
457d1bb563 Update README.md 2020-07-09 10:17:34 -04:00
25918056cb Update README.md 2020-07-09 10:14:53 -04:00
86517dd793 Update README.md 2020-07-09 10:13:07 -04:00
00ce083a2c Update README.md 2020-07-09 10:11:28 -04:00
bce262cd8e Merge pull request #652 from sbwalker/master
remove line feeds from content during import
2020-07-09 08:46:50 -04:00
b5db62ef6a remove line feeds from content during import 2020-07-09 08:45:23 -04:00
3703d87d50 Merge pull request #651 from sbwalker/master
Html encode job log messages, add new IModule property to allow modules to specify Runtime support, provide feedback during module content import, remove default EditMode option at the Page level (should be implemented at Module level) - resolves issue where Admin modules could not be deleted, include link to Event Log in AddModuleMessage for Error message type, fixed fallback support for themes in siterouter, integrated auth policy into site templates for Module Creator
2020-07-08 19:57:13 -04:00
f515def414 Html encode job log messages, add new IModule property to allow modules to specify Runtime support, provide feedback during module content import, remove default EditMode option at the Page level (should be implemented at Module level) - resolves issue where Admin modules could not be deleted, include link to Event Log in AddModuleMessage for Error message type, fixed fallback support for themes in siterouter, integrated auth policy into site templates for Module Creator 2020-07-08 19:56:02 -04:00
4bdf20822f check whether the file is in use, dependent runtime-dlls will distribute 2020-07-08 14:06:41 +02:00
49f4e64cb4 Merge pull request #45 from oqtane/master
sync
2020-07-07 08:44:51 -04:00
e615263706 Merge pull request #647 from chlupac/Notifications
Notification changes UNDO
2020-07-07 08:43:52 -04:00
2a7e256116 Merge pull request #648 from alexhendel/fix-linux-theme-installation
Fix directory separator in InstallationManager
2020-07-07 08:43:37 -04:00
a083405b48 Fix directory seperator in InstallationManager 2020-07-07 09:56:24 +02:00
3ea280c82a Motification changes UNDO 2020-07-06 15:27:35 +02:00
192433f02d Merge pull request #44 from oqtane/master
sync
2020-07-05 11:32:20 -04:00
56a2e9dcea Merge pull request #644 from chlupac/ActionIcons
Icons in module actions menu
2020-07-03 15:16:47 -04:00
921cced1c8 Merge pull request #643 from chlupac/Notifications
Notification job optimalization
2020-07-03 15:16:14 -04:00
b17f679f38 Notification job optimalization 2020-07-03 10:19:12 +02:00
8e43fcab21 Icons in module actions menu 2020-07-03 10:15:45 +02:00
73c5092e46 Merge pull request #43 from oqtane/master
sync
2020-07-02 08:56:55 -04:00
56537e4785 Merge pull request #642 from svreic/bugfix/page-path-validation
Page path validation
2020-07-02 08:13:39 -04:00
3bd7d7196d Merge pull request #640 from PoisnFang/routing
Url parameter helper enhancements
2020-07-02 08:11:14 -04:00
7b5a192b82 Added double page path validation 2020-07-02 09:47:42 +02:00
d4be058d07 Can get parameters without template
clear urlParameters dictionary if template fails. Removed UrlParametersTemplate property and UrlParamerters auto dictionary
2020-07-01 15:15:39 -07:00
6c20fea46a Merge pull request #641 from chlupac/NotifyRepo
Notification Repository Breaking change fix
2020-07-01 14:22:26 -04:00
2e7cfefb2e Notification Repository Breaking change fix 2020-07-01 14:23:55 +02:00
038894cf64 Enhancement to url parameters helper in modulebase 2020-07-01 01:35:06 -07:00
954e30d89f Save url parameter action segments 2020-06-30 16:01:16 -07:00
93d9c4534d Merge pull request #42 from oqtane/master
sync
2020-06-30 16:56:08 -04:00
468ca8c6a9 Merge pull request #639 from PoisnFang/routing
Hot fix for homepage routing
2020-06-30 16:54:54 -04:00
e7a4c08dea Now also properly routes in admin modules 2020-06-30 13:51:48 -07:00
69d639ee42 Hot fix for homepage routing 2020-06-30 13:42:35 -07:00
a780569a6f Merge pull request #41 from oqtane/master
sync
2020-06-30 16:16:11 -04:00
568c283efd Merge pull request #638 from PoisnFang/routing
Module Router Enhancement
2020-06-30 16:15:27 -04:00
fccdd07a08 Replaced token identifiers for { } 2020-06-30 12:59:19 -07:00
5e816ea912 Removed anchor property and hash is only set if there is anchor 2020-06-30 12:49:56 -07:00
cb2d529689 added in GetUrlParameters route to Module Index action 2020-06-30 04:16:08 -07:00
c5037e7084 Url parameters working on any page, plus queries and anchors 2020-06-30 03:41:35 -07:00
fdc39d57fb Module Router Enhancement
Allows for PageVariables through the URL
2020-06-27 11:49:24 -07:00
4960e2c668 Update README.md 2020-06-26 08:45:13 -04:00
66cc3a1392 Merge pull request #637 from sbwalker/master
improvements for custom authorization policy usage
2020-06-25 10:24:54 -04:00
6e7c8e7b05 improvements for custom authorization policy usage 2020-06-25 10:23:27 -04:00
727b943fa3 Merge pull request #636 from sbwalker/master
added ModuleControlBase
2020-06-25 09:32:56 -04:00
a4a0334ec0 added ModuleControlBase 2020-06-25 09:31:21 -04:00
9ea5da525b Merge pull request #634 from sbwalker/master
preparing for 1.0.1 release
2020-06-23 09:42:25 -04:00
fa15a5e44b preparing for 1.0.1 release 2020-06-23 09:41:17 -04:00
35d037bbf4 Merge pull request #40 from oqtane/master
sync
2020-06-23 09:13:58 -04:00
e8387103f1 Merge pull request #631 from svreic/bugfix/fixing-theme-service
Fixed ThemeService using tenant aware api calls
2020-06-22 16:59:54 -04:00
16965fd027 Merge pull request #632 from sbwalker/master
enhancement to load dependencies from the /bin if they are not loaded automatically
2020-06-22 16:59:43 -04:00
f81ef89c61 enhancement to load dependencies from the /bin if they are not loaded automatically 2020-06-22 16:58:41 -04:00
6034a161e7 Fixed ThemeService using tenant aware api calls 2020-06-22 08:41:09 +02:00
ff23865711 Merge pull request #39 from oqtane/master
sync
2020-06-19 17:30:38 -04:00
3ac4116a84 Merge pull request #628 from thabaum/dashboard-table-col-size
Fix Dashboard button/input table col size
2020-06-19 17:29:27 -04:00
65df0549fd Merge pull request #625 from mikecasas/feature-email
Send notification based on a future datetime
2020-06-19 17:24:31 -04:00
04ffb079ea Merge pull request #630 from sbwalker/master
upgrade themes to latest Bootstrap, fix breaking change to ThemeBase due to IThemeControl being removed
2020-06-19 17:23:48 -04:00
99d99ca6ad upgrade themes to latest Bootstrap, fix breaking change to ThemeBase due to IThemeControl being removed 2020-06-19 17:22:26 -04:00
0659fc53b7 default launch settings 2020-06-18 23:16:18 -07:00
2febd81b4a default connection 2020-06-18 23:14:21 -07:00
0f814bfefe Update launchSettings.json 2020-06-18 23:06:33 -07:00
120066fce1 default 2020-06-18 23:01:59 -07:00
f4ca525bb5 Delete appsettings.json 2020-06-18 22:50:14 -07:00
5dced08f7a removes password autofill autocomplete="new-password" 2020-06-18 22:47:41 -07:00
882412b8ff button/input columns style="width: 1px" 2020-06-18 22:22:16 -07:00
563345638a Merge remote-tracking branch 'oqtane.framework-upstream/master' into dashboard-table-col-size 2020-06-18 18:14:15 -07:00
20b83c8809 Updated csproj. 2020-06-18 13:09:57 -04:00
7d89670930 Fixed the sql script file name and added update for null values. 2020-06-18 12:58:30 -04:00
40571bfb6e Bug Fix.
Not sure why the email address was not being added to the notification.
2020-06-18 08:40:43 -04:00
5a7a47ef27 Merge pull request #38 from oqtane/master
sync
2020-06-18 08:20:56 -04:00
ee5553ad8a Step 2. 2020-06-18 07:35:40 -04:00
ab8a1e7324 Step 1. 2020-06-18 06:13:15 -04:00
9e633d2d6d Merge pull request #624 from jimspillane/RemoveAsyncFromLoadJS
Remove async from scripts
2020-06-17 14:20:59 -04:00
975e7217a5 Remove async from scripts
Run SPA scripts synchronously to ensure load order
2020-06-17 12:25:36 -04:00
95053d8671 Merge pull request #18 from oqtane/master
Sync Master
2020-06-17 12:14:54 -04:00
61498862b5 Merge pull request #623 from sbwalker/master
add styling to install wizard
2020-06-17 11:29:25 -04:00
a57e25d3d3 add styling to install wizard 2020-06-17 11:27:44 -04:00
7cd18b1fe1 Merge pull request #622 from sbwalker/master
refactored script resource declaration to allow for bundling, made script loading async, refactored RichTextEditor to use new method
2020-06-17 10:28:26 -04:00
0636227284 refactored script resource declaration to allow for bundling, made script loading async, refactored RichTextEditor to use new method 2020-06-17 10:27:14 -04:00
d4d12b6f41 Merge pull request #621 from sbwalker/master
resolve #566 by moving Bootstrap declaration into theme
2020-06-16 17:39:15 -04:00
7c24bae753 resolve #566 by moving Bootstrap declaration into theme 2020-06-16 17:38:06 -04:00
06480d9a7e Merge pull request #619 from sbwalker/master
fix #618
2020-06-15 15:48:52 -04:00
71b3b695fc fix #618 2020-06-15 15:47:35 -04:00
db6d5d2b64 Merge pull request #616 from sbwalker/master
quick fix for #475 - cannot save role
2020-06-15 09:24:09 -04:00
7d7e8e9e66 quick fix for #475 - cannot save role 2020-06-15 09:22:35 -04:00
354382a580 Merge pull request #615 from sbwalker/master
minor cleanup
2020-06-14 22:10:25 -04:00
288cad3d3f minor cleanup 2020-06-14 22:08:52 -04:00
597a935cac Merge pull request #614 from sbwalker/master
added general exception UI handler for #605
2020-06-14 21:48:39 -04:00
1e4b2404c4 added general exception UI handler for #605 2020-06-14 21:47:11 -04:00
048d8f1b87 Merge pull request #613 from sbwalker/master
fix #595 - remove event log entry under scenario where a user is unauthenticated
2020-06-14 21:31:01 -04:00
ec416a7fef fix #595 - remove event log entry under scenario where a user is unauthenticated 2020-06-14 21:29:14 -04:00
c8630d7b05 Merge pull request #612 from sbwalker/master
fix #600 Unhandled exception opening a user's profile
2020-06-14 21:14:46 -04:00
42696eacbd fix #600 Unhandled exception opening a user's profile 2020-06-14 21:12:55 -04:00
b668a5d0ae Merge pull request #611 from sbwalker/master
migrate script naming convention
2020-06-14 13:07:05 -04:00
4285603563 migrate script naming convention 2020-06-14 13:06:33 -04:00
1c0d24ac25 Merge pull request #610 from sbwalker/master
refactoring of #518 to simplify registration of scripts in modules and themes
2020-06-14 12:08:05 -04:00
4e6b4a20ef refactoring of #518 to simplify registration of scripts in modules and themes 2020-06-14 12:07:16 -04:00
ea89cc1a64 Merge pull request #37 from oqtane/master
sync
2020-06-14 11:05:20 -04:00
79622819aa Merge pull request #609 from sbwalker/master
sync
2020-06-14 11:01:08 -04:00
88e3a9adc3 Merge pull request #608 from jimspillane/AddJavaScriptDependencyManager
Add JavaScript dependency manager
2020-06-14 11:00:27 -04:00
f0c95c46c9 Merge pull request #36 from oqtane/master
sync
2020-06-12 13:22:07 -04:00
1a0e8f7e19 Merge pull request #607 from chlupac/SiteRouterFix
small fixes
2020-06-12 13:04:44 -04:00
b5d4f8b176 Merge pull request #606 from chlupac/swagger
Add possibility to switch off swagger on production.
2020-06-12 13:02:58 -04:00
8053cc0af6 small fixes 2020-06-12 17:48:50 +02:00
134f21e29c Merge pull request #35 from oqtane/master
sync
2020-06-12 09:41:19 -04:00
a67330dbbb Merge pull request #586 from thabaum/patch-13
To/From Fields enabled/disabled, reply message fix
2020-06-12 09:40:16 -04:00
06820b9b63 Merge pull request #585 from thabaum/patch-12
'...' added, Reply Removed
2020-06-12 09:37:57 -04:00
f5d47a0308 Merge pull request #599 from BhanuKorthiwada/patch-1
Update README.md
2020-06-12 09:34:44 -04:00
937ae32a9e Add JS dependency manager
Added LoadJS(https://github.com/muicss/loadjs) and migrated Quill interop to use LoadJS.
2020-06-12 08:07:23 -04:00
5124dea72c Add JS dependency manager
Added LoadJS(https://github.com/muicss/loadjs) and migrated Quill interop to use LoadJS.
2020-06-10 21:09:10 -04:00
2ceeb25d0e Merge pull request #17 from oqtane/master
Sync upstream master
2020-06-10 12:20:54 -04:00
e2732d83bd Merge pull request #34 from oqtane/master
sync
2020-06-09 15:19:18 -04:00
3e56e9cc04 Update README.md 2020-06-09 09:57:09 +05:30
836c4505b9 fix bug #589 - Unhandled exception when trying to edit MyPage 2020-06-08 13:48:41 -04:00
ef5ae77060 Merge pull request #596 from svreic/FixingGetInstances
Fixed type filtering in assembly extensions
2020-06-08 13:47:19 -04:00
86b7fe193f Merge pull request #597 from sbwalker/master
fix bug #589 - Unhandled exception when trying to edit MyPage
2020-06-08 13:47:09 -04:00
3503f20255 Fixed type filtering in assembly extensions 2020-06-08 11:36:32 +02:00
51b69e05fb Original Message text area full bottom screen 2020-06-06 15:28:48 -07:00
095a95a3a9 removes message carriage returns 2020-06-06 11:46:35 -07:00
8d17153686 replace dashes with underscores 2020-06-06 08:03:42 -07:00
6efbeeb2b4 Change dashes to underscores 2020-06-06 08:02:08 -07:00
af1aab5b8d Updated to latest framework message username
addresses conflicts
2020-06-05 17:57:25 -07:00
f854b948ce namespaces removed last commit 2020-06-04 21:22:48 -07:00
7b9cd39cb7 To/From Fields enabled/disabled, reply message fix 2020-06-04 21:20:48 -07:00
6f6f2b77d7 '...' added, Reply Removed 2020-06-04 21:11:24 -07:00
ed2822ac7c fixed external module template to specify dependencies 2020-06-04 12:53:14 -04:00
41348b285d Merge pull request #583 from sbwalker/master
fixed external module template to specify dependencies
2020-06-04 12:51:40 -04:00
5b0da056b4 Restore support for third party assembly dependencies in modules and themes when running om Wasm 2020-06-04 12:48:29 -04:00
2d079bdc06 Merge pull request #582 from sbwalker/master
Restore support for third party assembly dependencies in modules and themes when running om Wasm
2020-06-04 12:47:14 -04:00
aed71fbf96 Add possibility to switch off swagger on production. 2020-06-04 07:10:45 +02:00
4ebdf5721c Merge pull request #33 from oqtane/master
sync
2020-06-03 19:47:04 -04:00
99cad13890 restrict user data leakage 2020-06-03 19:46:47 -04:00
4edb3f32f0 Merge pull request #580 from chlupac/UserManagerPersistence
User manager search persistence
2020-06-03 19:46:36 -04:00
01a3b7ed95 Merge pull request #581 from sbwalker/master
restrict user data leakage
2020-06-03 19:46:02 -04:00
c79199357e Merge pull request #579 from chlupac/StartupFix
Move module startup install up to allow install middleware
2020-06-03 19:45:47 -04:00
e24c6fc235 Move module startup install up to allow install middleware 2020-06-03 20:13:48 +02:00
cdc4de432a User manager search persistence 2020-06-03 20:10:52 +02:00
5544d2bed3 fix dynamic creation of remote script tags 2020-06-02 16:10:02 -04:00
aa4b00c900 Merge pull request #578 from sbwalker/master
fix dynamic creation of remote script tags
2020-06-02 16:08:34 -04:00
c4f1d37421 improve user experience after app restarts 2020-06-02 14:21:57 -04:00
c6b22d660b Merge pull request #577 from sbwalker/master
improve user experience after app restarts
2020-06-02 14:20:28 -04:00
ec11587b28 Merge pull request #32 from oqtane/master
sync
2020-06-01 14:58:41 -04:00
1b7ca45d4a Added support for friendly names and thumbnails in theme, layout, and container components. Added fallback support during loading for themes, layout, and containers. 2020-06-01 14:58:46 -04:00
01491b063d Merge pull request #574 from chlupac/OqtaneIgnore
OqtaneIgnore implementation fix
2020-06-01 14:58:04 -04:00
4142cc63e7 Merge pull request #576 from sbwalker/master
Added support for friendly names and thumbnails in theme, layout, and container components. Added fallback support during loading for themes, layout, and containers.
2020-06-01 14:57:21 -04:00
20dc749d05 Merge pull request #575 from chlupac/ControlPanel
Control panel Pane persistence & default selection fix.
2020-06-01 08:09:07 -04:00
4144be5323 Control panel Pane persistence & default selection fix. 2020-06-01 10:12:33 +02:00
27a3ac8d1c OqtaneIgnore implementation fix 2020-06-01 09:21:53 +02:00
f45cb8b069 fix theme selection in sites 2020-05-31 22:56:19 -04:00
0cc325ee95 Merge pull request #573 from sbwalker/master
fix theme selection in sites
2020-05-31 22:54:54 -04:00
7d21cfefc1 restrict container selection to the current theme, hide layout selection if theme does not support layouts, make behavior consistent for all theme/layout/container selection 2020-05-31 22:53:11 -04:00
652d46f64a Merge pull request #572 from sbwalker/master
restrict container selection to the current theme, hide layout selection if theme does not support layouts, make behavior consistent for all theme/layout/container selection
2020-05-31 22:52:05 -04:00
be4813d9c0 Merge pull request #31 from oqtane/master
sync
2020-05-31 20:45:12 -04:00
fe92d3d74f Merge pull request #538 from thabaum/patch-9
Site Settings: removes ONLY " <Select Container>"Theme and Layout drop down options
2020-05-31 20:42:25 -04:00
833ea9461a Merge pull request #568 from chlupac/ActionLink
Allow to show icon only in action link
2020-05-31 09:54:04 -04:00
47a917a3df Merge pull request #16 from oqtane/master
Sync master
2020-05-30 18:41:08 -04:00
cb484665ca Allow to show icon only in action link 2020-05-30 21:24:40 +02:00
64b0c2f128 Merge pull request #564 from sbwalker/master
addressed consistency between theme loading and moduledefinition loading, added theme detailed UI view
2020-05-29 16:27:04 -04:00
6402723d2a addressed consistency between theme loading and moduledefinition loading, added theme detailed UI view 2020-05-29 16:27:02 -04:00
b1a007491f Merge pull request #30 from oqtane/master
sync
2020-05-29 10:53:46 -04:00
17ef268594 Merge pull request #559 from chlupac/ThemeRepository
OqtaneIgnore implementation to theme elements
2020-05-29 10:42:33 -04:00
58d97dd731 OqtaneIgnore implementation to theme elements 2020-05-29 16:09:27 +02:00
ee3a4d1624 Merge pull request #556 from iJungleboy/patches/fix544
Patches/fix544
2020-05-29 08:38:22 -04:00
f9035f8fdf Update README.md 2020-05-28 17:32:06 -04:00
3a5b6954e3 fix for #525 when running locally without a network connection 2020-05-28 16:24:22 -04:00
1794d54a3f Merge pull request #557 from sbwalker/master
fix for #525 when running locally without a network connection
2020-05-28 16:23:15 -04:00
7d251b20cc Fix collection of theme information because of improper namespace checks
https://github.com/oqtane/oqtane.framework/issues/554
2020-05-28 21:07:30 +02:00
0f09df13b5 page redirect support and added missing unique indexes on database tables 2020-05-28 14:48:00 -04:00
73763f1623 Merge pull request #555 from sbwalker/master
page redirect support and added missing unique indexes on database tables
2020-05-28 14:46:36 -04:00
1b2c7772ef Merge pull request #29 from oqtane/master
sync
2020-05-28 14:39:10 -04:00
3b2583a1bd Merge pull request #553 from chlupac/HorizontalMenuFix
Horizontal menu fix
2020-05-28 14:37:24 -04:00
f7470e3c5b Horizontal menu fix 2020-05-28 20:00:28 +02:00
19f8b3d429 Merge pull request #28 from oqtane/master
sync
2020-05-28 10:30:12 -04:00
fd249a7734 Merge pull request #551 from chlupac/TryGetQueryValue
Uri extensions for read query values
2020-05-28 09:51:01 -04:00
d5f3b7513d Merge pull request #549 from chlupac/UserSearch
Search in User management
2020-05-28 09:45:45 -04:00
2a3b7caa9f Merge pull request #548 from jimspillane/FixWildcardRoute
Fix Alias name route
2020-05-28 09:45:34 -04:00
612a820dac fixed stylesheet and script removal logic 2020-05-28 09:44:41 -04:00
e80f42f1d9 Merge pull request #552 from sbwalker/master
fixed stylesheet and script removal logic
2020-05-28 09:43:23 -04:00
8b5004c628 Merge pull request #1 from oqtane/master
sync
2020-05-28 12:47:23 +02:00
151e37c470 Uri extensions for read query values
- safe way to check if key is presented
- safe parsing int values in query
- should replace int.Parse()

  _jobId = Int32.Parse(PageState.QueryString["id"]);
  can throw unhandled exception when "id" is not int

  correct way
  if (PageState.Uri.TryGetQueryValueInt("id",out _jobId)) ....
2020-05-28 12:26:23 +02:00
e935451d93 Search in User management 2020-05-28 11:33:47 +02:00
b0af00aa47 Fix Alias route
Added wildcard route catchall.
2020-05-27 16:58:50 -04:00
cbbac26881 Merge pull request #15 from oqtane/master
Sync upstream
2020-05-27 16:55:10 -04:00
f2230dd530 Merge pull request #544 from chlupac/nuget
Generate nugets in correct format
2020-05-27 16:12:51 -04:00
963148c639 Refactor Javascript and Stylesheet loading 2020-05-27 16:03:38 -04:00
215e52e42e Merge pull request #547 from sbwalker/master
Refactor Javascript and Stylesheet loading
2020-05-27 16:02:20 -04:00
945d7870c0 Merge pull request #14 from oqtane/master
Sync master
2020-05-26 18:46:49 -04:00
cc40733cff Merge pull request #27 from oqtane/master
sync
2020-05-26 10:39:21 -04:00
795f591da2 Generate nugets in correct format 2020-05-26 09:28:37 +02:00
4cab49e022 Merge pull request #535 from thabaum/patch-8
Oqtane Theme:  CSS style module actions dropdown text #fff
2020-05-25 11:33:07 -04:00
3b685fe571 Merge pull request #541 from jimspillane/ChangeJavaScriptNamespaceToOqtane
Change JavaScript namespace from interop to Oqtane
2020-05-25 11:32:54 -04:00
97df673609 Change JavaScript namespace from interop to Oqtane 2020-05-24 23:04:55 -04:00
cbcec0481a removed "Select Container, Theme, Layout" options 2020-05-24 19:12:47 -07:00
2f272ef4b6 style module actions dropdown text #fff 2020-05-24 17:47:27 -07:00
a4ed06f2fc Merge pull request #13 from oqtane/master
Sync upstream
2020-05-24 19:43:11 -04:00
3339690e2a Improvements to ModuleCreator external template to use Package references and include framework in Nuspec file 2020-05-24 19:11:35 -04:00
e4b37c17d8 Merge pull request #534 from sbwalker/master
Improvements to ModuleCreator external template to use Package references and include framework in Nuspec file
2020-05-24 19:10:21 -04:00
f1f07f45c6 Merge pull request #531 from chlupac/ControlPanel
Control panel persistence between module addings
2020-05-24 10:54:10 -04:00
068803615b Notification job fill mail subject 2020-05-22 21:29:52 +02:00
ddbb08ea75 Control panel state persistence 2020-05-22 21:29:06 +02:00
6ac2b64d7d improvements to module creator templates 2020-05-22 13:39:59 -04:00
93497eb776 Merge pull request #530 from sbwalker/master
improvements to module creator templates
2020-05-22 13:39:04 -04:00
e1b0dbcdf7 modification to JSInterop and Quill 2020-05-22 11:51:57 -04:00
c2ddd248e4 Merge pull request #529 from sbwalker/master
modification to JSInterop and Quill
2020-05-22 11:51:04 -04:00
a4ec456205 Merge branch 'master' of https://github.com/thabaum/Oqtane.Framework 2020-05-21 21:10:57 -07:00
23764d1ae4 Merge pull request #3 from oqtane/master
update
2020-05-21 21:07:22 -07:00
f77a8a964f Merge remote-tracking branch 'oqtane.framework-upstream/master' 2020-05-21 15:52:54 -07:00
c089b90659 modifications to JSInterop in RichTextEditor 2020-05-21 15:55:58 -04:00
32cd34b090 Merge pull request #522 from sbwalker/master
modifications to JSInterop in RichTextEditor
2020-05-21 15:54:53 -04:00
d8fca5de20 module creator templates need to be in the server project in order to be distributed with application 2020-05-20 15:31:09 -04:00
2f8a15fb89 Merge pull request #519 from sbwalker/master
module creator templates need to be in the server project in order to be distributed with application
2020-05-20 15:30:44 -04:00
1495a5c017 fixed references in external template 2020-05-20 14:59:57 -04:00
61b1b710db Merge pull request #517 from sbwalker/master
fixed references in external template
2020-05-20 14:58:56 -04:00
24579dc4d0 Merge pull request #12 from oqtane/master
Sync master
2020-05-20 13:04:32 -04:00
066ef44773 fixes to upgrade project 2020-05-20 11:57:41 -04:00
1355233b92 Merge pull request #515 from sbwalker/master
fixes to upgrade project
2020-05-20 11:56:32 -04:00
dc55c5b3ec Merge pull request #26 from oqtane/master
sync
2020-05-20 09:19:36 -04:00
ed3f07ff61 Merge pull request #514 from mikecasas/external-module-creator-refs
External module creator refs
2020-05-20 08:52:16 -04:00
028485b653 Merge remote-tracking branch 'upstream/master' into external-module-creator-refs 2020-05-20 08:06:18 -04:00
b43d191536 Merge pull request #25 from oqtane/master
sync
2020-05-20 08:03:39 -04:00
43dfad38c9 Merge pull request #513 from mikecasas/fix-01
Update reference.
2020-05-20 08:02:30 -04:00
6f1e930474 Updated the versions. 2020-05-20 06:51:22 -04:00
1d52de53a6 Update reference. 2020-05-20 06:47:57 -04:00
3aec68d9fa added border 2020-05-19 17:59:57 -04:00
4dc24f4c78 Merge pull request #511 from sbwalker/master
added border
2020-05-19 17:58:53 -04:00
a73e088abc Update README.md 2020-05-19 17:49:43 -04:00
b61446a50a updated screenshots 2020-05-19 17:49:11 -04:00
31773abb01 Merge pull request #510 from sbwalker/master
updated screenshots
2020-05-19 17:48:05 -04:00
85c491224d Update README.md 2020-05-19 14:55:52 -04:00
19fb3120d3 Update README.md 2020-05-19 14:18:43 -04:00
35b26c7525 update to version 1.0.0 2020-05-19 14:08:03 -04:00
4154bd0988 Merge pull request #509 from sbwalker/master
update to version 1.0.0
2020-05-19 14:07:10 -04:00
52b2c876a4 performance optimizations to avoid use of reflection ( thanks to @chlupac for this suggestion ) 2020-05-19 13:39:39 -04:00
b7eeda7562 Merge pull request #508 from sbwalker/master
performance optimizations to avoid use of reflection ( thanks to @chlupac for this suggestion )
2020-05-19 13:38:30 -04:00
b59e2533ea update to .NET Core 3.2 2020-05-19 12:48:30 -04:00
a8ec5e1265 Merge pull request #507 from sbwalker/master
update to .NET Core 3.2
2020-05-19 12:47:36 -04:00
61ff097f51 default theme needs to work in local development scenarios 2020-05-19 09:17:38 -04:00
b82f69b8b0 Merge pull request #506 from sbwalker/master
default theme needs to work in local development scenarios
2020-05-19 09:16:37 -04:00
263b045c75 module creator template updates 2020-05-19 09:08:29 -04:00
a160597f6f Merge pull request #505 from sbwalker/master
module creator template updates
2020-05-19 09:07:25 -04:00
f0fe6551dd Merge pull request #24 from oqtane/master
sync
2020-05-19 08:24:12 -04:00
09b17e142e Merge pull request #503 from jimspillane/FixMergeFiles
Fix file upload merge
2020-05-19 07:52:07 -04:00
b8ce634f85 Fix file upload merge
Allow upload of file names that match the token pattern ".part_", but not in the file extension. For example, a file named, a.part_Y.txt, would not be uploaded.
2020-05-18 19:53:49 -04:00
1532eb7586 Optimized downloading of assemblies when using WebAssembly 2020-05-18 18:02:23 -04:00
9b65cd0e07 Merge pull request #502 from sbwalker/master
Optimized downloading of assemblies when using WebAssembly
2020-05-18 18:01:23 -04:00
b4596cb624 Merge pull request #11 from oqtane/master
Sync upstream
2020-05-18 15:30:43 -04:00
5e23448618 use lambas for setting resources 2020-05-18 13:34:53 -04:00
96c2a59551 Merge pull request #501 from sbwalker/master
use lambas for setting resources
2020-05-18 13:33:50 -04:00
6ae019336d changing default theme to Oqtane theme 2020-05-18 10:44:54 -04:00
0c236682b9 Merge pull request #500 from sbwalker/master
changing default theme to Oqtane theme
2020-05-18 10:44:00 -04:00
9b74262c76 Added support for module resource management 2020-05-18 09:47:37 -04:00
a13208e65d Merge pull request #499 from sbwalker/master
Added support for module resource management
2020-05-18 09:46:32 -04:00
f8ab886750 Fixed issue with loading resources 2020-05-16 22:11:58 -04:00
84b011224e Merge pull request #498 from sbwalker/master
Fixed issue with loading resources
2020-05-16 22:11:00 -04:00
c426302242 enhanced module creator to display location where module will be created 2020-05-16 13:40:59 -04:00
814e2100b2 Merge pull request #495 from sbwalker/master
enhanced module creator to display location where module will be created
2020-05-16 13:39:57 -04:00
54d4447d23 Central management of resources ( ie. stylesheets and scripts ) 2020-05-16 12:00:15 -04:00
93942d7cdd Merge pull request #492 from jimspillane/AddMissingSInCsproj
Fix module pluralization
2020-05-16 12:00:08 -04:00
0afd7d9ca4 Merge pull request #493 from sbwalker/master
Central management of resources ( ie. stylesheets and scripts )
2020-05-16 11:59:24 -04:00
3a19ced2d1 Fix module pluralization
Added 's' to the module creator sql script in the csproj to fix compilation error.
2020-05-16 10:36:16 -04:00
d5811a20e9 Merge pull request #10 from oqtane/master
Sync master
2020-05-16 10:25:28 -04:00
1b2600c6c4 Merge pull request #23 from oqtane/master
sync
2020-05-16 08:54:28 -04:00
f9cdc6d70c Merge pull request #490 from jimspillane/AddFileValidation
Add File Name validation
2020-05-16 08:53:39 -04:00
fbdf21320b Merge pull request #491 from chlupac/SettingsService
Setting service bug.
2020-05-16 08:52:13 -04:00
96f5668a3b Setting service bug. 2020-05-16 08:40:30 +02:00
13adebb36c Add File Name validation
Apply file name validation rules to the File Controller and client.
2020-05-15 23:12:24 -04:00
8a1e83ff7f Modified the package installer to use target folders ( based on the Nuget specification ) rather than file extensions 2020-05-15 17:43:45 -04:00
e698ea4d36 Merge pull request #489 from sbwalker/master
Modified the package installer to use target folders  ( based on the Nuget specification ) rather than file extensions
2020-05-15 17:42:49 -04:00
f5ce00ae7d Merge pull request #9 from oqtane/master
Sync upstream master
2020-05-15 12:56:45 -04:00
3cbb6e3e6e enable module creator to add embeddedresources to csproj for internal modules 2020-05-15 12:36:52 -04:00
9394e77fd5 Merge pull request #488 from sbwalker/master
enable module creator to add embeddedresources to csproj for internal modules
2020-05-15 12:35:52 -04:00
ac03afb146 added ability to set default container at the page level, expanded size of role description in upgrade script for 0.9.2 2020-05-15 09:50:48 -04:00
51c27ae0e5 Merge pull request #486 from sbwalker/master
added ability to set default container at the page level, expanded size of role description in upgrade script for 0.9.2
2020-05-15 09:49:45 -04:00
0ea4c4d723 Merge pull request #484 from jimspillane/MoveFolderValidationToShared
Move Path and File validation to Shared Utilities
2020-05-15 09:47:37 -04:00
b3dee737b4 Merge pull request #480 from chlupac/FileManager
FileManager Tune-Up
2020-05-15 09:46:28 -04:00
24ca9f4ded Merge pull request #485 from chlupac/FileController
File Controller bug
2020-05-15 07:28:12 -04:00
9850e249fc File Controller bug 2020-05-15 08:20:00 +02:00
5e04cb18a4 File Manager Tune-up 2020-05-15 08:18:07 +02:00
39641804f1 Move Path and File validation to Shared Utilities
Created extension methods:
IsPathValid(Folder)
IsFileValid(File)
IsPathOrFileValid(string)

Added client side validation check for Folders.
2020-05-14 22:02:57 -04:00
edc356292d Merge pull request #481 from thabaum/patch-6
container class added to pane
2020-05-14 21:34:09 -04:00
78f4af6b70 Merge pull request #482 from thabaum/patch-7
System Info input disabled changed to readonly
2020-05-14 18:41:36 -04:00
e98b8801f3 Merge pull request #483 from sbwalker/master
removed redundant assembly download logic, added security on download controller methods
2020-05-14 18:41:15 -04:00
caabac3e74 removed redundant assembly download logic, added security on download controller methods 2020-05-14 18:40:53 -04:00
422f360807 disabled changed to readonly 2020-05-14 14:58:09 -07:00
6e28fa47a2 container class added to pane
resolves issue with title border DIV not utilizing 100% pane size
2020-05-14 14:03:09 -07:00
b4f3c4ae56 Merge pull request #22 from oqtane/master
sync
2020-05-14 14:22:15 -04:00
bafe2c6666 fix module creator templates 2020-05-14 14:22:11 -04:00
5eec442442 Merge pull request #479 from sbwalker/master
fix module creator templates
2020-05-14 14:21:28 -04:00
def12489e6 Merge pull request #8 from oqtane/master
Sync master
2020-05-14 12:12:26 -04:00
82429c2545 Merge pull request #477 from jimspillane/PathTraversal
Add File and Path rules
2020-05-14 11:55:07 -04:00
aa97dd4d0d Allow modules to be installed/uninstalled with embedded scripts or IInstallable interface. Fix module uninstall issues. 2020-05-14 11:54:28 -04:00
cba5865e81 Merge pull request #478 from sbwalker/master
Allow modules to be installed/uninstalled with embedded scripts or IInstallable interface. Fix module uninstall issues.
2020-05-14 11:53:33 -04:00
8afe8e7474 Add File and Path rules
Apply the file and path naming rules found at 
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

Mitigate path traversal.
2020-05-14 09:53:36 -04:00
a9630e715b Merge pull request #7 from oqtane/master
Sync upstream master
2020-05-14 08:43:53 -04:00
6824b3f1b5 Merge pull request #471 from jimspillane/ReservedNameCheck
Add additional reserved names and characters
2020-05-13 16:25:27 -04:00
1cca18c4d2 Add additional reserved names and characters
Added CONIN$,CONOUT$ and characters <>:"/\|?*

Added .Split('.')[0] to folder.Name to catch names like CON.txt and allow names like CONTRACT.
2020-05-12 22:38:28 -04:00
a886ae12cc Merge pull request #6 from oqtane/master
Sync master
2020-05-12 20:52:07 -04:00
560c995564 Include AliasId in service API calls ( this is not needed for interacting with the MasterDB repository however it is needed for tenant-based logging ) 2020-05-12 20:31:31 -04:00
69a5077eda Merge pull request #470 from sbwalker/master
Include AliasId in service API calls ( this is not needed for interacting with the MasterDB repository however it is needed for tenant-based logging )
2020-05-12 20:30:27 -04:00
3efd39c74f Merge pull request #21 from oqtane/master
sync
2020-05-12 20:08:55 -04:00
bbcb054f7a Merge pull request #469 from chlupac/IClientStartup
Client assembly selection criteria changed
2020-05-12 20:07:27 -04:00
88cf30f7c6 Merge branch 'master' of https://github.com/oqtane/oqtane.framework into IClientStartup 2020-05-12 23:20:06 +02:00
4c188b782d ClientAssembly selection criteria changed 2020-05-12 23:17:37 +02:00
196e3d5865 Merge pull request #468 from sbwalker/master
updated module creator templates to use dependency injection in module components
2020-05-12 16:38:47 -04:00
6fd0efbb73 updated module creator templates to use dependency injection in module components 2020-05-12 16:31:53 -04:00
9eec0fd86b updated HtmlText module to use dependency injection 2020-05-12 15:04:07 -04:00
ad70128747 Merge pull request #466 from sbwalker/master
updated HtmlText module to use dependency injection
2020-05-12 15:04:01 -04:00
ee55b4e3cf Merge pull request #465 from sbwalker/master
add security to site template API
2020-05-12 14:38:52 -04:00
53f454e370 Merge pull request #20 from oqtane/master
sync
2020-05-12 14:37:37 -04:00
f05c7d79e3 add security to site template API 2020-05-12 14:31:18 -04:00
598b433cd2 Merge pull request #463 from chlupac/IClientStartup
IClientStartup  implementation
2020-05-12 14:31:10 -04:00
6ac4ba4617 Merge pull request #462 from mikecasas/patch-1
Update IModuleControl.cs
2020-05-12 14:30:59 -04:00
f4710f90c0 Merge pull request #464 from sbwalker/master
validate folder names, handle missing files more gracefully
2020-05-12 14:30:44 -04:00
6f3fe8d933 validate folder names, handle missing files more gracefully 2020-05-12 13:24:51 -04:00
da73d519d7 IClientStartup implementation 2020-05-12 10:00:28 +02:00
7f157582cc Update IModuleControl.cs
Added additional comments.
2020-05-11 13:47:12 -04:00
4d7ec16f36 Merge pull request #459 from chlupac/IServerStartup
IServerStartup implementation
2020-05-11 12:56:22 -04:00
7c814a67b3 IServerStartup implementation 2020-05-11 11:19:12 +02:00
c83496d814 Merge pull request #19 from oqtane/master
sync
2020-05-10 10:03:50 -04:00
83d47376cc Merge pull request #458 from jimspillane/FixContainsFiles
Fix contains files
2020-05-10 09:43:59 -04:00
a1449fb2dd Fix Uploadable files
When testing for allowable file extensions using a comma separated list, like (jpg,mp3,txt,zip), extensions such as .xt or .p3 will return true.  Adding Split(',') will test each of the extensions correctly.

Adding ToLower() will allow mixed case extensions, like .JPG or .Zip to return true.
2020-05-09 14:58:39 -04:00
2362faaee1 Merge pull request #5 from oqtane/master
Sync master
2020-05-09 14:04:36 -04:00
71f79bd90b Merge pull request #1 from oqtane/master
update master branch
2020-05-06 17:55:24 -07:00
7ca1f92f52 Merge pull request #4 from oqtane/master
Sync master
2020-05-05 21:26:18 -04:00
c30ee60433 Merge pull request #3 from oqtane/master
Sync master
2020-05-01 18:07:34 -04:00
e627e14233 Merge pull request #2 from oqtane/master
Sync master
2020-05-01 14:50:51 -04:00
4a6b12b6f9 Merge pull request #1 from oqtane/master
Sync master
2020-04-30 21:07:21 -04:00
874 changed files with 60683 additions and 16721 deletions

2
.deployment Normal file
View File

@ -0,0 +1,2 @@
[config]
project = Oqtane.Server/Oqtane.Server.csproj

53
.editorconfig Normal file
View File

@ -0,0 +1,53 @@
root = true
[*]
end_of_line = crlf
charset = utf-8
indent_style = space
indent_size = 4
[*.{json,csproj,props,targets}]
indent_size = 2
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true : suggestion
csharp_style_var_when_type_is_apparent = true : suggestion
csharp_style_var_elsewhere = true : suggestion
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." if not necessary
dotnet_style_qualification_for_field = false : suggestion
dotnet_style_qualification_for_property = false : suggestion
dotnet_style_qualification_for_method = false : suggestion
dotnet_style_qualification_for_event = false : suggestion
# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true : suggestion
dotnet_style_predefined_type_for_member_access = false : suggestion
# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true : none
csharp_style_pattern_matching_over_as_with_null_check = true : none
csharp_style_inlined_variable_declaration = true : none
csharp_style_throw_expression = true : none
csharp_style_conditional_delegate_call = true : none
dotnet_style_object_initializer = true : suggestion
dotnet_style_collection_initializer = true : suggestion
dotnet_style_coalesce_expression = true : suggestion
dotnet_style_null_propagation = true : suggestion
dotnet_style_explicit_tuple_names = true : suggestion
trim_trailing_whitespace = true
insert_final_newline = true

20
.gitignore vendored
View File

@ -7,9 +7,25 @@ msbuild.binlog
.vscode/
*.binlog
*.nupkg
*.zip
*.idea
_ReSharper.Caches
.DS_Store
Oqtane.Server/appsettings.json
Oqtane.Server/Data/*.mdf
Oqtane.Server/Data/*.ldf
Oqtane.Server/Data
/Oqtane.Server/Properties/PublishProfiles/FolderProfile.pubxml
Oqtane.Server/Content
Oqtane.Server/Packages
Oqtane.Server/wwwroot/Content
Oqtane.Server/wwwroot/Packages/*.log
Oqtane.Server/wwwroot/Modules
!Oqtane.Server/wwwroot/Modules/Oqtane.Modules.*
!Oqtane.Server/wwwroot/Modules/Templates
Oqtane.Server/wwwroot/Themes
!Oqtane.Server/wwwroot/Themes/Oqtane.Themes.*
!Oqtane.Server/wwwroot/Themes/Templates

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018-2020 .NET Foundation
Copyright (c) 2018-2022 .NET Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,34 +1,82 @@
@inject IInstallationService InstallationService
@inject IInstallationService InstallationService
@inject IJSRuntime JSRuntime
@inject SiteState SiteState
@if (_initialized)
{
@if (!_installed)
@if (!_installation.Success)
{
<Installer />
}
else
{
<CascadingAuthenticationState>
<CascadingValue Value="@PageState">
<SiteRouter OnStateChange="@ChangeState" />
</CascadingValue>
</CascadingAuthenticationState>
@if (string.IsNullOrEmpty(_installation.Message))
{
<div style="@_display">
<CascadingAuthenticationState>
<CascadingValue Value="@PageState">
<SiteRouter Runtime="@Runtime" RenderMode="@RenderMode" VisitorId="@VisitorId" OnStateChange="@ChangeState" />
</CascadingValue>
</CascadingAuthenticationState>
</div>
}
else
{
<div class="app-alert">
@_installation.Message
</div>
}
}
}
@code {
private bool _initialized;
private bool _installed;
[Parameter]
public string AntiForgeryToken { get; set; }
private PageState PageState { get; set; }
[Parameter]
public string Runtime { get; set; }
protected override async Task OnParametersSetAsync()
{
var installation = await InstallationService.IsInstalled();
_installed = installation.Success;
[Parameter]
public string RenderMode { get; set; }
[Parameter]
public int VisitorId { get; set; }
[Parameter]
public string RemoteIPAddress { get; set; }
[Parameter]
public string AuthorizationToken { get; set; }
private bool _initialized = false;
private string _display = "display: none;";
private Installation _installation = new Installation { Success = false, Message = "" };
private PageState PageState { get; set; }
protected override async Task OnParametersSetAsync()
{
SiteState.RemoteIPAddress = RemoteIPAddress;
SiteState.AntiForgeryToken = AntiForgeryToken;
SiteState.AuthorizationToken = AuthorizationToken;
_installation = await InstallationService.IsInstalled();
if (_installation.Alias != null)
{
SiteState.Alias = _installation.Alias;
}
_initialized = true;
}
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
{
_display = "";
StateHasChanged();
}
}
private void ChangeState(PageState pageState)
{
PageState = pageState;

View File

@ -0,0 +1,5 @@
using System.Runtime.CompilerServices;
using Microsoft.Extensions.Localization;
[assembly: RootNamespace("Oqtane")]
[assembly: InternalsVisibleTo("Oqtane.Server")]

View File

@ -0,0 +1,61 @@
using System;
namespace Microsoft.Extensions.Localization
{
public static class OqtaneLocalizationExtensions
{
/// <summary>
/// Gets the string resource for the specified key and returns the value if the resource does not exist
/// </summary>
/// <param name="localizer"></param>
/// <param name="key">the static key used to identify the string resource</param>
/// <param name="value">the default value if the resource for the static key does not exist</param>
/// <returns></returns>
public static string GetString(this IStringLocalizer localizer, string key, string value)
{
string localizedValue = localizer[key];
if (localizedValue == key && !string.IsNullOrEmpty(value)) // not localized
{
localizedValue = value;
}
return localizedValue;
}
/// <summary>
/// Creates an IStringLocalizer based on a type name. This extension method is useful in scenarios where the default IStringLocalizer is unable to locate the resources.
/// </summary>
/// <param name="localizerFactory"></param>
/// <param name="fullTypeName">the full type name ie. GetType().FullName</param>
/// <returns></returns>
public static IStringLocalizer Create(this IStringLocalizerFactory localizerFactory, string fullTypeName)
{
var typename = fullTypeName;
// handle generic types
var type = Type.GetType(fullTypeName);
if (type.IsGenericType)
{
typename = type.GetGenericTypeDefinition().FullName;
typename = typename.Substring(0, typename.IndexOf("`")); // remove generic type info
}
// format typename
if (typename.Contains(","))
{
typename = typename.Substring(0, typename.IndexOf(",")); // remove assembly info
}
// remove rootnamespace
var rootnamespace = "";
var attributes = type.Assembly.GetCustomAttributes(typeof(RootNamespaceAttribute), false);
if (attributes.Length > 0)
{
rootnamespace = ((RootNamespaceAttribute)attributes[0]).RootNamespace;
}
typename = typename.Replace(rootnamespace + ".", "");
// create IStringLocalizer using factory
return localizerFactory.Create(typename, type.Assembly.GetName().Name);
}
}
}

View File

@ -0,0 +1,56 @@
using Microsoft.AspNetCore.Components.Authorization;
using Oqtane.Providers;
using Oqtane.Services;
using Oqtane.Shared;
namespace Microsoft.Extensions.DependencyInjection
{
public static class OqtaneServiceCollectionExtensions
{
public static IServiceCollection AddOqtaneAuthorization(this IServiceCollection services)
{
services.AddAuthorizationCore();
services.AddScoped<IdentityAuthenticationStateProvider>();
services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<IdentityAuthenticationStateProvider>());
return services;
}
public static IServiceCollection AddOqtaneScopedServices(this IServiceCollection services)
{
services.AddScoped<SiteState>();
services.AddScoped<IInstallationService, InstallationService>();
services.AddScoped<IModuleDefinitionService, ModuleDefinitionService>();
services.AddScoped<IThemeService, ThemeService>();
services.AddScoped<IAliasService, AliasService>();
services.AddScoped<ITenantService, TenantService>();
services.AddScoped<ISiteService, SiteService>();
services.AddScoped<IPageService, PageService>();
services.AddScoped<IModuleService, ModuleService>();
services.AddScoped<IPageModuleService, PageModuleService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IProfileService, ProfileService>();
services.AddScoped<IRoleService, RoleService>();
services.AddScoped<IUserRoleService, UserRoleService>();
services.AddScoped<ISettingService, SettingService>();
services.AddScoped<IPackageService, PackageService>();
services.AddScoped<ILogService, LogService>();
services.AddScoped<IJobService, JobService>();
services.AddScoped<IJobLogService, JobLogService>();
services.AddScoped<INotificationService, NotificationService>();
services.AddScoped<IFolderService, FolderService>();
services.AddScoped<IFileService, FileService>();
services.AddScoped<ISiteTemplateService, SiteTemplateService>();
services.AddScoped<ISqlService, SqlService>();
services.AddScoped<ISystemService, SystemService>();
services.AddScoped<ILocalizationService, LocalizationService>();
services.AddScoped<ILanguageService, LanguageService>();
services.AddScoped<IDatabaseService, DatabaseService>();
services.AddScoped<IUrlMappingService, UrlMappingService>();
services.AddScoped<IVisitorService, VisitorService>();
services.AddScoped<ISyncService, SyncService>();
return services;
}
}
}

View File

@ -0,0 +1,32 @@
@namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the database server" ResourceKey="Server">Server:</Label>
<div class="col-sm-9">
<input id="server" type="text" class="form-control" @bind="@_server" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="database" HelpText="Enter the name of the database" ResourceKey="Database">Database:</Label>
<div class="col-sm-9">
<input id="database" type="text" class="form-control" @bind="@_database" />
</div>
</div>
@code {
private string _server = "(LocalDb)\\MSSQLLocalDB";
private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
public string GetConnectionString()
{
var connectionString = String.Empty;
if (!String.IsNullOrEmpty(_server) && !String.IsNullOrEmpty(_database))
{
connectionString = $"Data Source={_server};AttachDbFilename=|DataDirectory|\\{_database}.mdf;Initial Catalog={_database};Integrated Security=SSPI;Encrypt=false;";
}
return connectionString;
}
}

View File

@ -0,0 +1,58 @@
@namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the database server" ResourceKey="Server">Server:</Label>
<div class="col-sm-9">
<input id="server" type="text" class="form-control" @bind="@_server" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="port" HelpText="Enter the port used to connect to the server" ResourceKey="Port">Port:</Label>
<div class="col-sm-9">
<input id="port" type="text" class="form-control" @bind="@_port" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="database" HelpText="Enter the name of the database" ResourceKey="Database">Database:</Label>
<div class="col-sm-9">
<input id="database" type="text" class="form-control" @bind="@_database" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="uid" HelpText="Enter the username to use for the database" ResourceKey="Uid">User Id:</Label>
<div class="col-sm-9">
<input id="uid" type="text" class="form-control" @bind="@_uid" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="pwd" HelpText="Enter the password to use for the database" ResourceKey="Pwd">Password:</Label>
<div class="col-sm-9">
<input id="pwd" type="password" class="form-control" @bind="@_pwd" autocomplete="new-password" />
</div>
</div>
@code {
private string _server = "127.0.0.1";
private string _port = "3306";
private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
private string _uid = String.Empty;
private string _pwd = String.Empty;
public string GetConnectionString()
{
var connectionString = String.Empty;
if (!String.IsNullOrEmpty(_server) && !String.IsNullOrEmpty(_database) && !String.IsNullOrEmpty(_uid) && !String.IsNullOrEmpty(_pwd))
{
connectionString = $"Server={_server};Database={_database};Uid={_uid};Pwd={_pwd};";
}
if (!String.IsNullOrEmpty(_port))
{
connectionString += $"Port={_port};";
}
return connectionString;
}
}

View File

@ -0,0 +1,83 @@
@namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl
@inject IStringLocalizer<PostgreSQLConfig> Localizer
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the database server" ResourceKey="Server">Server:</Label>
<div class="col-sm-9">
<input id="server" type="text" class="form-control" @bind="@_server" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="port" HelpText="Enter the port used to connect to the server" ResourceKey="Port">Port:</Label>
<div class="col-sm-9">
<input id="port" type="text" class="form-control" @bind="@_port" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="database" HelpText="Enter the name of the database" ResourceKey="Database">Database:</Label>
<div class="col-sm-9">
<input id="database" type="text" class="form-control" @bind="@_database" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="security" HelpText="Select your security method" ResourceKey="Security">Security:</Label>
<div class="col-sm-9">
<select id="security" class="form-select custom-select" @bind="@_security">
<option value="integrated" selected>@Localizer["Integrated"]</option>
<option value="custom">@Localizer["Custom"]</option>
</select>
</div>
</div>
@if (_security == "custom")
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="uid" HelpText="Enter the username to use for the database" ResourceKey="Uid">User Id:</Label>
<div class="col-sm-9">
<input id="uid" type="text" class="form-control" @bind="@_uid" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="pwd" HelpText="Enter the password to use for the database" ResourceKey="Pwd">Password:</Label>
<div class="col-sm-9">
<input id="pwd" type="password" class="form-control" @bind="@_pwd" autocomplete="new-password" />
</div>
</div>
}
@code {
private string _server = "127.0.0.1";
private string _port = "5432";
private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
private string _security = "integrated";
private string _uid = String.Empty;
private string _pwd = String.Empty;
public string GetConnectionString()
{
var connectionString = String.Empty;
if (!String.IsNullOrEmpty(_server) && !String.IsNullOrEmpty(_database) && !String.IsNullOrEmpty(_port))
{
connectionString = $"Server={_server};Port={_port};Database={_database};";
}
if (_security == "integrated")
{
connectionString += "Integrated Security=true;";
}
else
{
if (!String.IsNullOrEmpty(_uid) && !String.IsNullOrEmpty(_pwd))
{
connectionString += $"User ID={_uid};Password={_pwd};";
}
else
{
connectionString = String.Empty;
}
}
return connectionString;
}
}

View File

@ -0,0 +1,95 @@
@namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl
@inject IStringLocalizer<SqlServerConfig> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the database server name. This might include a port number as well if you are using a cloud service (ie. servername.database.windows.net,1433) " ResourceKey="Server">Server:</Label>
<div class="col-sm-9">
<input id="server" type="text" class="form-control" @bind="@_server" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="database" HelpText="Enter the name of the database" ResourceKey="Database">Database:</Label>
<div class="col-sm-9">
<input id="database" type="text" class="form-control" @bind="@_database" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="security" HelpText="Select your security method" ResourceKey="Security">Security:</Label>
<div class="col-sm-9">
<select id="security" class="form-select custom-select" @bind="@_security">
<option value="integrated" selected>@Localizer["Integrated"]</option>
<option value="custom">@Localizer["Custom"]</option>
</select>
</div>
</div>
@if (_security == "custom")
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="uid" HelpText="Enter the username to use for the database" ResourceKey="Uid">User Id:</Label>
<div class="col-sm-9">
<input id="uid" type="text" class="form-control" @bind="@_uid" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="pwd" HelpText="Enter the password to use for the database" ResourceKey="Pwd">Password:</Label>
<div class="col-sm-9">
<input id="pwd" type="password" class="form-control" @bind="@_pwd" autocomplete="new-password" />
</div>
</div>
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="encryption" HelpText="Specify if you are using an encrypted database connection. It is highly recommended to use encryption in a production environment." ResourceKey="Encryption">Encryption:</Label>
<div class="col-sm-9">
<select id="encryption" class="form-select custom-select" @bind="@_encryption">
<option value="true">@SharedLocalizer["True"]</option>
<option value="false">@SharedLocalizer["False"]</option>
</select>
</div>
</div>
@if (_encryption == "true")
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="trustservercertificate" HelpText="Specify the type of certificate you are using for encryption. Verifiable is equivalent to False. Self Signed is equivalent to True." ResourceKey="TrustServerCertificate">Certificate:</Label>
<div class="col-sm-9">
<select id="encryption" class="form-select custom-select" @bind="@_trustservercertificate">
<option value="true">@Localizer["Self Signed"]</option>
<option value="false">@Localizer["Verifiable"]</option>
</select>
</div>
</div>
}
@code {
private string _server = String.Empty;
private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
private string _security = "integrated";
private string _uid = String.Empty;
private string _pwd = String.Empty;
private string _encryption = "false";
private string _trustservercertificate = "false";
public string GetConnectionString()
{
var connectionString = String.Empty;
if (!String.IsNullOrEmpty(_server) && !String.IsNullOrEmpty(_database))
{
connectionString = $"Data Source={_server};Initial Catalog={_database};";
}
if (_security == "integrated")
{
connectionString += "Integrated Security=SSPI;";
}
else
{
connectionString += $"User ID={_uid};Password={_pwd};";
}
connectionString += $"Encrypt={_encryption};";
connectionString += $"TrustServerCertificate={_trustservercertificate};";
return connectionString;
}
}

View File

@ -0,0 +1,25 @@
@namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the file name to use for the database" ResourceKey="Server">File Name:</Label>
<div class="col-sm-9">
<input id="server" type="text" class="form-control" @bind="@_server" />
</div>
</div>
@code {
private string _server = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm") + ".db";
public string GetConnectionString()
{
var connectionstring = String.Empty;
if (!String.IsNullOrEmpty(_server))
{
connectionstring = $"Data Source={_server};";
}
return connectionstring;
}
}

View File

@ -0,0 +1,294 @@
@namespace Oqtane.Installer
@using Oqtane.Interfaces
@inject NavigationManager NavigationManager
@inject IInstallationService InstallationService
@inject ISiteService SiteService
@inject IUserService UserService
@inject IDatabaseService DatabaseService
@inject IJSRuntime JSRuntime
@inject IStringLocalizer<Installer> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="container">
<div class="row">
<div class="mx-auto text-center">
<img src="oqtane-black.png" />
<div style="font-weight: bold">@SharedLocalizer["Version"] @Constants.Version</div>
</div>
</div>
<hr class="app-rule" />
<div class="row justify-content-center">
<div class="col text-center">
<h2>@Localizer["DatabaseConfig"]</h2><br />
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="databasetype" HelpText="Select the type of database you wish to use" ResourceKey="DatabaseType">Database:</Label>
<div class="col-sm-9">
@if (_databases != null)
{
<div class="input-group">
<select id="databaseType" class="form-select" value="@_databaseName" @onchange="(e => DatabaseChanged(e))" required>
@foreach (var database in _databases)
{
<option value="@database.Name">@Localizer[@database.Name]</option>
}
</select>
@if (!_showConnectionString)
{
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionString"]</button>
}
else
{
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionParameters"]</button>
}
</div>
}
</div>
</div>
@if (!_showConnectionString)
{
if (_databaseConfigType != null)
{
@DatabaseConfigComponent
}
}
else
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="connectionstring" HelpText="Enter a complete connection string including all parameters and delimiters" ResourceKey="ConnectionString">String:</Label>
<div class="col-sm-9">
<textarea id="connectionstring" class="form-control" @bind="@_connectionString" rows="3"></textarea>
</div>
</div>
}
</div>
</div>
<div class="col text-center">
<h2>@Localizer["ApplicationAdmin"]</h2><br />
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="username" HelpText="Provide a username for the primary user accountt" ResourceKey="Username">Username:</Label>
<div class="col-sm-9">
<input id="username" type="text" class="form-control" @bind="@_hostUsername" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="password" HelpText="Provide a password for the primary user account" ResourceKey="Password">Password:</Label>
<div class="col-sm-9">
<div class="input-group">
<input id="password" type="@_passwordType" class="form-control" @bind="@_hostPassword" autocomplete="new-password" />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglePassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirm" HelpText="Please confirm the password entered above by entering it again" ResourceKey="Confirm">Confirm:</Label>
<div class="col-sm-9">
<div class="input-group">
<input id="confirm" type="@_confirmPasswordType" class="form-control" @bind="@_confirmPassword" autocomplete="new-password" />
<button type="button" class="btn btn-secondary" @onclick="@ToggleConfirmPassword">@_toggleConfirmPassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="email" HelpText="Provide the email address for the host user account" ResourceKey="Email">Email:</Label>
<div class="col-sm-9">
<input type="text" class="form-control" @bind="@_hostEmail" />
</div>
</div>
</div>
</div>
</div>
<hr class="app-rule" />
<div class="row">
<div class="mx-auto text-center">
<button type="button" class="btn btn-success" @onclick="Install">@Localizer["InstallNow"]</button><br /><br />
<ModuleMessage Message="@_message" Type="MessageType.Error"></ModuleMessage>
</div>
<div class="app-progress-indicator" style="@_loadingDisplay"></div>
</div>
<div class="row">
<div class="mx-auto text-center">
<input type="checkbox" @bind="@_register" /> @Localizer["Register"]
</div>
</div>
</div>
@code {
private List<Database> _databases;
private string _databaseName;
private Type _databaseConfigType;
private object _databaseConfig;
private RenderFragment DatabaseConfigComponent { get; set; }
private bool _showConnectionString = false;
private string _connectionString = string.Empty;
private string _hostUsername = string.Empty;
private string _hostPassword = string.Empty;
private string _passwordType = "password";
private string _confirmPasswordType = "password";
private string _togglePassword = string.Empty;
private string _toggleConfirmPassword = string.Empty;
private string _confirmPassword = string.Empty;
private string _hostEmail = string.Empty;
private bool _register = true;
private string _message = string.Empty;
private string _loadingDisplay = "display: none;";
protected override async Task OnInitializedAsync()
{
_togglePassword = SharedLocalizer["ShowPassword"];
_toggleConfirmPassword = SharedLocalizer["ShowPassword"];
_databases = await DatabaseService.GetDatabasesAsync();
if (_databases.Exists(item => item.IsDefault))
{
_databaseName = _databases.Find(item => item.IsDefault).Name;
}
else
{
_databaseName = "LocalDB";
}
LoadDatabaseConfigComponent();
}
private void DatabaseChanged(ChangeEventArgs eventArgs)
{
try
{
_databaseName = (string)eventArgs.Value;
_showConnectionString = false;
LoadDatabaseConfigComponent();
}
catch
{
_message = Localizer["Error.DbConfig.Load"];
}
}
private void LoadDatabaseConfigComponent()
{
var database = _databases.SingleOrDefault(d => d.Name == _databaseName);
if (database != null)
{
_databaseConfigType = Type.GetType(database.ControlType);
DatabaseConfigComponent = builder =>
{
builder.OpenComponent(0, _databaseConfigType);
builder.AddComponentReferenceCapture(1, inst => { _databaseConfig = Convert.ChangeType(inst, _databaseConfigType); });
builder.CloseComponent();
};
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
var interop = new Interop(JSRuntime);
await interop.IncludeLink("", "stylesheet", "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.0/css/bootstrap.min.css", "text/css", "sha512-XWTTruHZEYJsxV3W/lSXG1n3Q39YIWOstqvmFsdNEEQfHoZ6vm6E9GK2OrF6DSJSpIbRbi+Nn0WDPID9O7xB2Q==", "anonymous", "");
await interop.IncludeScript("", "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.0/js/bootstrap.bundle.min.js", "sha512-9GacT4119eY3AcosfWtHMsT5JyZudrexyEVzTBWV3viP/YfB9e2pEy3N7WXL3SV6ASXpTU0vzzSxsbfsuUH4sQ==", "anonymous", "", "head");
}
}
private async Task Install()
{
var connectionString = String.Empty;
if (_showConnectionString)
{
connectionString = _connectionString;
}
else
{
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
{
connectionString = databaseConfigControl.GetConnectionString();
}
}
if (connectionString != "" && !string.IsNullOrEmpty(_hostUsername) && !string.IsNullOrEmpty(_hostPassword) && _hostPassword == _confirmPassword && !string.IsNullOrEmpty(_hostEmail) && _hostEmail.Contains("@"))
{
if (await UserService.ValidatePasswordAsync(_hostPassword))
{
_loadingDisplay = "";
StateHasChanged();
Uri uri = new Uri(NavigationManager.Uri);
var database = _databases.SingleOrDefault(d => d.Name == _databaseName);
var config = new InstallConfig
{
DatabaseType = database.DBType,
ConnectionString = connectionString,
Aliases = uri.Authority,
HostUsername = _hostUsername,
HostPassword = _hostPassword,
HostEmail = _hostEmail,
HostName = _hostUsername,
TenantName = TenantNames.Master,
IsNewTenant = true,
SiteName = Constants.DefaultSite,
Register = _register
};
var installation = await InstallationService.Install(config);
if (installation.Success)
{
NavigationManager.NavigateTo(uri.Scheme + "://" + uri.Authority, true);
}
else
{
_message = installation.Message;
_loadingDisplay = "display: none;";
}
}
else
{
_message = Localizer["Message.Password.Invalid"];
}
}
else
{
_message = Localizer["Message.Require.DbInfo"];
}
}
private void TogglePassword()
{
if (_passwordType == "password")
{
_passwordType = "text";
_togglePassword = SharedLocalizer["HidePassword"];
}
else
{
_passwordType = "password";
_togglePassword = SharedLocalizer["ShowPassword"];
}
}
private void ToggleConfirmPassword()
{
if (_confirmPasswordType == "password")
{
_confirmPasswordType = "text";
_toggleConfirmPassword = SharedLocalizer["HidePassword"];
}
else
{
_confirmPasswordType = "password";
_toggleConfirmPassword = SharedLocalizer["ShowPassword"];
}
}
private void ToggleConnectionString()
{
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
{
_connectionString = databaseConfigControl.GetConnectionString();
}
_showConnectionString = !_showConnectionString;
}
}

View File

@ -1,7 +1,8 @@
@namespace Oqtane.Modules.Admin.Dashboard
@namespace Oqtane.Modules.Admin.Dashboard
@inherits ModuleBase
@inject IPageService PageService
@inject IUserService UserService
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="row">
@foreach (var p in _pages)
@ -9,9 +10,9 @@
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
{
string url = NavigateUrl(p.Path);
<div class="col-md-2 mx-auto text-center">
<NavLink class="nav-link" href="@url" Match="NavLinkMatch.All">
<h2><span class="oi oi-@p.Icon" aria-hidden="true"></span></h2>@p.Name
<div class="col-md-2 mx-auto text-center mb-3">
<NavLink class="nav-link text-primary" href="@url" Match="NavLinkMatch.All">
<h2><span class="@p.Icon" aria-hidden="true"></span></h2>@SharedLocalizer[p.Name]
</NavLink>
</div>
}
@ -20,7 +21,7 @@
@code {
private List<Page> _pages;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override void OnInitialized()

View File

@ -1,6 +1,7 @@
@namespace Oqtane.Modules.Admin.Error
@namespace Oqtane.Modules.Admin.Error
@inherits ModuleBase
@inject IModuleService ModuleService
@inject IStringLocalizer<Index> Localizer
@code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
@ -8,12 +9,11 @@
protected override async Task OnInitializedAsync()
{
Module module = await ModuleService.GetModuleAsync(ModuleState.ModuleId);
if (UserSecurity.IsAuthorized(PageState.User, Constants.HostRole))
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
string message = "A Problem Was Encountered Loading Module " + module.ModuleDefinitionName;
AddModuleMessage(message, MessageType.Error);
AddModuleMessage(string.Format(Localizer["Error.Module.Load"], module.ModuleDefinitionName), MessageType.Error);
}
await logger.LogCritical("Error Loading Module {Module}", module);
}
}

View File

@ -1,60 +1,68 @@
@namespace Oqtane.Modules.Admin.Files
@namespace Oqtane.Modules.Admin.Files
@using System.IO
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IFileService FileService
@inject IFolderService FolderService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<TabStrip>
<TabPanel Name="Upload" Heading="Upload Files">
<table class="table table-borderless">
<tr>
<td>
<Label For="upload" HelpText="Upload the file you want">Upload: </Label>
</td>
<td>
<FileManager UploadMultiple="true" ShowFiles="false" FolderId="@_folderId.ToString()" />
</td>
</tr>
</table>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<TabPanel Name="Upload" Heading="Upload Files" ResourceKey="UploadFiles">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="upload" HelpText="Upload the file you want" ResourceKey="Upload">Upload: </Label>
<div class="col-sm-9">
<FileManager UploadMultiple="true" ShowFiles="false" FolderId="@_folderId" ShowSuccess="true" />
</div>
</div>
</div>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</TabPanel>
<TabPanel Name="Download" Heading="Download Files">
<TabPanel Name="Download" Heading="Download Files" ResourceKey="DownloadFiles">
@if (_folders != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="url" HelpText="Enter the url of the file you wish to download">Url: </Label>
</td>
<td>
<input id="url" class="form-control" @bind="@url" />
</td>
</tr>
<tr>
<td>
<Label For="folder" HelpText="Select the folder to save the file in">Folder: </Label>
</td>
<td>
<select id="folder" class="form-control" @bind="@_folderId">
<option value="-1">&lt;Select Folder&gt;</option>
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Download">Download</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="Enter the url of the file you wish to download" ResourceKey="Url">Url: </Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="folder" HelpText="Select the folder to save the file in" ResourceKey="Folder">Folder: </Label>
<div class="col-sm-9">
<select id="folder" class="form-select" @bind="@_folderId" required>
<option value="-1">&lt;@Localizer["Folder.Select"]&gt;</option>
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the name of the file being downloaded" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" />
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="Download">@SharedLocalizer["Download"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</form>
}
</TabPanel>
</TabStrip>
@code {
private string url = string.Empty;
private ElementReference form;
private bool validated = false;
private string _url = string.Empty;
private List<Folder> _folders;
private int _folderId = -1;
private string _name = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
@ -70,23 +78,48 @@
private async Task Download()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (url != string.Empty && _folderId != -1)
if (_url == string.Empty || _folderId == -1)
{
await FileService.UploadFileAsync(url, _folderId);
await logger.LogInformation("File Downloaded Successfully From Url {Url}", url);
AddModuleMessage("File Downloaded Successfully From Url", MessageType.Success);
AddModuleMessage(Localizer["Message.Required.UrlFolder"], MessageType.Warning);
return;
}
else
if (string.IsNullOrEmpty(_name))
{
AddModuleMessage("You Must Enter A Url And Select A Folder", MessageType.Warning);
_name = _url.Substring(_url.LastIndexOf("/", StringComparison.Ordinal) + 1);
}
if (!Constants.UploadableFiles.Split(',').Contains(Path.GetExtension(_name).ToLower().Replace(".", "")))
{
AddModuleMessage(Localizer["Message.Download.InvalidExtension"], MessageType.Warning);
return;
}
if (!_name.IsPathOrFileValid())
{
AddModuleMessage(Localizer["Message.Required.UrlName"], MessageType.Warning);
return;
}
try
{
await FileService.UploadFileAsync(_url, _folderId, _name);
await logger.LogInformation("File Downloaded Successfully From Url {Url}", _url);
AddModuleMessage(Localizer["Success.Download.File"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading File From Url {Url} {Error}", _url, ex.Message);
AddModuleMessage(Localizer["Error.Download.InvalidUrl"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Downloading File From Url {Url} {Error}", url, ex.Message);
AddModuleMessage("Error Downloading File From Url. Please Verify That The Url Is Valid.", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}
}

View File

@ -0,0 +1,129 @@
@namespace Oqtane.Modules.Admin.Files
@inherits ModuleBase
@inject IFileService FileService
@inject IFolderService FolderService
@inject NavigationManager NavigationManager
@inject IStringLocalizer<Details> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_folders != null)
{
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="The name of the file" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="50" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="parent" HelpText="The folder where the file is located" ResourceKey="Folder">Folder: </Label>
<div class="col-sm-9">
<select id="parent" class="form-select" @bind="@_folderId" required>
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="A description of the file. This can be used as a caption for image files." ResourceKey="Description">Description: </Label>
<div class="col-sm-9">
<input id="description" class="form-control" @bind="@_description" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="size" HelpText="The size of the file (in bytes)" ResourceKey="Size">Size: </Label>
<div class="col-sm-9">
<input id="size" class="form-control" @bind="@_size" readonly />
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="SaveFile">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<AuditInfo CreatedBy="@_createdBy" CreatedOn="@_createdOn" ModifiedBy="@_modifiedBy" ModifiedOn="@_modifiedOn"></AuditInfo>
</form>
}
@code {
private ElementReference form;
private bool validated = false;
private int _fileId = -1;
private string _name;
private List<Folder> _folders;
private int _folderId = -1;
private string _description = string.Empty;
private int _size;
private string _createdBy;
private DateTime _createdOn;
private string _modifiedBy;
private DateTime _modifiedOn;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
public override string Title => "File Management";
protected override async Task OnInitializedAsync()
{
try
{
_folders = await FolderService.GetFoldersAsync(PageState.Site.SiteId);
_fileId = Int32.Parse(PageState.QueryString["id"]);
File file = await FileService.GetFileAsync(_fileId);
if (file != null)
{
_name = file.Name;
_folderId = file.FolderId;
_description = file.Description;
_size = file.Size;
_createdBy = file.CreatedBy;
_createdOn = file.CreatedOn;
_modifiedBy = file.ModifiedBy;
_modifiedOn = file.ModifiedOn;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading File {FileId} {Error}", _fileId, ex.Message);
AddModuleMessage(Localizer["Error.File.Load"], MessageType.Error);
}
}
private async Task SaveFile()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
try
{
if (_name.IsPathOrFileValid())
{
File file = await FileService.GetFileAsync(_fileId);
file.Name = _name;
file.FolderId = _folderId;
file.Description = _description;
file = await FileService.UpdateFileAsync(file);
await logger.LogInformation("File Saved {File}", file);
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage(Localizer["Message.File.InvalidName"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving File {FileId} {Error}", _fileId, ex.Message);
AddModuleMessage(Localizer["Error.File.Save"], MessageType.Error);
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -1,51 +1,84 @@
@namespace Oqtane.Modules.Admin.Files
@namespace Oqtane.Modules.Admin.Files
@inherits ModuleBase
@inject IFolderService FolderService
@inject IFileService FileService
@inject NavigationManager NavigationManager
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_folders != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="parent" HelpText="Select the parent folder">Parent: </Label>
</td>
<td>
<select id="parent" class="form-control" @bind="@_parentId">
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="parent" HelpText="Select the parent folder" ResourceKey="Parent">Parent: </Label>
<div class="col-sm-9">
<select id="parent" class="form-select" @bind="@_parentId" required>
@if (PageState.QueryString.ContainsKey("id"))
{
<option value="-1">&lt;@Localizer["NoParent"]&gt;</option>
}
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the folder name" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="256" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="type" HelpText="Select the folder type. Private folders are only accessible by authorized users. Public folders can be accessed by all users" ResourceKey="Type">Type: </Label>
<div class="col-sm-9">
@if (PageState.QueryString.ContainsKey("id"))
{
<option value="-1">&lt;No Parent&gt;</option>
<input id="type" class="form-control" readonly @bind="@_type" />
}
@foreach (Folder folder in _folders)
else
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
<select id="type" class="form-select" @bind="@_type" required>
<option value="@FolderTypes.Private">@Localizer[FolderTypes.Private]</option>
<option value="@FolderTypes.Public">@Localizer[FolderTypes.Public]</option>
</select>
}
</select>
</td>
</tr>
<tr>
<td>
<Label for="name" HelpText="Enter the file name">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<Label For="permissions" HelpText="Select the permissions you want for the folder">Permissions: </Label>
<PermissionGrid EntityName="@EntityNames.Folder" PermissionNames="Browse,View,Edit" Permissions="@_permissions" @ref="_permissionGrid" />
</td>
</tr>
</table>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="imagesizes" HelpText="Enter a list of image sizes which can be generated dynamically from uploaded images (ie. 200x200,x200,200x)" ResourceKey="ImageSizes">Image Sizes: </Label>
<div class="col-sm-9">
<input id="imagesizes" class="form-control" @bind="@_imagesizes" maxlength="512" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="capacity" HelpText="Enter the maximum folder capacity (in megabytes). Specify zero if the capacity is unlimited." ResourceKey="Capacity">Capacity: </Label>
<div class="col-sm-9">
<input id="capacity" class="form-control" @bind="@_capacity" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<div class="col-sm-12">
<Label Class="col-sm-3" For="permissions" HelpText="Select the permissions you want for the folder" ResourceKey="Permissions">Permissions: </Label>
<PermissionGrid EntityName="@EntityNames.Folder" PermissionNames="@(PermissionNames.Browse + "," + PermissionNames.View + "," + PermissionNames.Edit)" Permissions="@_permissions" @ref="_permissionGrid" />
</div>
</div>
</div>
</form>
@if (!_isSystem)
{
<button type="button" class="btn btn-success" @onclick="SaveFolder">Save</button>
<button type="button" class="btn btn-success" @onclick="SaveFolder">@SharedLocalizer["Save"]</button>
@((MarkupString)"&nbsp;")
}
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
@if (!_isSystem && PageState.QueryString.ContainsKey("id"))
{
<button type="button" class="btn btn-danger" @onclick="DeleteFolder">Delete</button>
@((MarkupString)"&nbsp;")
<ActionDialog Header="Delete Folder" Message="Are You Sure You Wish To Delete This Folder?" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFolder())" ResourceKey="DeleteFolder" />
}
<br />
<br />
@ -56,10 +89,15 @@
}
@code {
private ElementReference form;
private bool validated = false;
private List<Folder> _folders;
private int _folderId = -1;
private string _name;
private int _parentId = -1;
private string _name;
private string _type = FolderTypes.Private;
private string _imagesizes = string.Empty;
private string _capacity = "0";
private bool _isSystem;
private string _permissions = string.Empty;
private string _createdBy;
@ -89,6 +127,9 @@
{
_parentId = folder.ParentId ?? -1;
_name = folder.Name;
_type = folder.Type;
_imagesizes = folder.ImageSizes;
_capacity = folder.Capacity.ToString();
_isSystem = folder.IsSystem;
_permissions = folder.Permissions;
_createdBy = folder.CreatedBy;
@ -100,21 +141,34 @@
else
{
_parentId = _folders[0].FolderId;
_permissions = string.Empty;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Folder {FolderId} {Error}", _folderId, ex.Message);
AddModuleMessage("Error Loading Folder", MessageType.Error);
AddModuleMessage(Localizer["Error.Folder.Load"], MessageType.Error);
}
}
private async Task SaveFolder()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (_name != string.Empty && _parentId != -1)
if (_name == string.Empty || _parentId == -1)
{
AddModuleMessage(Localizer["Message.Required.FolderParent"], MessageType.Warning);
return;
}
if (!_name.IsPathOrFileValid())
{
AddModuleMessage(Localizer["Message.Folder.InvalidName"], MessageType.Warning);
return;
}
try
{
Folder folder;
if (_folderId != -1)
@ -138,6 +192,9 @@
}
folder.Name = _name;
folder.Type = _type;
folder.ImageSizes = _imagesizes;
folder.Capacity = int.Parse(_capacity);
folder.IsSystem = _isSystem;
folder.Permissions = _permissionGrid.GetPermissions();
@ -150,19 +207,26 @@
folder = await FolderService.AddFolderAsync(folder);
}
await FolderService.UpdateFolderOrderAsync(folder.SiteId, folder.FolderId, folder.ParentId);
await logger.LogInformation("Folder Saved {Folder}", folder);
NavigationManager.NavigateTo(NavigateUrl());
if (folder != null)
{
await FolderService.UpdateFolderOrderAsync(folder.SiteId, folder.FolderId, folder.ParentId);
await logger.LogInformation("Folder Saved {Folder}", folder);
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage(Localizer["Error.Folder.Save"], MessageType.Error);
}
}
else
catch (Exception ex)
{
AddModuleMessage("Folders Must Have A Parent And A Name", MessageType.Warning);
await logger.LogError(ex, "Error Saving Folder {FolderId} {Error}", _folderId, ex.Message);
AddModuleMessage(Localizer["Error.Folder.Save"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Saving Folder {FolderId} {Error}", _folderId, ex.Message);
AddModuleMessage("Error Saving Module", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
@ -170,14 +234,38 @@
{
try
{
await FolderService.DeleteFolderAsync(_folderId);
await logger.LogInformation("Folder Deleted {Folder}", _folderId);
AddModuleMessage("Folder Deleted", MessageType.Success);
bool isparent = false;
foreach (Folder folder in _folders)
{
if (folder.ParentId == _folderId)
{
isparent = true;
break;
}
}
if (!isparent)
{
var files = await FileService.GetFilesAsync(_folderId);
if (files.Count == 0)
{
await FolderService.DeleteFolderAsync(_folderId);
await logger.LogInformation("Folder Deleted {Folder}", _folderId);
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage(Localizer["Message.Folder.Files.InvalidDelete"], MessageType.Warning);
}
}
else
{
AddModuleMessage(Localizer["Message.Folder.Subfolders.InvalidDelete"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Folder {Folder} {Error}", _folderId, ex.Message);
AddModuleMessage("Error Deleting Folder", MessageType.Error);
AddModuleMessage(Localizer["Error.Folder.Delete"], MessageType.Error);
}
}
}
}

View File

@ -1,50 +1,54 @@
@namespace Oqtane.Modules.Admin.Files
@namespace Oqtane.Modules.Admin.Files
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IFolderService FolderService
@inject IFileService FileService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_files != null)
{
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">Folder: </label>
</td>
<td>
<select class="form-control" @onchange="(e => FolderChanged(e))">
<div class="container">
<div class="row mb-1 align-items-center">
<div class="col-sm-2">
<label class="control-label">@Localizer["Folder"] </label>
</div>
<div class="col-sm-6">
<select class="form-select" @onchange="(e => FolderChanged(e))">
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</td>
<td>
<ActionLink Action="Edit" Text="Edit Folder" Class="btn btn-secondary" Parameters="@($"id=" + _folderId.ToString())" />&nbsp;
<ActionLink Action="Edit" Text="Add Folder" Class="btn btn-secondary" />&nbsp;
<ActionLink Action="Add" Text="Upload Files" Parameters="@($"id=" + _folderId.ToString())" />
</td>
</tr>
</table>
</div>
<div class="col-sm-4">
<ActionLink Action="Edit" Text="Edit Folder" Class="btn btn-secondary" Parameters="@($"id=" + _folderId.ToString())" ResourceKey="EditFolder" />&nbsp;
<ActionLink Action="Edit" Text="Add Folder" Class="btn btn-secondary" ResourceKey="AddFolder" />&nbsp;
<ActionLink Action="Add" Text="Upload Files" Parameters="@($"id=" + _folderId.ToString())" ResourceKey="UploadFiles" />
</div>
</div>
</div>
<Pager Items="@_files">
<Header>
<th>&nbsp;</th>
<th>Name</th>
<th>Modified</th>
<th>Type</th>
<th>Size</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@Localizer["Modified"]</th>
<th>@Localizer["Type"]</th>
<th>@Localizer["Size"]</th>
</Header>
<Row>
<td><ActionDialog Header="Delete File" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" /></td>
<td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td>
<td><ActionLink Action="Details" Text="Edit" Parameters="@($"id=" + context.FileId.ToString())" ResourceKey="Details" /></td>
<td><ActionDialog Header="Delete File" Message="@string.Format(Localizer["Confirm.File.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" ResourceKey="DeleteFile" /></td>
<td><a href="@context.Url" target="_new">@context.Name</a></td>
<td>@context.ModifiedOn</td>
<td>@context.Extension.ToUpper() File</td>
<td>@(context.Size / 1000) KB</td>
<td>@context.Extension.ToUpper() @SharedLocalizer["File"]</td>
<td>@string.Format("{0:0.00}", ((decimal)context.Size / 1000)) KB</td>
</Row>
</Pager>
@if (_files.Count == 0)
{
<div class="text-center">No Files Exist In Selected Folder</div>
<div class="text-center">@Localizer["NoFiles"]</div>
}
}
@ -60,7 +64,7 @@
try
{
_folders = await FolderService.GetFoldersAsync(PageState.Site.SiteId);
if (_folderId == -1 && _folders.Count > 0)
{
_folderId = _folders[0].FolderId;
@ -70,7 +74,7 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Files {Error}", ex.Message);
AddModuleMessage("Error Loading Files", MessageType.Error);
AddModuleMessage(Localizer["Error.File.Load"], MessageType.Error);
}
}
@ -90,7 +94,7 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Files {Error}", ex.Message);
AddModuleMessage("Error Loading Files", MessageType.Error);
AddModuleMessage(Localizer["Error.File.Load"], MessageType.Error);
}
}
@ -100,14 +104,14 @@
{
await FileService.DeleteFileAsync(file.FileId);
await logger.LogInformation("File Deleted {File}", file.Name);
AddModuleMessage("File " + file.Name + " Deleted", MessageType.Success);
AddModuleMessage(string.Format(Localizer["Success.File.Delete"], file.Name), MessageType.Success);
await GetFiles();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting File {File} {Error}", file.Name, ex.Message);
AddModuleMessage("Error Deleting File " + file.Name, MessageType.Error);
AddModuleMessage(string.Format(Localizer["Error.File.Delete"], file.Name), MessageType.Error);
}
}
}

View File

@ -1,140 +0,0 @@
@namespace Oqtane.Modules.Admin.Jobs
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IJobService JobService
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Enter the job name">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="type" HelpText="Enter the job type">Type: </Label>
</td>
<td>
<input id="type" class="form-control" @bind="@_jobType" />
</td>
</tr>
<tr>
<td>
<Label For="enabled" HelpText="Select whether you want the job enabled or not">Enabled? </Label>
</td>
<td>
<select id="enabled" class="form-control" @bind="@_isEnabled">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="runs-every" HelpText="Select how often you want the job to run">Runs Every: </Label>
</td>
<td>
<input id="runs-every" class="form-control" @bind="@_interval" />
<select id="runs-every" class="form-control" @bind="@_frequency">
<option value="m">Minute(s)</option>
<option value="H">Hour(s)</option>
<option value="d">Day(s)</option>
<option value="M">Month(s)</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="starting" HelpText="What time do you want the job to start">Starting: </Label>
</td>
<td>
<input id="starting" class="form-control" @bind="@_startDate" />
</td>
</tr>
<tr>
<td>
<Label For="ending" HelpText="When do you want the job to end">Ending: </Label>
</td>
<td>
<input id="ending" class="form-control" @bind="@_endDate" />
</td>
</tr>
<tr>
<td>
<Label For="retention-log" HelpText="What items do you want in the retention log">Retention Log (Items): </Label>
</td>
<td>
<input id="retention-log" class="form-control" @bind="@_retentionHistory" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveJob">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
@code {
private string _name = string.Empty;
private string _jobType = string.Empty;
private string _isEnabled = "True";
private string _interval = string.Empty;
private string _frequency = string.Empty;
private string _startDate = string.Empty;
private string _endDate = string.Empty;
private string _retentionHistory = "10";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
private async Task SaveJob()
{
if (_name != string.Empty && !string.IsNullOrEmpty(_jobType) && _frequency != string.Empty && _interval != string.Empty && _retentionHistory != string.Empty)
{
var job = new Job();
job.Name = _name;
job.JobType = _jobType;
job.IsEnabled = Boolean.Parse(_isEnabled);
job.Frequency = _frequency;
job.Interval = int.Parse(_interval);
if (_startDate == string.Empty)
{
job.StartDate = null;
}
else
{
job.StartDate = DateTime.Parse(_startDate);
}
if (_endDate == string.Empty)
{
job.EndDate = null;
}
else
{
job.EndDate = DateTime.Parse(_endDate);
}
job.RetentionHistory = int.Parse(_retentionHistory);
job.IsStarted = false;
job.IsExecuting = false;
job.NextExecution = null;
try
{
job = await JobService.AddJobAsync(job);
await logger.LogInformation("Job Added {Job}", job);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Job {Job} {Error}", job, ex.Message);
AddModuleMessage("Error Adding Job", MessageType.Error);
}
}
else
{
AddModuleMessage("You Must Provide The Job Name, Type, Frequency, and Retention", MessageType.Warning);
}
}
}

View File

@ -1,163 +1,194 @@
@namespace Oqtane.Modules.Admin.Jobs
@namespace Oqtane.Modules.Admin.Jobs
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IJobService JobService
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Enter the job name">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="type" HelpText="Enter the job type">Type: </Label>
</td>
<td>
<input id="type" class="form-control" @bind="@_jobType" />
</td>
</tr>
<tr>
<td>
<Label For="enabled" HelpText="Select whether you want the job enabled or not">Enabled? </Label>
</td>
<td>
<select id="enabled" class="form-control" @bind="@_isEnabled">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="runs-every" HelpText="Select how often you want the job to run">Runs Every: </Label>
</td>
<td>
<input id="runs-every" class="form-control" @bind="@_interval" />
<select id="runs-every" class="form-control" @bind="@_frequency">
<option value="m">Minute(s)</option>
<option value="H">Hour(s)</option>
<option value="d">Day(s)</option>
<option value="M">Month(s)</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="starting" HelpText="What time do you want the job to start">Starting: </Label>
</td>
<td>
<input id="starting" class="form-control" @bind="@_startDate" />
</td>
</tr>
<tr>
<td>
<Label For="ending" HelpText="When do you want the job to end">Ending: </Label>
</td>
<td>
<input id="ending" class="form-control" @bind="@_endDate" />
</td>
</tr>
<tr>
<td>
<Label For="retention-log" HelpText="What items do you want in the retention log">Retention Log (Items): </Label>
</td>
<td>
<input id="retention-log" class="form-control" @bind="@_retentionHistory" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveJob">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the job name" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="200" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="type" HelpText="The fully qualified job type name" ResourceKey="Type">Type: </Label>
<div class="col-sm-9">
<input id="type" class="form-control" @bind="@_jobType" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="enabled" HelpText="Select whether you want the job enabled or not" ResourceKey="Enabled">Enabled? </Label>
<div class="col-sm-9">
<select id="enabled" class="form-select" @bind="@_isEnabled" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="runs-every" HelpText="Select how often you want the job to run" ResourceKey="RunsEvery">Runs Every: </Label>
<div class="col-sm-9">
<input id="runs-every" class="form-control" @bind="@_interval" maxlength="4" required />
<select id="runs-every" class="form-select" @bind="@_frequency" required>
<option value="m">@Localizer["Minute(s)"]</option>
<option value="H">@Localizer["Hour(s)"]</option>
<option value="d">@Localizer["Day(s)"]</option>
<option value="w">@Localizer["Week(s)"]</option>
<option value="M">@Localizer["Month(s)"]</option>
<option value="O">@Localizer["Once"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="retention" HelpText="Number of log entries to retain for this job" ResourceKey="RetentionLog">Retention Log (Items): </Label>
<div class="col-sm-9">
<input id="retention" class="form-control" @bind="@_retentionHistory" maxlength="4" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="starting" HelpText="Optionally enter the date and time when this job should start executing" ResourceKey="Starting">Starting: </Label>
<div class="col-sm-9">
<div class="row">
<div class="col">
<input id="starting" type="date" class="form-control" @bind="@_startDate" />
</div>
<div class="col">
<input id="starting" type="text" class="form-control" placeholder="hh:mm" @bind="@_startTime" />
</div>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="ending" HelpText="Optionally enter the date and time when this job should stop executing" ResourceKey="Ending">Ending: </Label>
<div class="col-sm-9">
<div class="row">
<div class="col">
<input id="ending" type="date" class="form-control" @bind="@_endDate" />
</div>
<div class="col">
<input id="ending" type="text" class="form-control" placeholder="hh:mm" @bind="@_endTime" />
</div>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="next" HelpText="Optionally modify the date and time when this job should execute next" ResourceKey="NextExecution">Next Execution: </Label>
<div class="col-sm-9">
<div class="row">
<div class="col">
<input id="next" type="date" class="form-control" @bind="@_nextDate" />
</div>
<div class="col">
<input id="next" type="text" class="form-control" placeholder="hh:mm" @bind="@_nextTime" />
</div>
</div>
</div>
</div>
</div>
<br />
<button type="button" class="btn btn-success" @onclick="SaveJob">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon"></AuditInfo>
</form>
@code {
private int _jobId;
private string _name = string.Empty;
private string _jobType = string.Empty;
private string _isEnabled = "True";
private string _interval = string.Empty;
private string _frequency = string.Empty;
private string _startDate = string.Empty;
private string _endDate = string.Empty;
private string _retentionHistory = string.Empty;
private ElementReference form;
private bool validated = false;
private int _jobId;
private string _name = string.Empty;
private string _jobType = string.Empty;
private string _isEnabled = "True";
private string _interval = string.Empty;
private string _frequency = string.Empty;
private DateTime? _startDate = null;
private string _startTime = string.Empty;
private DateTime? _endDate = null;
private string _endTime = string.Empty;
private string _retentionHistory = string.Empty;
private DateTime? _nextDate = null;
private string _nextTime = string.Empty;
private string createdby;
private DateTime createdon;
private string modifiedby;
private DateTime modifiedon;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
_jobId = Int32.Parse(PageState.QueryString["id"]);
Job job = await JobService.GetJobAsync(_jobId);
if (job != null)
{
_name = job.Name;
_jobType = job.JobType;
_isEnabled = job.IsEnabled.ToString();
_interval = job.Interval.ToString();
_frequency = job.Frequency;
_startDate = (job.StartDate != null) ? job.StartDate.ToString() : string.Empty;
_endDate = (job.EndDate != null) ? job.EndDate.ToString() : string.Empty;
_retentionHistory = job.RetentionHistory.ToString();
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Job {JobId} {Error}", _jobId, ex.Message);
AddModuleMessage("Error Loading Job", MessageType.Error);
}
}
protected override async Task OnInitializedAsync()
{
try
{
_jobId = Int32.Parse(PageState.QueryString["id"]);
Job job = await JobService.GetJobAsync(_jobId);
if (job != null)
{
_name = job.Name;
_jobType = job.JobType;
_isEnabled = job.IsEnabled.ToString();
_interval = job.Interval.ToString();
_frequency = job.Frequency;
(_startDate, _startTime) = Utilities.UtcAsLocalDateAndTime(job.StartDate);
(_endDate, _endTime) = Utilities.UtcAsLocalDateAndTime(job.EndDate);
_retentionHistory = job.RetentionHistory.ToString();
(_nextDate, _nextTime) = Utilities.UtcAsLocalDateAndTime(job.NextExecution);
createdby = job.CreatedBy;
createdon = job.CreatedOn;
modifiedby = job.ModifiedBy;
modifiedon = job.ModifiedOn;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Job {JobId} {Error}", _jobId, ex.Message);
AddModuleMessage(Localizer["Error.Job.Load"], MessageType.Error);
}
}
private async Task SaveJob()
{
if (_name != string.Empty && !string.IsNullOrEmpty(_jobType) && _frequency != string.Empty && _interval != string.Empty && _retentionHistory != string.Empty)
{
var job = await JobService.GetJobAsync(_jobId);
job.Name = _name;
job.JobType = _jobType;
job.IsEnabled = Boolean.Parse(_isEnabled);
job.Frequency = _frequency;
job.Interval = int.Parse(_interval);
private async Task SaveJob()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
var job = await JobService.GetJobAsync(_jobId);
job.Name = _name;
job.JobType = _jobType;
job.IsEnabled = Boolean.Parse(_isEnabled);
job.Frequency = _frequency;
if (job.Frequency == "O") // once
{
job.Interval = 1;
}
else
{
job.Interval = int.Parse(_interval);
}
job.StartDate = Utilities.LocalDateAndTimeAsUtc(_startDate, _startTime);
job.EndDate = Utilities.LocalDateAndTimeAsUtc(_endDate, _endTime);
job.RetentionHistory = int.Parse(_retentionHistory);
job.NextExecution = Utilities.LocalDateAndTimeAsUtc(_nextDate, _nextTime);
if (_startDate == string.Empty)
{
job.StartDate = null;
}
else
{
job.StartDate = DateTime.Parse(_startDate);
}
if (_endDate == string.Empty)
{
job.EndDate = null;
}
else
{
job.EndDate = DateTime.Parse(_endDate);
}
job.RetentionHistory = int.Parse(_retentionHistory);
try
{
job = await JobService.UpdateJobAsync(job);
await logger.LogInformation("Job Updated {Job}", job);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Udate Job {Job} {Error}", job, ex.Message);
AddModuleMessage("Error Updating Job", MessageType.Error);
}
}
else
{
AddModuleMessage("You Must Provide The Job Name, Type, Frequency, and Retention", MessageType.Warning);
}
}
try
{
job = await JobService.UpdateJobAsync(job);
await logger.LogInformation("Job Updated {Job}", job);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Udate Job {Job} {Error}", job, ex.Message);
AddModuleMessage(Localizer["Error.Job.Update"], MessageType.Error);
}
}
else
{
AddModuleMessage(Localizer["Message.Required.JobInfo"], MessageType.Warning);
}
}
}

View File

@ -1,45 +1,47 @@
@namespace Oqtane.Modules.Admin.Jobs
@namespace Oqtane.Modules.Admin.Jobs
@inherits ModuleBase
@inject IJobService JobService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_jobs == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Text="Add Job" />
<ActionLink Action="Log" Class="btn btn-secondary" Text="View Logs" />
<ActionLink Action="Log" Class="btn btn-secondary" Text="View Logs" ResourceKey="ViewJobs" />
<button type="button" class="btn btn-secondary" @onclick="(async () => await Refresh())">Refresh</button>
<br /><br />
<br />
<br />
<Pager Items="@_jobs">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th>Status</th>
<th>Frequency</th>
<th>Next Execution</th>
<th>&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@SharedLocalizer["Status"]</th>
<th>@Localizer["Frequency"]</th>
<th>@Localizer["NextExecution"]</th>
<th style="width: 1px;">&nbsp;</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.JobId.ToString())" /></td>
<td><ActionDialog Header="Delete Job" Message="@("Are You Sure You Wish To Delete This Job?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteJob(context))" /></td>
<td><ActionLink Action="Log" Class="btn btn-secondary" Parameters="@($"id=" + context.JobId.ToString())" /></td>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.JobId.ToString())" ResourceKey="EditJob" /></td>
<td><ActionDialog Header="Delete Job" Message="Are You Sure You Wish To Delete This Job?" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteJob(context))" ResourceKey="DeleteJob" /></td>
<td><ActionLink Action="Log" Class="btn btn-secondary" Parameters="@($"id=" + context.JobId.ToString())" ResourceKey="JobLog" /></td>
<td>@context.Name</td>
<td>@DisplayStatus(context.IsEnabled, context.IsExecuting)</td>
<td>@DisplayFrequency(context.Interval, context.Frequency)</td>
<td>@context.NextExecution</td>
<td>@context.NextExecution?.ToLocalTime()</td>
<td>
@if (context.IsStarted)
{
<button type="button" class="btn btn-danger" @onclick="(async () => await StopJob(context.JobId))">Stop</button>
<button type="button" class="btn btn-danger" @onclick="(async () => await StopJob(context.JobId))">@Localizer["Stop"]</button>
}
else
{
<button type="button" class="btn btn-success" @onclick="(async () => await StartJob(context.JobId))">Start</button>
<button type="button" class="btn btn-success" @onclick="(async () => await StartJob(context.JobId))">@Localizer["Start"]</button>
}
</td>
</Row>
@ -47,62 +49,66 @@ else
}
@code {
private List<Job> _jobs;
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } }
private List<Job> _jobs;
protected override async Task OnParametersSetAsync()
{
_jobs = await JobService.GetJobsAsync();
}
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } }
private string DisplayStatus(bool isEnabled, bool isExecuting)
{
var status = string.Empty;
if (!isEnabled)
{
status = "Disabled";
}
else
{
if (isExecuting)
{
status = "Executing";
}
else
{
status = "Idle";
}
}
protected override async Task OnParametersSetAsync()
{
_jobs = await JobService.GetJobsAsync();
if (_jobs.Count == 0)
{
AddModuleMessage(string.Format(Localizer["Message.NoJobs"], NavigateUrl("admin/system")), MessageType.Warning);
}
}
return status;
}
private string DisplayStatus(bool isEnabled, bool isExecuting)
{
var status = string.Empty;
if (!isEnabled)
{
status = Localizer["Disabled"];
}
else
{
if (isExecuting)
{
status = Localizer["Executing"];
}
else
{
status = Localizer["Idle"];
}
}
return status;
}
private string DisplayFrequency(int interval, string frequency)
{
var result = "Every " + interval.ToString() + " ";
switch (frequency)
{
case "m":
result += "Minute";
break;
case "H":
result += "Hour";
break;
case "d":
result += "Day";
break;
case "M":
result += "Month";
break;
}
if (interval > 1)
{
result += "s";
}
private string DisplayFrequency(int interval, string frequency)
{
var result = "";
switch (frequency)
{
case "m":
result = $"{Localizer["Every"]} {interval.ToString()} " + Localizer["Minute"];
break;
case "H":
result = $"{Localizer["Every"]} {interval.ToString()} " + Localizer["Hour"];
break;
case "d":
result = $"{Localizer["Every"]} {interval.ToString()} " + Localizer["Day"];
break;
case "w":
result = $"{Localizer["Every"]} {interval.ToString()} " + Localizer["Week"];
break;
case "M":
result = $"{Localizer["Every"]} {interval.ToString()} " + Localizer["Month"];
break;
case "O":
result = Localizer["Once"];
break;
}
return result;
}
@ -112,23 +118,48 @@ else
{
await JobService.DeleteJobAsync(job.JobId);
await logger.LogInformation("Job Deleted {Job}", job);
_jobs = await JobService.GetJobsAsync();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Job {Job} {Error}", job, ex.Message);
AddModuleMessage("Error Deleting Job", MessageType.Error);
AddModuleMessage(Localizer["Error.Job.Delete"], MessageType.Error);
}
}
private async Task StartJob(int jobId)
{
await JobService.StartJobAsync(jobId);
try
{
await JobService.StartJobAsync(jobId);
await logger.LogInformation("Job Started {JobId}", jobId);
AddModuleMessage(Localizer["Message.Job.Start"], MessageType.Success);
_jobs = await JobService.GetJobsAsync();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Starting Job {JobId} {Error}", jobId, ex.Message);
AddModuleMessage(Localizer["Error.Job.Start"], MessageType.Error);
}
}
private async Task StopJob(int jobId)
{
await JobService.StopJobAsync(jobId);
try
{
await JobService.StopJobAsync(jobId);
await logger.LogInformation("Job Stopped {JobId}", jobId);
AddModuleMessage(Localizer["Message.Job.Stop"], MessageType.Success);
_jobs = await JobService.GetJobsAsync();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Stopping Job {JobId} {Error}", jobId, ex.Message);
AddModuleMessage(Localizer["Error.Job.Stop"], MessageType.Error);
}
}
private async Task Refresh()

View File

@ -1,46 +1,48 @@
@namespace Oqtane.Modules.Admin.Jobs
@namespace Oqtane.Modules.Admin.Jobs
@inherits ModuleBase
@inject IJobLogService JobLogService
@inject IStringLocalizer<Log> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_jobLogs == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<Pager Items="@_jobLogs">
<Header>
<th>Name</th>
<th>Status</th>
<th>Started</th>
<th>Finished</th>
</Header>
<Row>
<td>@context.Job.Name</td>
<td>@DisplayStatus(context.Job.IsExecuting, context.Succeeded)</td>
<td>@context.StartDate</td>
<td>@context.FinishDate</td>
</Row>
<Detail>
<td colspan="4">@context.Notes</td>
</Detail>
</Pager>
<Pager Items="@_jobLogs">
<Header>
<th>@SharedLocalizer["Name"]</th>
<th>@SharedLocalizer["Status"]</th>
<th>@Localizer["Started"]</th>
<th>@Localizer["Finished"]</th>
</Header>
<Row>
<td>@context.Job.Name</td>
<td>@DisplayStatus(context.Job.IsExecuting, context.Succeeded)</td>
<td>@context.StartDate</td>
<td>@context.FinishDate</td>
</Row>
<Detail>
<td colspan="4">@((MarkupString)context.Notes)</td>
</Detail>
</Pager>
}
@code {
private List<JobLog> _jobLogs;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnParametersSetAsync()
{
_jobLogs = await JobLogService.GetJobLogsAsync();
if (PageState.QueryString.ContainsKey("id"))
{
_jobLogs = _jobLogs.Where(item => item.JobId == Int32.Parse(PageState.QueryString["id"])).ToList();
}
_jobLogs = _jobLogs.OrderByDescending(item => item.JobLogId).ToList();
}
@ -49,20 +51,20 @@ else
var status = string.Empty;
if (isExecuting)
{
status = "Executing";
status = Localizer["Executing"];
}
else
{
if (succeeded != null && succeeded.Value)
{
status = "Succeeded";
status = Localizer["Succeeded"];
}
else
{
status = "Failed";
status = Localizer["Failed"];
}
}
return status;
}
}

View File

@ -0,0 +1,361 @@
@namespace Oqtane.Modules.Admin.Languages
@inherits ModuleBase
@using System.Globalization
@using Microsoft.AspNetCore.Localization
@inject NavigationManager NavigationManager
@inject ILocalizationService LocalizationService
@inject ILanguageService LanguageService
@inject IPackageService PackageService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_supportedCultures == null)
{
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<TabStrip>
<TabPanel Name="Manage" ResourceKey="Manage">
@if (_availableCultures.Count() == 0)
{
<ModuleMessage Type="MessageType.Info" Message="@_message"></ModuleMessage>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
}
else
{
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Name Of The Language" ResourceKey="Name">Name:</Label>
<div class="col-sm-9">
<select id="_code" class="form-select" @bind="@_code" required>
@foreach (var culture in _availableCultures)
{
<option value="@culture.Name">@(culture.DisplayName + " (" + culture.Name + ")")</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="default" HelpText="Indicates Whether Or Not This Language Is The Default For The Site" ResourceKey="IsDefault">Default?</Label>
<div class="col-sm-9">
<select id="default" class="form-select" @bind="@_isDefault" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="SaveLanguage">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</form>
}
</TabPanel>
<TabPanel Name="Translations" Heading="Translations" ResourceKey="Download" Security="SecurityAccessLevel.Host">
<div class="row justify-content-center mb-3">
<div class="col-sm-6">
<div class="input-group">
<select id="price" class="form-select custom-select" @onchange="(e => PriceChanged(e))">
<option value="free">@SharedLocalizer["Free"]</option>
<option value="paid">@SharedLocalizer["Paid"]</option>
</select>
<input id="search" class="form-control" placeholder="@SharedLocalizer["Search.Hint"]" @bind="@_search" />
<button type="button" class="btn btn-primary" @onclick="Search">@SharedLocalizer["Search"]</button>
<button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Reset"]</button>
</div>
</div>
</div>
@if (_packages != null)
{
@if (_packages.Count > 0)
{
<Pager Items="@_packages">
<Row>
<td>
<h3 style="display: inline;"><a href="@context.ProductUrl" target="_new">@context.Name</a></h3>&nbsp;&nbsp;by:&nbsp;&nbsp;<strong><a href="@context.OwnerUrl" target="new">@context.Owner</a></strong><br />
@(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)<br />
<strong>@(String.Format("{0:n0}", context.Downloads))</strong> @SharedLocalizer["Search.Downloads"]&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Released"]: <strong>@context.ReleaseDate.ToString("MMM dd, yyyy")</strong>&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Version"]: <strong>@context.Version</strong>
@((MarkupString)(!string.IsNullOrEmpty(context.PackageUrl) ? "&nbsp;&nbsp;|&nbsp;&nbsp;" + SharedLocalizer["Search.Source"] + ": <strong>" + new Uri(context.PackageUrl).Host + "</strong>" : ""))
@((MarkupString)(context.TrialPeriod > 0 ? "&nbsp;&nbsp;|&nbsp;&nbsp;<strong>" + context.TrialPeriod + " " + @SharedLocalizer["Trial"] + "</strong>" : ""))
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PackageUrl))
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl))
{
<a class="btn btn-primary" style="text-decoration: none !important" href="@context.PaymentUrl" target="_new">@context.Price.Value.ToString("$#,##0.00")</a>
}
else
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
</Row>
</Pager>
}
else
{
<br />
<div class="mx-auto text-center">
@Localizer["Search.NoResults"]
</div>
}
<button type="button" class="btn btn-success" @onclick="InstallLanguages">@SharedLocalizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<ModuleMessage Type="MessageType.Info" Message="@SharedLocalizer["Oqtane.Marketplace"]" />
}
</TabPanel>
<TabPanel Name="Upload" ResourceKey="Upload" Security="SecurityAccessLevel.Host">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" HelpText="Upload one or more translations. Once they are uploaded click Install to complete the installation." ResourceKey="LanguageUpload">Translation: </Label>
<div class="col-sm-9">
<FileManager Folder="@Constants.PackagesFolder" UploadMultiple="true" />
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="InstallLanguages">@SharedLocalizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</TabPanel>
</TabStrip>
}
@if (_productname != "")
{
<div class="app-actiondialog">
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@SharedLocalizer["Review License Terms"]</h5>
<button type="button" class="btn-close" aria-label="Close" @onclick="HideModal"></button>
</div>
<div class="modal-body">
<p style="height: 200px; overflow-y: scroll;">
<h3>@_productname</h3>
@if (!string.IsNullOrEmpty(_license))
{
@((MarkupString)_license)
}
else
{
@SharedLocalizer["License Not Specified"]
}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" @onclick="DownloadPackage">@SharedLocalizer["Accept"]</button>
<button type="button" class="btn btn-secondary" @onclick="HideModal">@SharedLocalizer["Cancel"]</button>
</div>
</div>
</div>
</div>
</div>
}
@code {
private ElementReference form;
private bool validated = false;
private string _code = string.Empty;
private string _isDefault = "False";
private string _message;
private IEnumerable<Culture> _supportedCultures;
private IEnumerable<Culture> _availableCultures;
private List<Package> _packages;
private string _price = "free";
private string _search = "";
private string _productname = "";
private string _license = "";
private string _packageid = "";
private string _version = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override async Task OnParametersSetAsync()
{
var languages = await LanguageService.GetLanguagesAsync(PageState.Site.SiteId);
var languagesCodes = languages.Select(l => l.Code).ToList();
_supportedCultures = await LocalizationService.GetCulturesAsync();
_availableCultures = _supportedCultures.Where(c => !c.Name.Equals(Constants.DefaultCulture) && !languagesCodes.Contains(c.Name));
await LoadTranslations();
if (_supportedCultures.Count() == 1)
{
_message = Localizer["OnlyEnglish"];
}
else if (_availableCultures.Count() == 0)
{
_message = Localizer["AllLanguages"];
}
}
private async Task LoadTranslations()
{
_packages = await PackageService.GetPackagesAsync("translation", _search, _price, "");
}
private async void PriceChanged(ChangeEventArgs e)
{
try
{
_price = (string)e.Value;
_search = "";
await LoadTranslations();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On PriceChanged");
}
}
private async Task Search()
{
try
{
await LoadTranslations();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Search");
}
}
private async Task Reset()
{
try
{
_search = "";
await LoadTranslations();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Reset");
}
}
private async Task SaveLanguage()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
var language = new Language
{
SiteId = PageState.Page.SiteId,
Name = CultureInfo.GetCultureInfo(_code).DisplayName,
Code = _code,
IsDefault = (_isDefault == null ? false : Boolean.Parse(_isDefault))
};
try
{
language = await LanguageService.AddLanguageAsync(language);
if (language.IsDefault)
{
await SetCultureAsync(language.Code);
}
await logger.LogInformation("Language Added {Language}", language);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Language {Language} {Error}", language, ex.Message);
AddModuleMessage(Localizer["Error.Language.Add"], MessageType.Error);
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private void HideModal()
{
_productname = "";
_license = "";
StateHasChanged();
}
private async Task GetPackage(string packageid, string version)
{
try
{
var package = await PackageService.GetPackageAsync(packageid, version);
if (package != null)
{
_productname = package.Name;
if (!string.IsNullOrEmpty(package.License))
{
_license = package.License.Replace("\n", "<br />");
}
_packageid = package.PackageId;
_version = package.Version;
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Getting Package {PackageId} {Version}", packageid, version);
AddModuleMessage(Localizer["Error.Module.Download"], MessageType.Error);
}
}
private async Task DownloadPackage()
{
try
{
await PackageService.DownloadPackageAsync(_packageid, _version, Constants.PackagesFolder);
await logger.LogInformation("Language Package {Name} {Version} Downloaded Successfully", _packageid, _version);
AddModuleMessage(Localizer["Success.Language.Download"], MessageType.Success);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Translation {Name} {Version}", _packageid, _version);
AddModuleMessage(Localizer["Error.Language.Download"], MessageType.Error);
}
}
private async Task InstallLanguages()
{
try
{
await PackageService.InstallPackagesAsync();
AddModuleMessage(string.Format(Localizer["Success.Language.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Installing Translations");
}
}
private async Task SetCultureAsync(string culture)
{
if (culture != CultureInfo.CurrentUICulture.Name)
{
var interop = new Interop(JSRuntime);
var localizationCookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture));
await interop.SetCookie(CookieRequestCultureProvider.DefaultCookieName, localizationCookieValue, 360);
NavigationManager.NavigateTo(NavigationManager.Uri, true);
}
}
}

View File

@ -0,0 +1,112 @@
@namespace Oqtane.Modules.Admin.Languages
@inherits ModuleBase
@inject ILanguageService LanguageService
@inject ILocalizationService LocalizationService
@inject IPackageService PackageService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_languages == null)
{
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Text="Add Language" ResourceKey="AddLanguage" />
<Pager Items="@_languages">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@Localizer["Code"]</th>
<th>@Localizer["Translation"]</th>
<th>@Localizer["Default"]</th>
<th style="width: 1px;">&nbsp;</th>
</Header>
<Row>
<td><ActionDialog Header="Delete Language" Message="@string.Format(Localizer["Confirm.Language.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteLanguage(context))" Disabled="@((context.IsDefault && _languages.Count > 2) || context.Code == Constants.DefaultCulture)" ResourceKey="DeleteLanguage" /></td>
<td>@context.Name</td>
<td>@context.Code</td>
<td>@context.Version</td>
<td><TriStateCheckBox Value="@(context.IsDefault)" Disabled="true"></TriStateCheckBox></td>
<td>
@if (UpgradeAvailable(context.Code, context.Version))
{
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadLanguage(context.Code))>@SharedLocalizer["Upgrade"]</button>
}
</td>
</Row>
</Pager>
}
@code {
private List<Language> _languages;
private List<Package> _packages;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override async Task OnParametersSetAsync()
{
_languages = await LanguageService.GetLanguagesAsync(PageState.Site.SiteId, Constants.ClientId);
var cultures = await LocalizationService.GetCulturesAsync();
var culture = cultures.First(c => c.Name.Equals(Constants.DefaultCulture));
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
_packages = await PackageService.GetPackagesAsync("translation");
}
}
private async Task DeleteLanguage(Language language)
{
try
{
await LanguageService.DeleteLanguageAsync(language.LanguageId);
await logger.LogInformation("Language Deleted {Language}", language);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Language {Language} {Error}", language, ex.Message);
AddModuleMessage(Localizer["Error.Language.Delete"], MessageType.Error);
}
}
private bool UpgradeAvailable(string code, string version)
{
var upgradeavailable = false;
if (_packages != null && version != null)
{
var package = _packages.Where(item => item.PackageId == (Constants.PackageId + "." + code)).FirstOrDefault();
if (package != null)
{
upgradeavailable = (Version.Parse(package.Version).CompareTo(Version.Parse(Constants.Version)) == 0) &&
(Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0);
}
}
return upgradeavailable;
}
private async Task DownloadLanguage(string code)
{
try
{
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
await PackageService.DownloadPackageAsync(Constants.PackageId + "." + code, Constants.Version, Constants.PackagesFolder);
await logger.LogInformation("Translation Downloaded {Code} {Version}", code, Constants.Version);
await PackageService.InstallPackagesAsync();
AddModuleMessage(string.Format(Localizer["Success.Language.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Translation {Code} {Version} {Error}", code, Constants.Version, ex.Message);
AddModuleMessage(Localizer["Error.Language.Download"], MessageType.Error);
}
}
}

View File

@ -1,161 +1,326 @@
@namespace Oqtane.Modules.Admin.Login
@namespace Oqtane.Modules.Admin.Login
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IJSRuntime JsRuntime
@inject IUserService UserService
@inject IServiceProvider ServiceProvider
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_message != string.Empty)
{
<ModuleMessage Message="@_message" Type="@_type" />
}
<AuthorizeView>
<AuthorizeView Roles="@RoleNames.Registered">
<Authorizing>
<text>...</text>
</Authorizing>
<Authorized>
<ModuleMessage Message="You Are Already Logged In" Type="MessageType.Info" />
<div>@Localizer["Info.SignedIn"]</div>
</Authorized>
<NotAuthorized>
<div class="container">
<div class="form-group">
<label for="Username" class="control-label">Username: </label>
<input type="text" name="Username" class="form-control" placeholder="Username" @bind="@_username" id="Username" />
</div>
<div class="form-group">
<label for="Password" class="control-label">Password: </label>
<input type="password" name="Password" class="form-control" placeholder="Password" @bind="@_password" id="Password" />
</div>
<div class="form-group">
<div class="form-check form-check-inline">
<label class="form-check-label" for="Remember">Remember Me?</label>&nbsp;
<input type="checkbox" class="form-check-input" name="Remember" @bind="@_remember" id="Remember" />
</div>
</div>
<button type="button" class="btn btn-primary" @onclick="Login">Login</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
<br /><br />
<button type="button" class="btn btn-secondary" @onclick="Forgot">Forgot Password</button>
</div>
</NotAuthorized>
@if (!twofactor)
{
<form @ref="login" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="Oqtane-Modules-Admin-Login" @onkeypress="@(e => KeyPressed(e))">
@if (_allowexternallogin)
{
<button type="button" class="btn btn-primary" @onclick="ExternalLogin">@Localizer["Use"] @PageState.Site.Settings["ExternalLogin:ProviderName"]</button>
<br /><br />
}
@if (_allowsitelogin)
{
<div class="form-group">
<Label Class="control-label" For="username" HelpText="Please enter your Username" ResourceKey="Username">Username:</Label>
<input id="username" type="text" @ref="username" class="form-control" placeholder="@Localizer["Username.Placeholder"]" @bind="@_username" required />
</div>
<div class="form-group mt-2">
<Label Class="control-label" For="password" HelpText="Please enter your Password" ResourceKey="Password">Password:</Label>
<div class="input-group">
<input id="password" type="@_passwordtype" name="Password" class="form-control" placeholder="@Localizer["Password.Placeholder"]" @bind="@_password" required />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
<div class="form-group mt-2">
<div class="form-check">
<input id="remember" type="checkbox" class="form-check-input" @bind="@_remember" />
<Label Class="control-label" For="remember" HelpText="Specify if you would like to be signed back in automatically the next time you visit this site" ResourceKey="Remember">Remember Me?</Label>
</div>
</div>
<button type="button" class="btn btn-primary" @onclick="Login">@SharedLocalizer["Login"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
<br /><br />
<button type="button" class="btn btn-secondary" @onclick="Forgot">@Localizer["ForgotPassword"]</button>
}
</div>
</form>
}
else
{
<form @ref="login" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container Oqtane-Modules-Admin-Login">
<div class="form-group">
<Label Class="control-label" For="code" HelpText="Please enter the secure verification code which was sent to you by email" ResourceKey="Code">Verification Code:</Label>
<input id="code" class="form-control" @bind="@_code" placeholder="@Localizer["Code.Placeholder"]" maxlength="6" required />
</div>
<br />
<button type="button" class="btn btn-primary" @onclick="Login">@SharedLocalizer["Login"]</button>
<button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Cancel"]</button>
</div>
</form>
}
</NotAuthorized>
</AuthorizeView>
@code {
private string _returnUrl = string.Empty;
private string _message = string.Empty;
private MessageType _type = MessageType.Info;
private string _username = string.Empty;
private string _password = string.Empty;
private bool _remember = false;
private bool _allowsitelogin = true;
private bool _allowexternallogin = false;
private ElementReference login;
private bool validated = false;
private bool twofactor = false;
private string _username = string.Empty;
private ElementReference username;
private string _password = string.Empty;
private string _passwordtype = "password";
private string _togglepassword = string.Empty;
private bool _remember = false;
private string _code = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
private string _returnUrl = string.Empty;
protected override async Task OnInitializedAsync()
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
public override List<Resource> Resources => new List<Resource>()
{
if (PageState.QueryString.ContainsKey("returnurl"))
{
_returnUrl = PageState.QueryString["returnurl"];
}
if (PageState.QueryString.ContainsKey("name"))
{
_username = PageState.QueryString["name"];
}
if (PageState.QueryString.ContainsKey("token"))
{
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = _username;
user = await UserService.VerifyEmailAsync(user, PageState.QueryString["token"]);
new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }
};
if (user != null)
{
_message = "User Account Verified Successfully. You Can Now Login With Your Username And Password Below.";
}
else
{
_message = "User Account Could Not Be Verified. Please Contact Your Administrator For Further Instructions.";
_type = MessageType.Warning;
}
}
}
protected override async Task OnInitializedAsync()
{
try
{
_togglepassword = SharedLocalizer["ShowPassword"];
private async Task Login()
{
if (PageState.Runtime == Runtime.Server)
{
// server-side Blazor
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = _username;
user.Password = _password;
user = await UserService.LoginUserAsync(user, false, false);
if (user.IsAuthenticated)
{
await logger.LogInformation("Login Successful For Username {Username}", _username);
// complete the login on the server so that the cookies are set correctly on SignalR
var interop = new Interop(JsRuntime);
string antiforgerytoken = await interop.GetElementByName("__RequestVerificationToken");
var fields = new { __RequestVerificationToken = antiforgerytoken, username = _username, password = _password, remember = _remember, returnurl = _returnUrl };
await interop.SubmitForm($"/{PageState.Alias.AliasId}/pages/login/", fields);
}
else
{
await logger.LogInformation("Login Failed For Username {Username}", _username);
AddModuleMessage("Login Failed. Please Remember That Passwords Are Case Sensitive And User Accounts Require Email Verification When They Initially Created.", MessageType.Error);
}
}
else
{
// client-side Blazor
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = _username;
user.Password = _password;
user = await UserService.LoginUserAsync(user, true, _remember);
if (user.IsAuthenticated)
{
await logger.LogInformation("Login Successful For Username {Username}", _username);
var authstateprovider = (IdentityAuthenticationStateProvider)ServiceProvider.GetService(typeof(IdentityAuthenticationStateProvider));
authstateprovider.NotifyAuthenticationChanged();
NavigationManager.NavigateTo(NavigateUrl(_returnUrl, "reload"));
}
else
{
await logger.LogInformation("Login Failed For Username {Username}", _username);
AddModuleMessage("Login Failed. Please Remember That Passwords Are Case Sensitive And User Accounts Require Verification When They Are Initially Created So You May Wish To Check Your Email.", MessageType.Error);
}
}
}
if (PageState.Site.Settings.ContainsKey("LoginOptions:AllowSiteLogin") && !string.IsNullOrEmpty(PageState.Site.Settings["LoginOptions:AllowSiteLogin"]))
{
_allowsitelogin = bool.Parse(PageState.Site.Settings["LoginOptions:AllowSiteLogin"]);
}
private void Cancel()
{
NavigationManager.NavigateTo(_returnUrl);
}
if (PageState.Site.Settings.ContainsKey("ExternalLogin:ProviderType") && !string.IsNullOrEmpty(PageState.Site.Settings["ExternalLogin:ProviderType"]))
{
_allowexternallogin = true;
}
if (PageState.QueryString.ContainsKey("returnurl"))
{
_returnUrl = PageState.QueryString["returnurl"];
}
if (PageState.QueryString.ContainsKey("name"))
{
_username = PageState.QueryString["name"];
}
if (PageState.QueryString.ContainsKey("token") && !string.IsNullOrEmpty(_username))
{
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = _username;
if (PageState.QueryString.ContainsKey("key"))
{
user = await UserService.LinkUserAsync(user, PageState.QueryString["token"], PageState.Site.Settings["ExternalLogin:ProviderType"], PageState.QueryString["key"], PageState.Site.Settings["ExternalLogin:ProviderName"]);
if (user != null)
{
await logger.LogInformation(LogFunction.Security, "External Login Linkage Successful For Username {Username}", _username);
AddModuleMessage(Localizer["Success.Account.Linked"], MessageType.Info);
}
else
{
await logger.LogError(LogFunction.Security, "External Login Linkage Failed For Username {Username}", _username);
AddModuleMessage(Localizer["Message.Account.NotLinked"], MessageType.Warning);
}
_username = "";
}
else
{
user = await UserService.VerifyEmailAsync(user, PageState.QueryString["token"]);
if (user != null)
{
await logger.LogInformation(LogFunction.Security, "Email Verified For For Username {Username}", _username);
AddModuleMessage(Localizer["Success.Account.Verified"], MessageType.Info);
}
else
{
await logger.LogError(LogFunction.Security, "Email Verification Failed For Username {Username}", _username);
AddModuleMessage(Localizer["Message.Account.NotVerified"], MessageType.Warning);
}
}
}
else
{
if (PageState.QueryString.ContainsKey("status"))
{
AddModuleMessage(Localizer["ExternalLoginStatus." + PageState.QueryString["status"]], MessageType.Info);
}
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Login {Error}", ex.Message);
AddModuleMessage(Localizer["Error.LoadLogin"], MessageType.Error);
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender && PageState.User == null)
{
await username.FocusAsync();
}
}
private async Task Login()
{
try
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(login))
{
var hybrid = (PageState.Runtime == Shared.Runtime.Hybrid);
var user = new User { SiteId = PageState.Site.SiteId, Username = _username, Password = _password, LastIPAddress = SiteState.RemoteIPAddress};
if (!twofactor)
{
user = await UserService.LoginUserAsync(user, hybrid, _remember);
}
else
{
user = await UserService.VerifyTwoFactorAsync(user, _code);
}
if (user.IsAuthenticated)
{
await logger.LogInformation(LogFunction.Security, "Login Successful For Username {Username}", _username);
if (hybrid)
{
// hybrid apps utilize an interactive login
var authstateprovider = (IdentityAuthenticationStateProvider)ServiceProvider
.GetService(typeof(IdentityAuthenticationStateProvider));
authstateprovider.NotifyAuthenticationChanged();
NavigationManager.NavigateTo(NavigateUrl(_returnUrl, true));
}
else
{
// post back to the Login page so that the cookies are set correctly
var fields = new { __RequestVerificationToken = SiteState.AntiForgeryToken, username = _username, password = _password, remember = _remember, returnurl = _returnUrl };
string url = Utilities.TenantUrl(PageState.Alias, "/pages/login/");
await interop.SubmitForm(url, fields);
}
}
else
{
if ((PageState.Site.Settings.ContainsKey("LoginOptions:TwoFactor") && PageState.Site.Settings["LoginOptions:TwoFactor"] == "required") || user.TwoFactorRequired)
{
twofactor = true;
validated = false;
AddModuleMessage(Localizer["Message.TwoFactor"], MessageType.Info);
}
else
{
if (!twofactor)
{
await logger.LogInformation(LogFunction.Security, "Login Failed For Username {Username}", _username);
AddModuleMessage(Localizer["Error.Login.Fail"], MessageType.Error);
}
else
{
await logger.LogInformation(LogFunction.Security, "Two Factor Verification Failed For Username {Username}", _username);
AddModuleMessage(Localizer["Error.TwoFactor.Fail"], MessageType.Error);
}
}
}
}
else
{
AddModuleMessage(Localizer["Message.Required.UserInfo"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Performing Login {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Login"], MessageType.Error);
}
}
private void Cancel()
{
NavigationManager.NavigateTo(_returnUrl);
}
private async Task Forgot()
{
try
{
if (_username != string.Empty)
{
var user = await UserService.GetUserAsync(_username, PageState.Site.SiteId);
if (user != null)
{
await UserService.ForgotPasswordAsync(user);
await logger.LogInformation(LogFunction.Security, "Password Reset Notification Sent For Username {Username}", _username);
AddModuleMessage(Localizer["Message.ForgotUser"], MessageType.Info);
}
else
{
AddModuleMessage(Localizer["Message.UserDoesNotExist"], MessageType.Warning);
}
}
else
{
AddModuleMessage(Localizer["Message.ForgotPassword"], MessageType.Info);
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Resetting Password {Error}", ex.Message);
AddModuleMessage(Localizer["Error.ResetPassword"], MessageType.Error);
}
}
private void Reset()
{
twofactor = false;
_username = "";
_password = "";
ClearModuleMessage();
StateHasChanged();
}
private async Task KeyPressed(KeyboardEventArgs e)
{
if (e.Code == "Enter" || e.Code == "NumpadEnter")
{
await Login();
}
}
private void TogglePassword()
{
if (_passwordtype == "password")
{
_passwordtype = "text";
_togglepassword = SharedLocalizer["HidePassword"];
}
else
{
_passwordtype = "password";
_togglepassword = SharedLocalizer["ShowPassword"];
}
}
private void ExternalLogin()
{
NavigationManager.NavigateTo(Utilities.TenantUrl(PageState.Alias, "/pages/external?returnurl=" + _returnUrl), true);
}
private async Task Forgot()
{
if (_username != string.Empty)
{
var user = await UserService.GetUserAsync(_username, PageState.Site.SiteId);
if (user != null)
{
await UserService.ForgotPasswordAsync(user);
_message = "Please Check The Email Address Associated To Your User Account For A Password Reset Notification";
}
else
{
_message = "User Does Not Exist";
_type = MessageType.Warning;
}
}
else
{
_message = "Please Enter The Username Related To Your Account And Then Select The Forgot Password Option Again";
}
StateHasChanged();
}
}

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.Logs
@namespace Oqtane.Modules.Admin.Logs
@using System.Globalization
@inherits ModuleBase
@inject NavigationManager NavigationManager
@ -6,136 +6,114 @@
@inject IPageService PageService
@inject IPageModuleService PageModuleService
@inject IUserService UserService
@inject IStringLocalizer<Detail> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="dateTime" HelpText="The date and time of this log">Date/Time: </Label>
</td>
<td>
<input id="dateTime" class="form-control" @bind="@_logDate" readonly />
</td>
</tr>
<tr>
<td>
<Label For="level" HelpText="The level of this log">Level: </Label>
</td>
<td>
<input id="level" class="form-control" @bind="@_level" readonly />
</td>
</tr>
<tr>
<td>
<Label For="feature" HelpText="The feature that was affected">Feature: </Label>
</td>
<td>
<input id="feature" class="form-control" @bind="@_feature" readonly />
</td>
</tr>
<tr>
<td>
<Label For="function" HelpText="The function that was performed">Function: </Label>
</td>
<td>
<input id="function" class="form-control" @bind="@_function" readonly />
</td>
</tr>
<tr>
<td>
<Label For="category" HelpText="The categories that were affected">Category: </Label>
</td>
<td>
<input id="category" class="form-control" @bind="@_category" readonly />
</td>
</tr>
@if (_pageName != string.Empty)
{
<tr>
<td>
<Label For="page" HelpText="The page that was affected">Page: </Label>
</td>
<td>
<input id="page" class="form-control" @bind="@_pageName" readonly />
</td>
</tr>
}
@if (_moduleTitle != string.Empty)
{
<tr>
<td>
<Label For="module" HelpText="The module that was affected">Module: </Label>
</td>
<td>
<input id="module" class="form-control" @bind="@_moduleTitle" readonly />
</td>
</tr>
}
@if (_username != string.Empty)
{
<tr>
<td>
<Label For="user" HelpText="The user that caused this log">User: </Label>
</td>
<td>
<input id="user" class="form-control" @bind="@_username" readonly />
</td>
</tr>
}
<tr>
<td>
<Label For="url" HelpText="The url the log comes from">Url: </Label>
</td>
<td>
<input id="url" class="form-control" @bind="@_url" readonly />
</td>
</tr>
<tr>
<td>
<Label For="template" HelpText="What the log is about">Template: </Label>
</td>
<td>
<input id="template" class="form-control" @bind="@_template" readonly />
</td>
</tr>
<tr>
<td>
<Label For="message" HelpText="The message that the system generated"class="control-label">Message: </Label>
</td>
<td>
<textarea id="message" class="form-control" @bind="@_message" rows="5" readonly></textarea>
</td>
</tr>
@if (!string.IsNullOrEmpty(_exception))
{
<tr>
<td>
<Label For="exception" HelpText="The exceptions generated by the system">Exception: </Label>
</td>
<td>
@if (_initialized)
{
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="dateTime" HelpText="The date and time of this log" ResourceKey="DateTime">Date/Time: </Label>
<div class="col-sm-9">
<input id="dateTime" class="form-control" @bind="@_logDate" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="level" HelpText="The level of this log" ResourceKey="Level">Level: </Label>
<div class="col-sm-9">
<input id="level" class="form-control" @bind="@_level" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="feature" HelpText="The feature that was affected" ResourceKey="Feature">Feature: </Label>
<div class="col-sm-9">
<input id="feature" class="form-control" @bind="@_feature" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="function" HelpText="The function that was performed" ResourceKey="Function">Function: </Label>
<div class="col-sm-9">
<input id="function" class="form-control" @bind="@_function" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="category" HelpText="The categories that were affected" ResourceKey="Category">Category: </Label>
<div class="col-sm-9">
<input id="category" class="form-control" @bind="@_category" readonly />
</div>
</div>
@if (_pageName != string.Empty)
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="page" HelpText="The page that was affected" ResourceKey="Page">Page: </Label>
<div class="col-sm-9">
<input id="page" class="form-control" @bind="@_pageName" readonly />
</div>
</div>
}
@if (_moduleTitle != string.Empty)
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="module" HelpText="The module that was affected" ResourceKey="Module">Module: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_moduleTitle" readonly />
</div>
</div>
}
@if (_username != string.Empty)
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="user" HelpText="The user that caused this log" ResourceKey="User">User: </Label>
<div class="col-sm-9">
<input id="user" class="form-control" @bind="@_username" readonly />
</div>
</div>
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="The url the log comes from" ResourceKey="Url">Url: </Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="template" HelpText="What the log is about" ResourceKey="Template">Template: </Label>
<div class="col-sm-9">
<input id="template" class="form-control" @bind="@_template" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="message" HelpText="The message that the system generated" ResourceKey="Message">Message: </Label>
<div class="col-sm-9">
<textarea id="message" class="form-control" @bind="@_message" rows="5" readonly></textarea>
</div>
</div>
@if (!string.IsNullOrEmpty(_exception))
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="exception" HelpText="The exceptions generated by the system" ResourceKey="Exception">Exception: </Label>
<div class="col-sm-9">
<textarea id="exception" class="form-control" @bind="@_exception" rows="5" readonly></textarea>
</td>
</tr>
</div>
</div>
}
<tr>
<td>
<Label For="properties" HelpText="The properties that were affected">Properties: </Label>
</td>
<td>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="properties" HelpText="The properties that were affected" ResourceKey="Properties">Properties: </Label>
<div class="col-sm-9">
<textarea id="properties" class="form-control" @bind="@_properties" rows="5" readonly></textarea>
</td>
</tr>
<tr>
<td>
<Label For="server" HelpText="The server that was affected">Server: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="The server that was affected" ResourceKey="Server">Server: </Label>
<div class="col-sm-9">
<input id="server" class="form-control" @bind="@_server" readonly />
</td>
</tr>
</table>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
</div>
</div>
</div>
}
<NavLink class="btn btn-secondary" href="@CloseUrl()">@SharedLocalizer["Cancel"]</NavLink>
@code {
private bool _initialized = false;
private int _logId;
private string _logDate = string.Empty;
private string _level = string.Empty;
@ -152,13 +130,14 @@
private string _properties = string.Empty;
private string _server = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override string UrlParametersTemplate => "/{id}";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
_logId = Int32.Parse(PageState.QueryString["id"]);
_logId = Int32.Parse(UrlParameters["id"]);
var log = await LogService.GetLogAsync(_logId);
if (log != null)
{
@ -167,7 +146,7 @@
_feature = log.Feature;
_function = log.Function;
_category = log.Category;
if (log.PageId != null)
{
var page = await PageService.GetPageAsync(log.PageId.Value);
@ -176,8 +155,8 @@
_pageName = page.Name;
}
}
if (log.PageId != null && log.ModuleId != null)
if (log.PageId != null && log.ModuleId != null && log.ModuleId != -1)
{
var pagemodule = await PageModuleService.GetPageModuleAsync(log.PageId.Value, log.ModuleId.Value);
if (pagemodule != null)
@ -185,7 +164,7 @@
_moduleTitle = pagemodule.Title;
}
}
if (log.UserId != null)
{
var user = await UserService.GetUserAsync(log.UserId.Value, PageState.Site.SiteId);
@ -194,19 +173,25 @@
_username = user.Username;
}
}
_url = log.Url;
_template = log.MessageTemplate;
_message = log.Message;
_exception = log.Exception;
_properties = log.Properties;
_server = log.Server;
_initialized = true;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Log {LogId} {Error}", _logId, ex.Message);
AddModuleMessage("Error Loading Log", MessageType.Error);
AddModuleMessage(Localizer["Error.Log.Load"], MessageType.Error);
}
}
private string CloseUrl()
{
return (!string.IsNullOrEmpty(PageState.ReturnUrl)) ? PageState.ReturnUrl : NavigateUrl();
}
}

View File

@ -1,93 +1,143 @@
@namespace Oqtane.Modules.Admin.Logs
@namespace Oqtane.Modules.Admin.Logs
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ILogService LogService
@inject ISettingService SettingService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_logs == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<table class="table table-borderless">
<tr>
<td>
<label>Level: </label>
<select class="form-control" @onchange="(e => LevelChanged(e))">
<option value="-">&lt;All Levels&gt;</option>
<option value="Trace">Trace</option>
<option value="Debug">Debug</option>
<option value="Information">Information</option>
<option value="Warning">Warning</option>
<option value="Error">Error</option>
<option value="Critical">Critical</option>
</select>
</td>
<td>
<label>Function: </label>
<select class="form-control" @onchange="(e => FunctionChanged(e))">
<option value="-">&lt;All Functions&gt;</option>
<option value="Create">Create</option>
<option value="Read">Read</option>
<option value="Update">Update</option>
<option value="Delete">Delete</option>
<option value="Security">Security</option>
<option value="Other">Other</option>
</select>
</td>
<td>
<label>Rows: </label>
<select class="form-control" @onchange="(e => RowsChanged(e))">
<option value="10">10</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</td>
</tr>
</table>
<TabStrip>
<TabPanel Name="Events" Heading="Events" ResourceKey="Events">
<div class="container g-0">
<div class="row mb-1 align-items-center">
<div class="col-sm-4">
<Label For="level" HelpText="Select the log level for event log items" ResourceKey="Level">Level: </Label><br /><br />
<select id="level" class="form-select" value="@_level" @onchange="(e => LevelChanged(e))">
<option value="-">&lt;@Localizer["AllLevels"]&gt;</option>
<option value="Trace">@Localizer["Trace"]</option>
<option value="Debug">@Localizer["Debug"]</option>
<option value="Information">@Localizer["Information"]</option>
<option value="Warning">@Localizer["Warning"]</option>
<option value="Error">@Localizer["Error"]</option>
<option value="Critical">@Localizer["Critical"]</option>
</select>
</div>
<div class="col-sm-4">
<Label For="function" HelpText="Select the function for event log items" ResourceKey="Function">Function: </Label><br /><br />
<select id="function" class="form-select" value="@_function" @onchange="(e => FunctionChanged(e))">
<option value="-">&lt;@Localizer["AllFunctions"]&gt;</option>
<option value="Create">@Localizer["Create"]</option>
<option value="Read">@Localizer["Read"]</option>
<option value="Update">@SharedLocalizer["Update"]</option>
<option value="Delete">@SharedLocalizer["Delete"]</option>
<option value="Security">@Localizer["Security"]</option>
<option value="Other">@Localizer["Other"]</option>
</select>
</div>
<div class="col-sm-4">
<Label For="rows" HelpText="Select the maximum number of event log items to review. Please note that if you choose more than 10 items the information will be split into pages." ResourceKey="Rows">Maximum Items: </Label><br /><br />
<select id="rows" class="form-select" value="@_rows" @onchange="(e => RowsChanged(e))">
<option value="10">10</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
</div>
</div>
<br />
@if (_logs.Any())
{
<Pager Items="@_logs">
<Header>
<th>&nbsp;</th>
<th>Date</th>
<th>Level</th>
<th>Feature</th>
<th>Function</th>
</Header>
<Row>
<td class="@GetClass(context.Function)"><ActionLink Action="Detail" Parameters="@($"id=" + context.LogId.ToString())" /></td>
<td class="@GetClass(context.Function)">@context.LogDate</td>
<td class="@GetClass(context.Function)">@context.Level</td>
<td class="@GetClass(context.Function)">@context.Feature</td>
<td class="@GetClass(context.Function)">@context.Function</td>
</Row>
</Pager>
}
else
{
<p><em>No Logs Match The Criteria Specified</em></p>
}
@if (_logs.Any())
{
<Pager Items="@_logs" CurrentPage="@_page.ToString()" OnPageChange="OnPageChange">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th>@Localizer["Date"]</th>
<th>@Localizer["Level"]</th>
<th>@Localizer["Feature"]</th>
<th>@Localizer["Function"]</th>
</Header>
<Row>
<td class="@GetClass(context.Function)"><ActionLink Action="Detail" Parameters="@($"/{context.LogId}")" ReturnUrl="@(NavigateUrl(PageState.Page.Path, AddUrlParameters(_level, _function, _rows, _page)))" ResourceKey="LogDetails" /></td>
<td class="@GetClass(context.Function)">@context.LogDate</td>
<td class="@GetClass(context.Function)">@context.Level</td>
<td class="@GetClass(context.Function)">@context.Feature</td>
<td class="@GetClass(context.Function)">@context.Function</td>
</Row>
</Pager>
}
else
{
<p><em>@Localizer["NoLogs"]</em></p>
}
</TabPanel>
<TabPanel Name="Settings" Heading="Settings" ResourceKey="Settings">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="retention" HelpText="Number of days of events to retain" ResourceKey="Retention">Retention (Days): </Label>
<div class="col-sm-9">
<input id="retention" class="form-control" @bind="@_retention" />
</div>
</div>
</div>
<br />
<button type="button" class="btn btn-success" @onclick="SaveSiteSettings">@SharedLocalizer["Save"]</button>
</TabPanel>
</TabStrip>
}
@code {
private string _level = "-";
private string _function = "-";
private string _rows = "10";
private List<Log> _logs;
private string _level = "-";
private string _function = "-";
private string _rows = "10";
private int _page = 1;
private List<Log> _logs;
private string _retention = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override string UrlParametersTemplate => "/{level}/{function}/{rows}/{page}";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnParametersSetAsync()
{
try
{
// external link to log item will display Details component
if (PageState.QueryString.ContainsKey("id") && int.TryParse(PageState.QueryString["id"], out int id))
{
NavigationManager.NavigateTo(EditUrl(PageState.Page.Path, ModuleState.ModuleId, "Detail", $"/{id}"));
}
if (UrlParameters.ContainsKey("level"))
{
_level = UrlParameters["level"];
}
if (UrlParameters.ContainsKey("function"))
{
_function = UrlParameters["function"];
}
if (UrlParameters.ContainsKey("rows"))
{
_rows = UrlParameters["rows"];
}
if (UrlParameters.ContainsKey("page") && int.TryParse(UrlParameters["page"], out int page))
{
_page = page;
}
protected override async Task OnInitializedAsync()
{
try
{
await GetLogs();
var settings = await SettingService.GetSiteSettingsAsync(PageState.Site.SiteId);
_retention = SettingService.GetSetting(settings, "LogRetention", "30");
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Logs {Error}", ex.Message);
AddModuleMessage("Error Loading Logs", MessageType.Error);
AddModuleMessage(Localizer["Error.Log.Load"], MessageType.Error);
}
}
@ -102,7 +152,7 @@ else
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Logs {Error}", ex.Message);
AddModuleMessage("Error Loading Logs", MessageType.Error);
AddModuleMessage(Localizer["Error.Log.Load"], MessageType.Error);
}
}
@ -117,7 +167,7 @@ else
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Logs {Error}", ex.Message);
AddModuleMessage("Error Loading Logs", MessageType.Error);
AddModuleMessage(Localizer["Error.Log.Load"], MessageType.Error);
}
}
@ -133,7 +183,7 @@ else
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Logs {Error}", ex.Message);
AddModuleMessage("Error Loading Logs", MessageType.Error);
AddModuleMessage(Localizer["Error.Log.Load"], MessageType.Error);
}
}
@ -168,4 +218,27 @@ else
}
return classname;
}
private async Task SaveSiteSettings()
{
try
{
var settings = await SettingService.GetSiteSettingsAsync(PageState.Site.SiteId);
settings = SettingService.SetSetting(settings, "LogRetention", _retention, true);
await SettingService.UpdateSiteSettingsAsync(settings, PageState.Site.SiteId);
AddModuleMessage(Localizer["Success.SaveSiteSettings"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Site Settings {Error}", ex.Message);
AddModuleMessage(Localizer["Error.SaveSiteSettings"], MessageType.Error);
}
}
private void OnPageChange(int page)
{
_page = page;
}
}

View File

@ -1,80 +1,203 @@
@namespace Oqtane.Modules.Admin.ModuleCreator
@namespace Oqtane.Modules.Admin.ModuleCreator
@inherits ModuleBase
@using System.Text.RegularExpressions
@inject NavigationManager NavigationManager
@inject IModuleDefinitionService ModuleDefinitionService
@inject IModuleService ModuleService
@inject ISettingService SettingService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="owner" HelpText="Enter the name of the organization who is developing this module. It should not contain spaces or punctuation.">Owner Name: </Label>
</td>
<td>
<input id="owner" class="form-control" @bind="@_owner" />
</td>
</tr>
<tr>
<td>
<Label For="module" HelpText="Enter a name for this module. It should be in singular form (ie. Car) and not contain spaces or punctuation.">Module Name: </Label>
</td>
<td>
<input id="module" class="form-control" @bind="@_module" />
</td>
</tr>
<tr>
<td>
<Label For="description" HelpText="Enter s short description for the module">Description: </Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="3"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="template" HelpText="Select a module template. Internal modules are created inside of the Oqtane solution. External modules are created outside of the Oqtane solution.">Template: </Label>
</td>
<td>
<select id="template" class="form-control" @bind="@_template">
<option value="">&lt;Select Template&gt;</option>
<option value="internal">Internal</option>
<option value="external">External</option>
</select>
</td>
</tr>
</table>
@if (string.IsNullOrEmpty(_moduledefinitionname) && _templates != null)
{
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="owner" HelpText="Enter the name of the organization who is developing this module. It should not contain spaces or punctuation." ResourceKey="OwnerName">Owner Name: </Label>
<div class="col-sm-9">
<input id="owner" class="form-control" @bind="@_owner" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="module" HelpText="Enter a name for this module. It should not contain spaces or punctuation." ResourceKey="ModuleName">Module Name: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_module" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="Enter a short description for the module" ResourceKey="Description">Description: </Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="3" ></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="template" HelpText="Select a module template. Templates are located in the wwwroot/Modules/Templates folder on the server." ResourceKey="Template">Template: </Label>
<div class="col-sm-9">
<select id="template" class="form-select" @onchange="(e => TemplateChanged(e))" required>
<option value="-">&lt;@Localizer["Template.Select"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Title</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="reference" HelpText="Select a framework reference version" ResourceKey="FrameworkReference">Framework Reference: </Label>
<div class="col-sm-9">
<select id="reference" class="form-select" @bind="@_reference" required>
@foreach (string version in _versions)
{
if (Version.Parse(version).CompareTo(Version.Parse(_minversion)) >= 0)
{
<option value="@(version)">@(version)</option>
}
}
<option value="local">@SharedLocalizer["LocalVersion"]</option>
</select>
</div>
</div>
@if (!string.IsNullOrEmpty(_location))
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="location" HelpText="Location where the module will be created" ResourceKey="Location">Location: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_location" readonly />
</div>
</div>
}
</div>
</form>
<button type="button" class="btn btn-success" @onclick="CreateModule">@Localizer["Module.Create"]</button>
}
else
{
<button type="button" class="btn btn-success" @onclick="ActivateModule">@Localizer["Module.Activate"]</button>
}
<button type="button" class="btn btn-success" @onclick="CreateModule">Create Module</button>
@code {
private ElementReference form;
private bool validated = false;
private string _moduledefinitionname = string.Empty;
private string _owner = string.Empty;
private string _module = string.Empty;
private string _description = string.Empty;
private List<Template> _templates;
private string _template = "-";
private string[] _versions;
private string _reference = "local";
private string _minversion = "2.0.0";
private string _location = string.Empty;
@code {
private string _owner = string.Empty;
private string _module = string.Empty;
private string _description = string.Empty;
private string _template = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override void OnInitialized()
{
_moduledefinitionname = SettingService.GetSetting(ModuleState.Settings, "ModuleDefinitionName", "");
if (string.IsNullOrEmpty(_moduledefinitionname))
{
AddModuleMessage(Localizer["Info.Module.Creator"], MessageType.Info);
}
else
{
AddModuleMessage(Localizer["Info.Module.Activate"], MessageType.Info);
}
}
protected override void OnInitialized()
{
AddModuleMessage("Please Note That Once You Select The Create Module Button The Application Must Restart In Order To Complete The Process. If You Create An External Module You Will Need To Compile The Source Code In Order To Make It Functional.", MessageType.Info);
protected override async Task OnParametersSetAsync()
{
try
{
_templates = await ModuleDefinitionService.GetModuleDefinitionTemplatesAsync();
_versions = Constants.ReleaseVersions.Split(',').Where(item => Version.Parse(item).CompareTo(Version.Parse("2.0.0")) >= 0).ToArray();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Module Creator");
}
}
private async Task CreateModule()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
try
{
if (IsValid(_owner) && IsValid(_module) && _owner != _module && _template != "-")
{
var moduleDefinition = new ModuleDefinition { Owner = _owner, Name = _module, Description = _description, Template = _template, Version = _reference };
moduleDefinition = await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition);
var settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
SettingService.SetSetting(settings, "ModuleDefinitionName", moduleDefinition.ModuleDefinitionName);
await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId);
GetLocation();
AddModuleMessage(string.Format(Localizer["Success.Module.Create"], NavigateUrl("admin/system")), MessageType.Success);
}
else
{
AddModuleMessage(Localizer["Message.Require.ValidName"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Creating Module");
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private async Task CreateModule()
private async Task ActivateModule()
{
try
{
if (!string.IsNullOrEmpty(_owner) && !string.IsNullOrEmpty(_module) && !string.IsNullOrEmpty(_template))
if (!string.IsNullOrEmpty(_moduledefinitionname))
{
var moduleDefinition = new ModuleDefinition { Owner = _owner.Replace(" ",""), Name = _module.Replace(" ", ""), Description = _description, Template = _template };
await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition, ModuleState.ModuleId);
}
else
{
AddModuleMessage("You Must Provide An Owner, Module Name, And Template", MessageType.Warning);
Module module = await ModuleService.GetModuleAsync(ModuleState.ModuleId);
module.ModuleDefinitionName = _moduledefinitionname;
await ModuleService.UpdateModuleAsync(module);
NavigationManager.NavigateTo(NavigateUrl(), true);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Creating Module");
await logger.LogError(ex, "Error Activating Module");
}
}
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && name.ToLower() != "module" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)
{
_template = (string)e.Value;
_minversion = "2.0.0";
if (_template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_minversion = template.Version;
}
GetLocation();
}
private void GetLocation()
{
_location = string.Empty;
if (_owner != "" && _module != "" && _template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_location = template.Location + _owner + "." + _module;
}
StateHasChanged();
}
}

View File

@ -1,7 +1,9 @@
using Oqtane.Models;
using Oqtane.Documentation;
using Oqtane.Models;
namespace Oqtane.Modules.Admin.ModuleCreator
{
[PrivateApi("Mark this as private, since it's not very useful in the public docs")]
public class ModuleInfo : IModule
{
public ModuleDefinition ModuleDefinition => new ModuleDefinition

View File

@ -1,95 +0,0 @@
@using Oqtane.Modules.Controls
@using [Owner].[Module]s.Services
@using [Owner].[Module]s.Models
@namespace [Owner].[Module]s.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">Name: </label>
</td>
<td>
<input id="_name" class="form-control" @bind="@_name" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Save">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br />
<br />
@if (PageState.Action == "Edit")
{
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
}
@code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Actions => "Add,Edit";
I[Module]Service [Module]Service;
int _id;
string _name;
string _createdby;
DateTime _createdon;
string _modifiedby;
DateTime _modifiedon;
protected override async Task OnInitializedAsync()
{
try
{
[Module]Service = new [Module]Service(http, sitestate);
if (PageState.Action == "Edit")
{
_id = Int32.Parse(PageState.QueryString["id"]);
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
if ([Module] != null)
{
_name = [Module].Name;
_createdby = [Module].CreatedBy;
_createdon = [Module].CreatedOn;
_modifiedby = [Module].ModifiedBy;
_modifiedon = [Module].ModifiedOn;
}
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading [Module] {[Module]Id} {Error}", _id, ex.Message);
AddModuleMessage("Error Loading [Module]", MessageType.Error);
}
}
private async Task Save()
{
try
{
if (PageState.Action == "Add")
{
[Module] [Module] = new [Module]();
[Module].ModuleId = ModuleState.ModuleId;
[Module].Name = _name;
[Module] = await [Module]Service.Add[Module]Async([Module]);
await logger.LogInformation("[Module] Added {[Module]}", [Module]);
}
else
{
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
[Module].Name = _name;
await [Module]Service.Update[Module]Async([Module]);
await logger.LogInformation("[Module] Updated {[Module]}", [Module]);
}
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving [Module] {Error}", ex.Message);
AddModuleMessage("Error Saving [Module]", MessageType.Error);
}
}
}

View File

@ -1,106 +0,0 @@
@using [Owner].[Module]s.Services
@using [Owner].[Module]s.Models
@namespace [Owner].[Module]s.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
@if (_[Module]s == null)
{
<p><em>Loading...</em></p>
}
else
{
<ActionLink Action="Add" Security="SecurityAccessLevel.Edit" Text="Add [Module]" />
<br />
<br />
@if (@_[Module]s.Count != 0)
{
<Pager Items="@_[Module]s" Format="Grid">
<Header>
<div class="col"><strong>[Module]s</strong></div>
</Header>
<Row>
<div class="col">
<ActionLink Action="Edit" Parameters="@($"id=" + context.[Module]Id.ToString())" />
<ActionDialog Header="Delete [Module]" Message="@("Are You Sure You Wish To Delete The " + context.Name + " [Module]?")" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" />
@context.Name
</div>
</Row>
</Pager>
}
else
{
<p>No [Module]s To Display</p>
}
}
<!-- The content below is for informational purposes only and can be safely removed -->
<hr />
[Module] Module Created Successfully. Use Edit Mode To Add A [Module]. You Can Access The Files At The Following Locations:<br /><br />
[RootPath]Client\<br />
- [Owner].[Module]s.Client.csproj - client project<br />
- _Imports.razor - global imports for module components<br />
- Edit.razor - component for adding or editing content<br />
- Index.razor - main component for your module **the content you are reading is in this file**<br />
- ModuleInfo.cs - implements IModule interface to provide configuration settings for your module<br />
- Settings.razor - component for managing module settings<br />
- Services\I[Module]Service.cs - interface for defining service API methods<br />
- Services\[Module]Service.cs - implements service API interface methods<br /><br />
[RootPath]Package\<br />
- [Owner].[Module]s.nuspec - nuget manifest for packaging module<br />
- [Owner].[Module]s.Package.csproj - packaging project<br />
- debug.cmd - copies assemblies to Oqtane bin folder when in Debug mode<br />
- release.cmd - creates nuget package and deploys to Oqtane wwwroot/modules folder when in Release mode<br /><br />
[RootPath]Server\<br />
- [Owner].[Module]s.Server.csproj - server project<br />
- Controllers\[Module]Controller.cs - API methods implemented using a REST pattern<br />
- Manager\[Module]Manager.cs - implements optional module interfaces for features such as import/export of content<br />
- Repository\I[Module]Repository.cs - interface for defining repository methods<br />
- Repository\[Module]Respository.cs - implements repository interface methods for data access using EF Core<br />
- Repository\[Module]Context.cs - provides a DB Context for data access<br />
- Scripts\[Owner].[Module].1.0.0.sql - database schema definition script<br /><br />
- Scripts\[Owner].[Module].Uninstall.sql - database uninstall script<br /><br />
[RootPath]Shared\<br />
- [Owner].[Module]s.csproj - shared project<br />
- Models\[Module].cs - model definition<br /><br />
<!-- The content above is for informational purposes only and can be safely removed -->
@code {
I[Module]Service [Module]Service;
List<[Module]> _[Module]s;
protected override async Task OnInitializedAsync()
{
try
{
[Module]Service = new [Module]Service(http, sitestate);
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading [Module] {Error}", ex.Message);
AddModuleMessage("Error Loading [Module]", MessageType.Error);
}
}
private async Task Delete([Module] [Module])
{
try
{
await [Module]Service.Delete[Module]Async([Module].[Module]Id);
await logger.LogInformation("[Module] Deleted {[Module]}", [Module]);
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting [Module] {[Module]} {Error}", [Module], ex.Message);
AddModuleMessage("Error Deleting [Module]", MessageType.Error);
}
}
}

View File

@ -1,18 +0,0 @@
using Oqtane.Models;
using Oqtane.Modules;
namespace [Owner].[Module]s.Modules
{
public class ModuleInfo : IModule
{
public ModuleDefinition ModuleDefinition => new ModuleDefinition
{
Name = "[Module]",
Description = "[Module]",
Version = "1.0.0",
Dependencies = "[Owner].[Module]s.Shared.Oqtane",
ServerManagerType = "[ServerManagerType]",
ReleaseVersions = "1.0.0"
};
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Services
{
public interface I[Module]Service
{
Task<List<[Module]>> Get[Module]sAsync(int ModuleId);
Task<[Module]> Get[Module]Async(int [Module]Id);
Task<[Module]> Add[Module]Async([Module] [Module]);
Task<[Module]> Update[Module]Async([Module] [Module]);
Task Delete[Module]Async(int [Module]Id);
}
}

View File

@ -1,49 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Oqtane.Modules;
using Oqtane.Services;
using Oqtane.Shared;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Services
{
public class [Module]Service : ServiceBase, I[Module]Service, IService
{
private readonly SiteState _siteState;
public [Module]Service(HttpClient http, SiteState siteState) : base(http)
{
_siteState = siteState;
}
private string Apiurl=> CreateApiUrl(_siteState.Alias, "[Module]");
public async Task<List<[Module]>> Get[Module]sAsync(int ModuleId)
{
List<[Module]> [Module]s = await GetJsonAsync<List<[Module]>>($"{Apiurl}?moduleid={ModuleId}");
return [Module]s.OrderBy(item => item.Name).ToList();
}
public async Task<[Module]> Get[Module]Async(int [Module]Id)
{
return await GetJsonAsync<[Module]>($"{Apiurl}/{[Module]Id}");
}
public async Task<[Module]> Add[Module]Async([Module] [Module])
{
return await PostJsonAsync<[Module]>($"{Apiurl}?entityid={[Module].ModuleId}", [Module]);
}
public async Task<[Module]> Update[Module]Async([Module] [Module])
{
return await PutJsonAsync<[Module]>($"{Apiurl}/{[Module].[Module]Id}?entityid={[Module].ModuleId}", [Module]);
}
public async Task Delete[Module]Async(int [Module]Id)
{
await DeleteAsync($"{Apiurl}/{[Module]Id}");
}
}
}

View File

@ -1,40 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<Version>1.0.0</Version>
<Authors>[Owner]</Authors>
<Company>[Owner]</Company>
<Description>[Description]</Description>
<Product>[Owner].[Module]s</Product>
<Copyright>[Owner]</Copyright>
<AssemblyName>[Owner].[Module]s.Client.Oqtane</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0-rc1.20223.4" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.0-rc1.20217.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\[Owner].[Module]s.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Oqtane.Client">
<HintPath>..\..\[RootFolder]\Oqtane.Client\bin\Debug\netstandard2.1\Oqtane.Client.dll</HintPath>
</Reference>
<Reference Include="Oqtane.Shared">
<HintPath>..\..\[RootFolder]\Oqtane.Client\bin\Debug\netstandard2.1\Oqtane.Shared.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup>
<!-- there may be other elements here -->
<BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
</Project>

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>[Owner].[Module]s</id>
<version>1.0.0</version>
<authors>[Owner]</authors>
<owners>[Owner]</owners>
<title>[Module]s</title>
<description>[Module]s</description>
<copyright>[Owner]</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
<tags>oqtane module</tags>
<releaseNotes></releaseNotes>
<summary></summary>
<dependencies>
<dependency id="Oqtane.Framework" version="[FrameworkVersion]" />
</dependencies>
</metadata>
<files>
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" target="lib" />
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" target="lib" />
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" target="lib" />
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" target="lib" />
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" target="lib" />
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" target="lib" />
<file src="..\wwwroot\**\*.*" target="wwwroot" />
</files>
</package>

View File

@ -1,6 +0,0 @@
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
XCOPY "..\Client\bin\Debug\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y

View File

@ -1,2 +0,0 @@
"..\..\[RootFolder]\oqtane.package\nuget.exe" pack [Owner].[Module]s.nuspec
XCOPY "*.nupkg" "..\..\[RootFolder]\Oqtane.Server\wwwroot\Modules\" /Y

View File

@ -1,75 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using Oqtane.Shared;
using Oqtane.Enums;
using Oqtane.Infrastructure;
using [Owner].[Module]s.Models;
using [Owner].[Module]s.Repository;
namespace [Owner].[Module]s.Controllers
{
[Route("{site}/api/[controller]")]
public class [Module]Controller : Controller
{
private readonly I[Module]Repository _[Module]s;
private readonly ILogManager _logger;
public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger)
{
_[Module]s = [Module]s;
_logger = logger;
}
// GET: api/<controller>?moduleid=x
[HttpGet]
[Authorize(Roles = Constants.RegisteredRole)]
public IEnumerable<[Module]> Get(string moduleid)
{
return _[Module]s.Get[Module]s(int.Parse(moduleid));
}
// GET api/<controller>/5
[HttpGet("{id}")]
[Authorize(Roles = Constants.RegisteredRole)]
public [Module] Get(int id)
{
return _[Module]s.Get[Module](id);
}
// POST api/<controller>
[HttpPost]
[Authorize(Roles = Constants.AdminRole)]
public [Module] Post([FromBody] [Module] [Module])
{
if (ModelState.IsValid)
{
[Module] = _[Module]s.Add[Module]([Module]);
_logger.Log(LogLevel.Information, this, LogFunction.Create, "[Module] Added {[Module]}", [Module]);
}
return [Module];
}
// PUT api/<controller>/5
[HttpPut("{id}")]
[Authorize(Roles = Constants.AdminRole)]
public [Module] Put(int id, [FromBody] [Module] [Module])
{
if (ModelState.IsValid)
{
[Module] = _[Module]s.Update[Module]([Module]);
_logger.Log(LogLevel.Information, this, LogFunction.Update, "[Module] Updated {[Module]}", [Module]);
}
return [Module];
}
// DELETE api/<controller>/5
[HttpDelete("{id}")]
[Authorize(Roles = Constants.AdminRole)]
public void Delete(int id)
{
_[Module]s.Delete[Module](id);
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id);
}
}
}

View File

@ -1,64 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Oqtane.Modules;
using Oqtane.Models;
using Oqtane.Infrastructure;
using Oqtane.Repository;
using [Owner].[Module]s.Models;
using [Owner].[Module]s.Repository;
namespace [Owner].[Module]s.Manager
{
public class [Module]Manager : IInstallable, IPortable
{
private I[Module]Repository _[Module]s;
private ISqlRepository _sql;
public [Module]Manager(I[Module]Repository [Module]s, ISqlRepository sql)
{
_[Module]s = [Module]s;
_sql = sql;
}
public bool Install(Tenant tenant, string version)
{
return _sql.ExecuteScript(tenant, GetType().Assembly, "[Owner].[Module]." + version + ".sql");
}
public bool Uninstall(Tenant tenant)
{
return _sql.ExecuteScript(tenant, GetType().Assembly, "[Owner].[Module].Uninstall.sql");
}
public string ExportModule(Module module)
{
string content = "";
List<[Module]> [Module]s = _[Module]s.Get[Module]s(module.ModuleId).ToList();
if ([Module]s != null)
{
content = JsonSerializer.Serialize([Module]s);
}
return content;
}
public void ImportModule(Module module, string content, string version)
{
List<[Module]> [Module]s = null;
if (!string.IsNullOrEmpty(content))
{
[Module]s = JsonSerializer.Deserialize<List<[Module]>>(content);
}
if ([Module]s != null)
{
foreach([Module] [Module] in [Module]s)
{
[Module] _[Module] = new [Module]();
_[Module].ModuleId = module.ModuleId;
_[Module].Name = [Module].Name;
_[Module]s.Add[Module](_[Module]);
}
}
}
}
}

View File

@ -1,14 +0,0 @@
using System.Collections.Generic;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public interface I[Module]Repository
{
IEnumerable<[Module]> Get[Module]s(int ModuleId);
[Module] Get[Module](int [Module]Id);
[Module] Add[Module]([Module] [Module]);
[Module] Update[Module]([Module] [Module]);
void Delete[Module](int [Module]Id);
}
}

View File

@ -1,18 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Http;
using Oqtane.Modules;
using Oqtane.Repository;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public class [Module]Context : DBContextBase, IService
{
public virtual DbSet<[Module]> [Module] { get; set; }
public [Module]Context(ITenantResolver tenantResolver, IHttpContextAccessor accessor) : base(tenantResolver, accessor)
{
// ContextBase handles multi-tenant database connections
}
}
}

View File

@ -1,49 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Collections.Generic;
using Oqtane.Modules;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public class [Module]Repository : I[Module]Repository, IService
{
private readonly [Module]Context _db;
public [Module]Repository([Module]Context context)
{
_db = context;
}
public IEnumerable<[Module]> Get[Module]s(int ModuleId)
{
return _db.[Module].Where(item => item.ModuleId == ModuleId);
}
public [Module] Get[Module](int [Module]Id)
{
return _db.[Module].Find([Module]Id);
}
public [Module] Add[Module]([Module] [Module])
{
_db.[Module].Add([Module]);
_db.SaveChanges();
return [Module];
}
public [Module] Update[Module]([Module] [Module])
{
_db.Entry([Module]).State = EntityState.Modified;
_db.SaveChanges();
return [Module];
}
public void Delete[Module](int [Module]Id)
{
[Module] [Module] = _db.[Module].Find([Module]Id);
_db.[Module].Remove([Module]);
_db.SaveChanges();
}
}
}

View File

@ -1,26 +0,0 @@
/*
Create [Owner][Module] table
*/
CREATE TABLE [dbo].[[Owner][Module]](
[[Module]Id] [int] IDENTITY(1,1) NOT NULL,
[ModuleId] [int] NOT NULL,
[Name] [nvarchar](256) NOT NULL,
[CreatedBy] [nvarchar](256) NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL,
CONSTRAINT [PK_[Owner][Module]] PRIMARY KEY CLUSTERED
(
[[Module]Id] ASC
)
)
GO
/*
Create foreign key relationships
*/
ALTER TABLE [dbo].[[Owner][Module]] WITH CHECK ADD CONSTRAINT [FK_[Owner][Module]_Module] FOREIGN KEY([ModuleId])
REFERENCES [dbo].Module ([ModuleId])
ON DELETE CASCADE
GO

View File

@ -1,6 +0,0 @@
/*
Remove [Owner][Module] table
*/
DROP TABLE [dbo].[[Owner][Module]]
GO

View File

@ -1,42 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.3</LangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<Version>1.0.0</Version>
<Product>[Owner].[Module]s</Product>
<Authors>[Owner]</Authors>
<Company>[Owner]</Company>
<Description>[Description]</Description>
<Copyright>[Owner]</Copyright>
<AssemblyName>[Owner].[Module]s.Server.Oqtane</AssemblyName>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Scripts\[Owner].[Module].1.0.0.sql" />
<EmbeddedResource Include="Scripts\[Owner].[Module].Uninstall.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\[Owner].[Module]s.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Oqtane.Server">
<HintPath>..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\Oqtane.Server.dll</HintPath>
</Reference>
<Reference Include="Oqtane.Shared">
<HintPath>..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\Oqtane.Shared.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@ -1,19 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using Oqtane.Models;
namespace [Owner].[Module]s.Models
{
[Table("[Owner][Module]")]
public class [Module] : IAuditable
{
public int [Module]Id { get; set; }
public int ModuleId { get; set; }
public string Name { get; set; }
public string CreatedBy { get; set; }
public DateTime CreatedOn { get; set; }
public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; }
}
}

View File

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
<Version>1.0.0</Version>
<Product>[Owner].[Module]s</Product>
<Authors>[Owner]</Authors>
<Company>[Owner]</Company>
<Description>[Description]</Description>
<Copyright>[Owner]</Copyright>
<AssemblyName>[Owner].[Module]s.Shared.Oqtane</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Oqtane.Shared">
<HintPath>..\..\[RootFolder]\Oqtane.Shared\bin\Debug\netstandard2.1\Oqtane.Shared.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@ -1,95 +0,0 @@
@using Oqtane.Modules.Controls
@using [Owner].[Module]s.Services
@using [Owner].[Module]s.Models
@namespace [Owner].[Module]s.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">Name: </label>
</td>
<td>
<input id="_name" class="form-control" @bind="@_name" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Save">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br />
<br />
@if (PageState.Action == "Edit")
{
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
}
@code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Actions => "Add,Edit";
I[Module]Service [Module]Service;
int _id;
string _name;
string _createdby;
DateTime _createdon;
string _modifiedby;
DateTime _modifiedon;
protected override async Task OnInitializedAsync()
{
try
{
[Module]Service = new [Module]Service(http, sitestate);
if (PageState.Action == "Edit")
{
_id = Int32.Parse(PageState.QueryString["id"]);
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
if ([Module] != null)
{
_name = [Module].Name;
_createdby = [Module].CreatedBy;
_createdon = [Module].CreatedOn;
_modifiedby = [Module].ModifiedBy;
_modifiedon = [Module].ModifiedOn;
}
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading [Module] {[Module]Id} {Error}", _id, ex.Message);
AddModuleMessage("Error Loading [Module]", MessageType.Error);
}
}
private async Task Save()
{
try
{
if (PageState.Action == "Add")
{
[Module] [Module] = new [Module]();
[Module].ModuleId = ModuleState.ModuleId;
[Module].Name = _name;
[Module] = await [Module]Service.Add[Module]Async([Module]);
await logger.LogInformation("[Module] Added {[Module]}", [Module]);
}
else
{
[Module] [Module] = await [Module]Service.Get[Module]Async(_id);
[Module].Name = _name;
await [Module]Service.Update[Module]Async([Module]);
await logger.LogInformation("[Module] Updated {[Module]}", [Module]);
}
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving [Module] {Error}", ex.Message);
AddModuleMessage("Error Saving [Module]", MessageType.Error);
}
}
}

View File

@ -1,97 +0,0 @@
@using [Owner].[Module]s.Services
@using [Owner].[Module]s.Models
@namespace [Owner].[Module]s.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
@if (_[Module]s == null)
{
<p><em>Loading...</em></p>
}
else
{
<ActionLink Action="Add" Security="SecurityAccessLevel.Edit" Text="Add [Module]" />
<br />
<br />
@if (@_[Module]s.Count != 0)
{
<Pager Items="@_[Module]s" Format="Grid">
<Header>
<div class="col"><strong>[Module]s</strong></div>
</Header>
<Row>
<div class="col">
<ActionLink Action="Edit" Parameters="@($"id=" + context.[Module]Id.ToString())" />
<ActionDialog Header="Delete [Module]" Message="@("Are You Sure You Wish To Delete The " + context.Name + " [Module]?")" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" />
@context.Name
</div>
</Row>
</Pager>
}
else
{
<p>No [Module]s To Display</p>
}
}
<!-- The content below is for informational purposes only and can be safely removed -->
<hr />
[Module] Module Created Successfully. Use Edit Mode To Add A [Module]. You Can Access The Files At The Following Locations:<br /><br />
[RootPath]Oqtane.Client\Modules\[Module]\<br />
- Edit.razor - component for adding or editing content<br />
- Index.razor - main component for your module **the content you are reading is in this file**<br />
- ModuleInfo.cs - implements IModule interface to provide configuration settings for your module<br />
- Settings.razor - component for managing module settings<br />
- Services\I[Module]Service.cs - interface for defining service API methods<br />
- Services\[Module]Service.cs - implements service API interface methods<br /><br />
[RootPath]Oqtane.Server\Modules\[Module]\<br />
- Controllers\[Module]Controller.cs - API methods implemented using a REST pattern<br />
- Manager\[Module]Manager.cs - implements optional module interfaces for features such as import/export of content<br />
- Repository\I[Module]Repository.cs - interface for defining repository methods<br />
- Repository\[Module]Respository.cs - implements repository interface methods for data access using EF Core<br />
- Repository\[Module]Context.cs - provides a DB Context for data access<br />
- Scripts\[Owner].[Module].1.0.0.sql - database schema definition script<br /><br />
- Scripts\[Owner].[Module].Uninstall.sql - database uninstall script<br /><br />
[RootPath]Oqtane.Shared\Modules\[Module]\<br />
- Models\[Module].cs - model definition<br /><br />
<!-- The content above is for informational purposes only and can be safely removed -->
@code {
I[Module]Service [Module]Service;
List<[Module]> _[Module]s;
protected override async Task OnInitializedAsync()
{
try
{
[Module]Service = new [Module]Service(http, sitestate);
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading [Module] {Error}", ex.Message);
AddModuleMessage("Error Loading [Module]", MessageType.Error);
}
}
private async Task Delete([Module] [Module])
{
try
{
await [Module]Service.Delete[Module]Async([Module].[Module]Id);
await logger.LogInformation("[Module] Deleted {[Module]}", [Module]);
_[Module]s = await [Module]Service.Get[Module]sAsync(ModuleState.ModuleId);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting [Module] {[Module]} {Error}", [Module], ex.Message);
AddModuleMessage("Error Deleting [Module]", MessageType.Error);
}
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Services
{
public interface I[Module]Service
{
Task<List<[Module]>> Get[Module]sAsync(int ModuleId);
Task<[Module]> Get[Module]Async(int [Module]Id);
Task<[Module]> Add[Module]Async([Module] [Module]);
Task<[Module]> Update[Module]Async([Module] [Module]);
Task Delete[Module]Async(int [Module]Id);
}
}

View File

@ -1,49 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Oqtane.Modules;
using Oqtane.Services;
using Oqtane.Shared;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Services
{
public class [Module]Service : ServiceBase, I[Module]Service, IService
{
private readonly SiteState _siteState;
public [Module]Service(HttpClient http, SiteState siteState) : base(http)
{
_siteState = siteState;
}
private string Apiurl=> CreateApiUrl(_siteState.Alias, "[Module]");
public async Task<List<[Module]>> Get[Module]sAsync(int ModuleId)
{
List<[Module]> [Module]s = await GetJsonAsync<List<[Module]>>($"{Apiurl}?moduleid={ModuleId}");
return [Module]s.OrderBy(item => item.Name).ToList();
}
public async Task<[Module]> Get[Module]Async(int [Module]Id)
{
return await GetJsonAsync<[Module]>($"{Apiurl}/{[Module]Id}");
}
public async Task<[Module]> Add[Module]Async([Module] [Module])
{
return await PostJsonAsync<[Module]>($"{Apiurl}?entityid={[Module].ModuleId}", [Module]);
}
public async Task<[Module]> Update[Module]Async([Module] [Module])
{
return await PutJsonAsync<[Module]>($"{Apiurl}/{[Module].[Module]Id}?entityid={[Module].ModuleId}", [Module]);
}
public async Task Delete[Module]Async(int [Module]Id)
{
await DeleteAsync($"{Apiurl}/{[Module]Id}");
}
}
}

View File

@ -1,47 +0,0 @@
@namespace [Owner].[Module]s.Modules
@inherits ModuleBase
@inject ISettingService SettingService
<table class="table table-borderless">
<tr>
<td>
<label for="Setting" class="control-label">Setting: </label>
</td>
<td>
<input type="text" class="form-control" @bind="_value" />
</td>
</tr>
</table>
@code {
public override string Title => "[Module] Settings";
string _value;
protected override async Task OnInitializedAsync()
{
try
{
Dictionary<string, string> settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
_value = SettingService.GetSetting(settings, "SettingName", "");
}
catch (Exception ex)
{
ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error);
}
}
public async Task UpdateSettings()
{
try
{
Dictionary<string, string> settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
SettingService.SetSetting(settings, "SettingName", _value);
await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId);
}
catch (Exception ex)
{
ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error);
}
}
}

View File

@ -1,75 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using Oqtane.Shared;
using Oqtane.Enums;
using Oqtane.Infrastructure;
using [Owner].[Module]s.Models;
using [Owner].[Module]s.Repository;
namespace [Owner].[Module]s.Controllers
{
[Route("{site}/api/[controller]")]
public class [Module]Controller : Controller
{
private readonly I[Module]Repository _[Module]s;
private readonly ILogManager _logger;
public [Module]Controller(I[Module]Repository [Module]s, ILogManager logger)
{
_[Module]s = [Module]s;
_logger = logger;
}
// GET: api/<controller>?moduleid=x
[HttpGet]
[Authorize(Roles = Constants.RegisteredRole)]
public IEnumerable<[Module]> Get(string moduleid)
{
return _[Module]s.Get[Module]s(int.Parse(moduleid));
}
// GET api/<controller>/5
[HttpGet("{id}")]
[Authorize(Roles = Constants.RegisteredRole)]
public [Module] Get(int id)
{
return _[Module]s.Get[Module](id);
}
// POST api/<controller>
[HttpPost]
[Authorize(Roles = Constants.AdminRole)]
public [Module] Post([FromBody] [Module] [Module])
{
if (ModelState.IsValid)
{
[Module] = _[Module]s.Add[Module]([Module]);
_logger.Log(LogLevel.Information, this, LogFunction.Create, "[Module] Added {[Module]}", [Module]);
}
return [Module];
}
// PUT api/<controller>/5
[HttpPut("{id}")]
[Authorize(Roles = Constants.AdminRole)]
public [Module] Put(int id, [FromBody] [Module] [Module])
{
if (ModelState.IsValid)
{
[Module] = _[Module]s.Update[Module]([Module]);
_logger.Log(LogLevel.Information, this, LogFunction.Update, "[Module] Updated {[Module]}", [Module]);
}
return [Module];
}
// DELETE api/<controller>/5
[HttpDelete("{id}")]
[Authorize(Roles = Constants.AdminRole)]
public void Delete(int id)
{
_[Module]s.Delete[Module](id);
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "[Module] Deleted {[Module]Id}", id);
}
}
}

View File

@ -1,64 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Oqtane.Modules;
using Oqtane.Models;
using Oqtane.Infrastructure;
using Oqtane.Repository;
using [Owner].[Module]s.Models;
using [Owner].[Module]s.Repository;
namespace [Owner].[Module]s.Manager
{
public class [Module]Manager : IInstallable, IPortable
{
private I[Module]Repository _[Module]s;
private ISqlRepository _sql;
public [Module]Manager(I[Module]Repository [Module]s, ISqlRepository sql)
{
_[Module]s = [Module]s;
_sql = sql;
}
public bool Install(Tenant tenant, string version)
{
return _sql.ExecuteScript(tenant, GetType().Assembly, "[Owner].[Module]." + version + ".sql");
}
public bool Uninstall(Tenant tenant)
{
return _sql.ExecuteScript(tenant, GetType().Assembly, "[Owner].[Module].Uninstall.sql");
}
public string ExportModule(Module module)
{
string content = "";
List<[Module]> [Module]s = _[Module]s.Get[Module]s(module.ModuleId).ToList();
if ([Module]s != null)
{
content = JsonSerializer.Serialize([Module]s);
}
return content;
}
public void ImportModule(Module module, string content, string version)
{
List<[Module]> [Module]s = null;
if (!string.IsNullOrEmpty(content))
{
[Module]s = JsonSerializer.Deserialize<List<[Module]>>(content);
}
if ([Module]s != null)
{
foreach([Module] [Module] in [Module]s)
{
[Module] _[Module] = new [Module]();
_[Module].ModuleId = module.ModuleId;
_[Module].Name = [Module].Name;
_[Module]s.Add[Module](_[Module]);
}
}
}
}
}

View File

@ -1,14 +0,0 @@
using System.Collections.Generic;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public interface I[Module]Repository
{
IEnumerable<[Module]> Get[Module]s(int ModuleId);
[Module] Get[Module](int [Module]Id);
[Module] Add[Module]([Module] [Module]);
[Module] Update[Module]([Module] [Module]);
void Delete[Module](int [Module]Id);
}
}

View File

@ -1,18 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Http;
using Oqtane.Modules;
using Oqtane.Repository;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public class [Module]Context : DBContextBase, IService
{
public virtual DbSet<[Module]> [Module] { get; set; }
public [Module]Context(ITenantResolver tenantResolver, IHttpContextAccessor accessor) : base(tenantResolver, accessor)
{
// ContextBase handles multi-tenant database connections
}
}
}

View File

@ -1,49 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Collections.Generic;
using Oqtane.Modules;
using [Owner].[Module]s.Models;
namespace [Owner].[Module]s.Repository
{
public class [Module]Repository : I[Module]Repository, IService
{
private readonly [Module]Context _db;
public [Module]Repository([Module]Context context)
{
_db = context;
}
public IEnumerable<[Module]> Get[Module]s(int ModuleId)
{
return _db.[Module].Where(item => item.ModuleId == ModuleId);
}
public [Module] Get[Module](int [Module]Id)
{
return _db.[Module].Find([Module]Id);
}
public [Module] Add[Module]([Module] [Module])
{
_db.[Module].Add([Module]);
_db.SaveChanges();
return [Module];
}
public [Module] Update[Module]([Module] [Module])
{
_db.Entry([Module]).State = EntityState.Modified;
_db.SaveChanges();
return [Module];
}
public void Delete[Module](int [Module]Id)
{
[Module] [Module] = _db.[Module].Find([Module]Id);
_db.[Module].Remove([Module]);
_db.SaveChanges();
}
}
}

View File

@ -1,26 +0,0 @@
/*
Create [Owner][Module] table
*/
CREATE TABLE [dbo].[[Owner][Module]](
[[Module]Id] [int] IDENTITY(1,1) NOT NULL,
[ModuleId] [int] NOT NULL,
[Name] [nvarchar](256) NOT NULL,
[CreatedBy] [nvarchar](256) NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL,
CONSTRAINT [PK_[Owner][Module]] PRIMARY KEY CLUSTERED
(
[[Module]Id] ASC
)
)
GO
/*
Create foreign key relationships
*/
ALTER TABLE [dbo].[[Owner][Module]] WITH CHECK ADD CONSTRAINT [FK_[Owner][Module]_Module] FOREIGN KEY([ModuleId])
REFERENCES [dbo].Module ([ModuleId])
ON DELETE CASCADE
GO

View File

@ -1,6 +0,0 @@
/*
Remove [Owner][Module] table
*/
DROP TABLE [dbo].[[Owner][Module]]
GO

View File

@ -1,104 +1,263 @@
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IFileService FileService
@inject IModuleDefinitionService ModuleDefinitionService
@inject IPackageService PackageService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_packages != null)
{
<TabStrip>
@if (_packages.Count > 0)
<TabStrip>
<TabPanel Name="Download" ResourceKey="Download">
<div class="row justify-content-center mb-3">
<div class="col-sm-6">
<div class="input-group">
<select id="price" class="form-select custom-select" @onchange="(e => PriceChanged(e))">
<option value="free">@SharedLocalizer["Free"]</option>
<option value="paid">@SharedLocalizer["Paid"]</option>
</select>
<input id="search" class="form-control" placeholder="@SharedLocalizer["Search.Hint"]" @bind="@_search" />
<button type="button" class="btn btn-primary" @onclick="Search">@SharedLocalizer["Search"]</button>
<button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Reset"]</button>
</div>
</div>
</div>
@if (_packages != null)
{
<TabPanel Name="Download">
<ModuleMessage Type="MessageType.Info" Message="Download one or more modules from the list below. Once you are ready click Install to complete the installation."></ModuleMessage>
<Pager Items="@_packages">
<Header>
<th>Name</th>
<th>Version</th>
<th></th>
</Header>
<Row>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
<button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadModule(context.PackageId, context.Version))>Download</button>
</td>
</Row>
</Pager>
</TabPanel>
}
<TabPanel Name="Upload">
<table class="table table-borderless">
<tr>
<td>
<Label HelpText="Upload one or more module packages. Once they are uploaded click Install to complete the installation.">Module: </Label>
</td>
<td>
<FileManager Filter="nupkg" ShowFiles="false" Folder="Modules" UploadMultiple="True" />
</td>
</tr>
</table>
</TabPanel>
</TabStrip>
<button type="button" class="btn btn-success" @onclick="InstallModules">Install</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
}
@code {
private List<Package> _packages;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
var moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
_packages = await PackageService.GetPackagesAsync("module");
foreach (Package package in _packages.ToArray())
if (_packages.Count > 0)
{
if (moduledefinitions.Exists(item => Utilities.GetTypeName(item.ModuleDefinitionName) == package.PackageId))
{
_packages.Remove(package);
}
<Pager Items="@_packages">
<Row>
<td>
<h3 style="display: inline;"><a href="@context.ProductUrl" target="_new">@context.Name</a></h3>&nbsp;&nbsp;by:&nbsp;&nbsp;<strong><a href="@context.OwnerUrl" target="new">@context.Owner</a></strong><br />
@(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)<br />
<strong>@(String.Format("{0:n0}", context.Downloads))</strong> @SharedLocalizer["Search.Downloads"]&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Released"]: <strong>@context.ReleaseDate.ToString("MMM dd, yyyy")</strong>&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Version"]: <strong>@context.Version</strong>
@((MarkupString)(!string.IsNullOrEmpty(context.PackageUrl) ? "&nbsp;&nbsp;|&nbsp;&nbsp;" + SharedLocalizer["Search.Source"] + ": <strong>" + new Uri(context.PackageUrl).Host + "</strong>" : ""))
@((MarkupString)(context.TrialPeriod > 0 ? "&nbsp;&nbsp;|&nbsp;&nbsp;<strong>" + context.TrialPeriod + " " + @SharedLocalizer["Trial"] + "</strong>" : ""))
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PackageUrl))
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl))
{
<a class="btn btn-primary" style="text-decoration: none !important" href="@context.PaymentUrl" target="_new">@context.Price.Value.ToString("$#,##0.00")</a>
}
else
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
</Row>
</Pager>
}
else
{
<br />
<div class="mx-auto text-center">
@Localizer["Search.NoResults"]
</div>
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Packages {Error}", ex.Message);
AddModuleMessage("Error Loading Packages", MessageType.Error);
}
}
</TabPanel>
<TabPanel Name="Upload" ResourceKey="Upload">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" HelpText="Upload one or more module packages. Once they are uploaded click Install to complete the installation." ResourceKey="Module">Module: </Label>
<div class="col-sm-9">
<FileManager Folder="@Constants.PackagesFolder" UploadMultiple="true" />
</div>
</div>
</div>
</TabPanel>
</TabStrip>
private async Task InstallModules()
{
try
{
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Installating Module");
}
}
private async Task DownloadModule(string packageid, string version)
{
try
{
await PackageService.DownloadPackageAsync(packageid, version, "Modules");
await logger.LogInformation("Module {ModuleDefinitionName} {Version} Downloaded Successfully", packageid, version);
AddModuleMessage("Modules Downloaded Successfully. Click Install To Complete Installation.", MessageType.Success);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Module {ModuleDefinitionName} {Version}", packageid, version);
AddModuleMessage("Error Downloading Module", MessageType.Error);
}
}
@if (_productname != "")
{
<div class="app-actiondialog">
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@SharedLocalizer["Review License Terms"]</h5>
<button type="button" class="btn-close" aria-label="Close" @onclick="HideModal"></button>
</div>
<div class="modal-body">
<p style="height: 200px; overflow-y: scroll;">
<h3>@_productname</h3>
@if (!string.IsNullOrEmpty(_packagelicense))
{
@((MarkupString)_packagelicense)
}
else
{
@SharedLocalizer["License Not Specified"]
}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" @onclick="DownloadPackage">@SharedLocalizer["Accept"]</button>
<button type="button" class="btn btn-secondary" @onclick="HideModal">@SharedLocalizer["Cancel"]</button>
</div>
</div>
</div>
</div>
</div>
}
<button type="button" class="btn btn-success" @onclick="InstallModules">@SharedLocalizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<ModuleMessage Type="MessageType.Info" Message="@SharedLocalizer["Oqtane.Marketplace"]" />
@code {
private List<Package> _packages;
private string _price = "free";
private string _search = "";
private string _productname = "";
private string _packageid = "";
private string _packagelicense = "";
private string _packageversion = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
await LoadModuleDefinitions();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Packages {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Package.Load"], MessageType.Error);
}
}
private async Task LoadModuleDefinitions()
{
var moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
_packages = await PackageService.GetPackagesAsync("module", _search, _price, "");
if (_packages != null)
{
foreach (Package package in _packages.ToArray())
{
if (moduledefinitions.Exists(item => item.PackageName == package.PackageId))
{
_packages.Remove(package);
}
}
}
}
private async void PriceChanged(ChangeEventArgs e)
{
try
{
_price = (string)e.Value;
_search = "";
await LoadModuleDefinitions();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On PriceChanged");
}
}
private async Task Search()
{
try
{
await LoadModuleDefinitions();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Search");
}
}
private async Task Reset()
{
try
{
_search = "";
await LoadModuleDefinitions();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Reset");
}
}
private void HideModal()
{
_productname = "";
_packagelicense = "";
StateHasChanged();
}
private async Task GetPackage(string packageid, string version)
{
try
{
var package = await PackageService.GetPackageAsync(packageid, version);
if (package != null)
{
_productname = package.Name;
_packageid = package.PackageId;
if (!string.IsNullOrEmpty(package.License))
{
_packagelicense = package.License.Replace("\n", "<br />");
}
_packageversion = package.Version;
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Getting Package {PackageId} {Version}", packageid, version);
AddModuleMessage(Localizer["Error.Module.Download"], MessageType.Error);
}
}
private async Task DownloadPackage()
{
try
{
await PackageService.DownloadPackageAsync(_packageid, _packageversion, Constants.PackagesFolder);
await logger.LogInformation("Package {PackageId} {Version} Downloaded Successfully", _packageid, _packageversion);
AddModuleMessage(Localizer["Success.Module.Download"], MessageType.Success);
_productname = "";
_packagelicense = "";
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Package {PackageId} {Version}", _packageid, _packageversion);
AddModuleMessage(Localizer["Error.Module.Download"], MessageType.Error);
}
}
private async Task InstallModules()
{
try
{
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
AddModuleMessage(string.Format(Localizer["Success.Module.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Installing Modules");
}
}
}

View File

@ -0,0 +1,168 @@
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@inherits ModuleBase
@using System.Text.RegularExpressions
@inject NavigationManager NavigationManager
@inject IModuleDefinitionService ModuleDefinitionService
@inject IModuleService ModuleService
@inject ISettingService SettingService
@inject IStringLocalizer<Create> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_templates != null)
{
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="owner" HelpText="Enter the name of the organization who is developing this module. It should not contain spaces or punctuation." ResourceKey="OwnerName">Owner Name: </Label>
<div class="col-sm-9">
<input id="owner" class="form-control" @bind="@_owner" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="module" HelpText="Enter a name for this module. It should not contain spaces or punctuation." ResourceKey="ModuleName">Module Name: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_module" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="Enter a short description for the module" ResourceKey="Description">Description: </Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="3" maxlength="2000" required></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="template" HelpText="Select a module template. Templates are located in the wwwroot/Modules/Templates folder on the server." ResourceKey="Template">Template: </Label>
<div class="col-sm-9">
<select id="template" class="form-select" @onchange="(e => TemplateChanged(e))" required>
<option value="-">&lt;@Localizer["Template.Select"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Title</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="reference" HelpText="Select a framework reference version" ResourceKey="FrameworkReference">Framework Reference: </Label>
<div class="col-sm-9">
<select id="reference" class="form-select" @bind="@_reference" required>
@foreach (string version in _versions)
{
if (Version.Parse(version).CompareTo(Version.Parse(_minversion)) >= 0)
{
<option value="@(version)">@(version)</option>
}
}
<option value="local">@SharedLocalizer["LocalVersion"]</option>
</select>
</div>
</div>
@if (!string.IsNullOrEmpty(_location))
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="location" HelpText="Location where the module will be created" ResourceKey="Location">Location: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_location" readonly />
</div>
</div>
}
</div>
<button type="button" class="btn btn-success" @onclick="CreateModule">@Localizer["CreateModule"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</form>
}
@code {
private ElementReference form;
private bool validated = false;
private string _owner = string.Empty;
private string _module = string.Empty;
private string _description = string.Empty;
private List<Template> _templates;
private string _template = "-";
private string[] _versions;
private string _reference = "local";
private string _minversion = "2.0.0";
private string _location = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override void OnInitialized()
{
AddModuleMessage(Localizer["Info.Module.Development"], MessageType.Info);
}
protected override async Task OnParametersSetAsync()
{
try
{
_templates = await ModuleDefinitionService.GetModuleDefinitionTemplatesAsync();
_versions = Constants.ReleaseVersions.Split(',').Where(item => Version.Parse(item).CompareTo(Version.Parse("2.0.0")) >= 0).ToArray();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Module Creator");
}
}
private async Task CreateModule()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
try
{
if (IsValid(_owner) && IsValid(_module) && _owner != _module && _template != "-")
{
var moduleDefinition = new ModuleDefinition { Owner = _owner, Name = _module, Description = _description, Template = _template, Version = _reference };
moduleDefinition = await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition);
GetLocation();
AddModuleMessage(string.Format(Localizer["Success.Module.Create"], NavigateUrl("admin/system")), MessageType.Success);
}
else
{
AddModuleMessage(Localizer["Message.Require.ValidName"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Creating Module");
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && name.ToLower() != "module" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)
{
_template = (string)e.Value;
_minversion = "2.0.0";
if (_template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_minversion = template.Version;
}
GetLocation();
}
private void GetLocation()
{
_location = string.Empty;
if (_owner != "" && _module != "" && _template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_location = template.Location + _owner + "." + _module;
}
StateHasChanged();
}
}

View File

@ -1,184 +1,375 @@
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@inherits ModuleBase
@using System.Globalization
@using Microsoft.AspNetCore.Localization
@inject IModuleDefinitionService ModuleDefinitionService
@inject IPackageService PackageService
@inject ILanguageService LanguageService
@inject NavigationManager NavigationManager
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<TabStrip>
<TabPanel Name="Definition">
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="The name of the module">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="description" HelpText="The description of the module">Description: </Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="2"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="categories" HelpText="Comma delimited list of module categories">Categories: </Label>
</td>
<td>
<input id="categories" class="form-control" @bind="@_categories" />
</td>
</tr>
</table>
<Section Name="Information">
<table class="table table-borderless">
<tr>
<td>
<Label For="moduledefinitionname" HelpText="The internal name of the module">Internal Name: </Label>
</td>
<td>
<TabPanel Name="Definition" ResourceKey="Definition">
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="The name of the module" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="200" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="The description of the module" ResourceKey="Description">Description: </Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="2" maxlength="2000" required></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="categories" HelpText="Comma delimited list of module categories" ResourceKey="Categories">Categories: </Label>
<div class="col-sm-9">
<input id="categories" class="form-control" @bind="@_categories" maxlength="200" required />
</div>
</div>
</div>
</form>
<Section Name="Information" ResourceKey="Information">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="moduledefinitionname" HelpText="The internal name of the module" ResourceKey="InternalName">Internal Name: </Label>
<div class="col-sm-9">
<input id="moduledefinitionname" class="form-control" @bind="@_moduledefinitionname" disabled />
</td>
</tr>
<tr>
<td>
<Label For="version" HelpText="The version of the module">Version: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="version" HelpText="The version of the module" ResourceKey="Version">Version: </Label>
<div class="col-sm-9">
<input id="version" class="form-control" @bind="@_version" disabled />
</td>
</tr>
<tr>
<td>
<Label For="owner" HelpText="The owner or creator of the module">Owner: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="packagename" HelpText="The unique name of the package from which this module was installed" ResourceKey="PackageName">Package Name: </Label>
<div class="col-sm-9">
<input id="packagename" class="form-control" @bind="@_packagename" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="owner" HelpText="The owner or creator of the module" ResourceKey="Owner">Owner: </Label>
<div class="col-sm-9">
<input id="owner" class="form-control" @bind="@_owner" disabled />
</td>
</tr>
<tr>
<td>
<Label For="url" HelpText="The reference url of the module">Reference Url: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="The reference url of the module" ResourceKey="ReferenceUrl">Reference Url: </Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" disabled />
</td>
</tr>
<tr>
<td>
<Label For="contact" HelpText="The contact for the module">Contact: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="contact" HelpText="The contact for the module" ResourceKey="Contact">Contact: </Label>
<div class="col-sm-9">
<input id="contact" class="form-control" @bind="@_contact" disabled />
</td>
</tr>
<tr>
<td>
<Label For="license" HelpText="The license of the module">License: </Label>
</td>
<td>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="license" HelpText="The module license terms" ResourceKey="License">License: </Label>
<div class="col-sm-9">
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
</td>
</tr>
</table>
</Section>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="runtimes" HelpText="The Blazor runtimes which this module supports" ResourceKey="Runtimes">Runtimes: </Label>
<div class="col-sm-9">
<input id="runtimes" class="form-control" @bind="@_runtimes" disabled />
</div>
</div>
</div>
</Section>
<br />
<button type="button" class="btn btn-success" @onclick="SaveModuleDefinition">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
</TabPanel>
<TabPanel Name="Permissions">
<table class="table table-borderless">
<tr>
<td>
<PermissionGrid EntityName="@EntityNames.ModuleDefinition" PermissionNames="@PermissionNames.Utilize" Permissions="@_permissions" @ref="_permissionGrid" />
</td>
</tr>
</table>
<TabPanel Name="Permissions" ResourceKey="Permissions">
<div class="container">
<div class="row mb-1 align-items-center">
<PermissionGrid EntityName="@EntityNames.ModuleDefinition" PermissionNames="@PermissionNames.Utilize" Permissions="@_permissions" @ref="_permissionGrid" />
</div>
</div>
<button type="button" class="btn btn-success" @onclick="SaveModuleDefinition">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</TabPanel>
<TabPanel Name="Translations" ResourceKey="Translations">
@if (_languages != null && _languages.Count > 0)
{
<Pager Items="@_languages">
<Header>
<th>@SharedLocalizer["Name"]</th>
<th>@Localizer["Code"]</th>
<th>@Localizer["Version"]</th>
<th style="width: 1px;">&nbsp;</th>
</Header>
<Row>
<td>@context.Name</td>
<td>@context.Code</td>
<td>@context.Version</td>
<td>
@if (context.IsDefault)
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(_packagename + "." + context.Code))>@SharedLocalizer["Download"]</button>
}
else
{
if (UpgradeAvailable(_packagename + "." + context.Code, context.Version))
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadPackage(_packagename + "." + context.Code))>@SharedLocalizer["Upgrade"]</button>
}
}
</td>
</Row>
</Pager>
<button type="button" class="btn btn-success" @onclick="InstallTranslations">@SharedLocalizer["Install"]</button>
}
else
{
<br />
<div class="mx-auto text-center">
@Localizer["Search.NoResults"]
</div>
<br />
}
</TabPanel>
</TabStrip>
<button type="button" class="btn btn-success" @onclick="SaveModuleDefinition">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br /><br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
@if (_productname != "")
{
<div class="app-actiondialog">
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@SharedLocalizer["Review License Terms"]</h5>
<button type="button" class="btn-close" aria-label="Close" @onclick="HideModal"></button>
</div>
<div class="modal-body">
<p style="height: 200px; overflow-y: scroll;">
<h3>@_productname</h3>
@if (!string.IsNullOrEmpty(_packagelicense))
{
@((MarkupString)_packagelicense)
}
else
{
@SharedLocalizer["License Not Specified"]
}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadPackage(_packageid))>@SharedLocalizer["Accept"]</button>
<button type="button" class="btn btn-secondary" @onclick="HideModal">@SharedLocalizer["Cancel"]</button>
</div>
</div>
</div>
</div>
</div>
}
@code {
private int _moduleDefinitionId;
private string _name;
private string _version;
private string _categories;
private string _moduledefinitionname = "";
private string _description = "";
private string _owner = "";
private string _url = "";
private string _contact = "";
private string _license = "";
private string _permissions;
private string _createdby;
private DateTime _createdon;
private string _modifiedby;
private DateTime _modifiedon;
private ElementReference form;
private bool validated = false;
private int _moduleDefinitionId;
private string _name;
private string _description = "";
private string _categories;
private string _moduledefinitionname = "";
private string _version;
private string _packagename = "";
private string _owner = "";
private string _url = "";
private string _contact = "";
private string _license = "";
private string _runtimes = "";
private string _permissions;
private string _createdby;
private DateTime _createdon;
private string _modifiedby;
private DateTime _modifiedon;
#pragma warning disable 649
private PermissionGrid _permissionGrid;
private PermissionGrid _permissionGrid;
#pragma warning restore 649
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
private List<Package> _packages;
private List<Language> _languages;
private string _productname = "";
private string _packagelicense = "";
private string _packageid = "";
protected override async Task OnInitializedAsync()
{
try
{
_moduleDefinitionId = Int32.Parse(PageState.QueryString["id"]);
var moduleDefinition = await ModuleDefinitionService.GetModuleDefinitionAsync(_moduleDefinitionId, ModuleState.SiteId);
if (moduleDefinition != null)
{
_name = moduleDefinition.Name;
_version = moduleDefinition.Version;
_categories = moduleDefinition.Categories;
_moduledefinitionname = moduleDefinition.ModuleDefinitionName;
_description = moduleDefinition.Description;
_owner = moduleDefinition.Owner;
_url = moduleDefinition.Url;
_contact = moduleDefinition.Contact;
_license = moduleDefinition.License;
_permissions = moduleDefinition.Permissions;
_createdby = moduleDefinition.CreatedBy;
_createdon = moduleDefinition.CreatedOn;
_modifiedby = moduleDefinition.ModifiedBy;
_modifiedon = moduleDefinition.ModifiedOn;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading ModuleDefinition {ModuleDefinitionId} {Error}", _moduleDefinitionId, ex.Message);
AddModuleMessage("Error Loading Module", MessageType.Error);
}
}
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
private async Task SaveModuleDefinition()
{
try
{
var moduledefinition = await ModuleDefinitionService.GetModuleDefinitionAsync(_moduleDefinitionId, ModuleState.SiteId);
if (moduledefinition.Name != _name)
{
moduledefinition.Name = _name;
}
if (moduledefinition.Description != _description)
{
moduledefinition.Description = _description;
}
if (moduledefinition.Categories != _categories)
{
moduledefinition.Categories = _categories;
}
moduledefinition.Permissions = _permissionGrid.GetPermissions();
await ModuleDefinitionService.UpdateModuleDefinitionAsync(moduledefinition);
await logger.LogInformation("ModuleDefinition Saved {ModuleDefinition}", moduledefinition);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving ModuleDefinition {ModuleDefinitionId} {Error}", _moduleDefinitionId, ex.Message);
AddModuleMessage("Error Saving Module", MessageType.Error);
}
}
protected override async Task OnInitializedAsync()
{
try
{
_moduleDefinitionId = Int32.Parse(PageState.QueryString["id"]);
var moduleDefinition = await ModuleDefinitionService.GetModuleDefinitionAsync(_moduleDefinitionId, ModuleState.SiteId);
if (moduleDefinition != null)
{
_name = moduleDefinition.Name;
_description = moduleDefinition.Description;
_categories = moduleDefinition.Categories;
_moduledefinitionname = moduleDefinition.ModuleDefinitionName;
_version = moduleDefinition.Version;
_packagename = moduleDefinition.PackageName;
_owner = moduleDefinition.Owner;
_url = moduleDefinition.Url;
_contact = moduleDefinition.Contact;
_license = moduleDefinition.License;
_runtimes = moduleDefinition.Runtimes;
_permissions = moduleDefinition.Permissions;
_createdby = moduleDefinition.CreatedBy;
_createdon = moduleDefinition.CreatedOn;
_modifiedby = moduleDefinition.ModifiedBy;
_modifiedon = moduleDefinition.ModifiedOn;
if (!string.IsNullOrEmpty(_packagename))
{
_packages = await PackageService.GetPackagesAsync("translation", "", "", _packagename);
_languages = await LanguageService.GetLanguagesAsync(-1, _packagename);
foreach (var package in _packages)
{
var code = package.PackageId.Split('.').Last();
if (!_languages.Any(item => item.Code == code))
{
_languages.Add(new Language { Code = code, Name = CultureInfo.GetCultureInfo(code).DisplayName, Version = package.Version, IsDefault = true });
}
}
_languages = _languages.OrderBy(item => item.Name).ToList();
}
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading ModuleDefinition {ModuleDefinitionId} {Error}", _moduleDefinitionId, ex.Message);
AddModuleMessage(Localizer["Error.Module.Load"], MessageType.Error);
}
}
private async Task SaveModuleDefinition()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
try
{
var moduledefinition = await ModuleDefinitionService.GetModuleDefinitionAsync(_moduleDefinitionId, ModuleState.SiteId);
if (moduledefinition.Name != _name)
{
moduledefinition.Name = _name;
}
if (moduledefinition.Description != _description)
{
moduledefinition.Description = _description;
}
if (moduledefinition.Categories != _categories)
{
moduledefinition.Categories = _categories;
}
moduledefinition.Permissions = _permissionGrid.GetPermissions();
await ModuleDefinitionService.UpdateModuleDefinitionAsync(moduledefinition);
await logger.LogInformation("ModuleDefinition Saved {ModuleDefinition}", moduledefinition);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving ModuleDefinition {ModuleDefinitionId} {Error}", _moduleDefinitionId, ex.Message);
AddModuleMessage(Localizer["Error.Module.Save"], MessageType.Error);
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private void HideModal()
{
_productname = "";
_packagelicense = "";
StateHasChanged();
}
private bool UpgradeAvailable(string packagename, string version)
{
var upgradeavailable = false;
if (_packages != null)
{
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
if (package != null)
{
upgradeavailable = (Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0);
}
}
return upgradeavailable;
}
private async Task GetPackage(string packagename)
{
var version = _packages.Where(item => item.PackageId == packagename).FirstOrDefault().Version;
try
{
var package = await PackageService.GetPackageAsync(packagename, version);
if (package != null)
{
_productname = package.Name;
if (!string.IsNullOrEmpty(package.License))
{
_packagelicense = package.License.Replace("\n", "<br />");
}
_packageid = package.PackageId;
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Getting Package {PackageId} {Version}", packagename, version);
AddModuleMessage(Localizer["Error.Translation.Download"], MessageType.Error);
}
}
private async Task DownloadPackage(string packagename)
{
try
{
var version = _packages.Where(item => item.PackageId == packagename).FirstOrDefault().Version;
await PackageService.DownloadPackageAsync(packagename, version, Constants.PackagesFolder);
await logger.LogInformation("Package {PackageId} {Version} Downloaded Successfully", packagename, version);
AddModuleMessage(Localizer["Success.Translation.Download"], MessageType.Success);
_productname = "";
_packagelicense = "";
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Package {PackageId} {Version}", _packagename, _version);
AddModuleMessage(Localizer["Error.Translation.Download"], MessageType.Error);
}
}
private async Task InstallTranslations()
{
try
{
await PackageService.InstallPackagesAsync();
AddModuleMessage(string.Format(Localizer["Success.Translation.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Installing Translations");
}
}
}

View File

@ -1,39 +1,82 @@
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@namespace Oqtane.Modules.Admin.ModuleDefinitions
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IModuleDefinitionService ModuleDefinitionService
@inject IPackageService PackageService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_moduleDefinitions == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Text="Install Module" />
<Pager Items="@_moduleDefinitions">
<div class="container">
<div class="row mb-3 align-items-center">
<div class="col-sm-6">
<ActionLink Action="Add" Text="Install Module" ResourceKey="InstallModule" />
@((MarkupString)"&nbsp;")
<ActionLink Action="Create" Text="Create Module" ResourceKey="CreateModule" Class="btn btn-secondary" />
</div>
<div class="col-sm-6">
<select class="form-select" @onchange="(e => CategoryChanged(e))">
@foreach (var category in _categories)
{
if (category == _category)
{
<option value="@category" selected>@category @Localizer["Modules"]</option>
}
else
{
<option value="@category">@category @Localizer["Modules"]</option>
}
}
</select>
</div>
</div>
</div>
<Pager Items="@_moduleDefinitions.Where(item => item.Categories.Contains(_category))">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th>Version</th>
<th>&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@SharedLocalizer["Version"]</th>
<th>@Localizer["InUse"]</th>
<th>@SharedLocalizer["Expires"]</th>
<th style="width: 1px;">&nbsp;</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.ModuleDefinitionId.ToString())" /></td>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.ModuleDefinitionId.ToString())" ResourceKey="EditModule" /></td>
<td>
@if (context.AssemblyName != "Oqtane.Client")
@if (context.AssemblyName != Constants.ClientId)
{
<ActionDialog Header="Delete Module" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Module?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" />
<ActionDialog Header="Delete Module" Message="@string.Format(Localizer["Confirm.Module.Delete", context.Name])" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" ResourceKey="DeleteModule" />
}
</td>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
@if (UpgradeAvailable(context.ModuleDefinitionName, context.Version))
@if (context.AssemblyName == Constants.ClientId || PageState.Modules.Where(m => m.ModuleDefinition?.ModuleDefinitionId == context.ModuleDefinitionId).FirstOrDefault() != null)
{
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadModule(context.ModuleDefinitionName, context.Version))>Upgrade</button>
<span>@SharedLocalizer["Yes"]</span>
}
else
{
<span>@SharedLocalizer["No"]</span>
}
</td>
<td>
@((MarkupString)PurchaseLink(context.PackageName))
</td>
<td>
@{
var version = UpgradeAvailable(context.PackageName, context.Version);
}
@if (version != context.Version)
{
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadModule(context.PackageName, version))>@SharedLocalizer["Upgrade"]</button>
}
</td>
</Row>
@ -41,65 +84,99 @@ else
}
@code {
private List<ModuleDefinition> _moduleDefinitions;
private List<Package> _packages;
private List<ModuleDefinition> _moduleDefinitions;
private List<Package> _packages;
private List<string> _categories = new List<string>();
private string _category = "Common";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
_moduleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
_packages = await PackageService.GetPackagesAsync("module");
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Modules {Error}", ex.Message);
AddModuleMessage("Error Loading Modules", MessageType.Error);
}
}
protected override async Task OnParametersSetAsync()
{
try
{
_moduleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
_packages = await PackageService.GetPackagesAsync("module");
_categories = _moduleDefinitions.SelectMany(m => m.Categories.Split(',')).Distinct().ToList();
}
catch (Exception ex)
{
if (_moduleDefinitions == null)
{
await logger.LogError(ex, "Error Loading Modules {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Module.Load"], MessageType.Error);
}
}
}
private bool UpgradeAvailable(string moduledefinitionname, string version)
{
var upgradeavailable = false;
var package = _packages.Where(item => item.PackageId == Utilities.GetTypeName(moduledefinitionname)).FirstOrDefault();
if (package != null)
{
upgradeavailable = (Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0);
}
return upgradeavailable;
}
private string PurchaseLink(string packagename)
{
string link = "";
if (!string.IsNullOrEmpty(packagename) && _packages != null)
{
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
if (package != null)
{
if (package.ExpiryDate != null && package.ExpiryDate.Value.Date != DateTime.MaxValue.Date)
{
link += "<span>" + package.ExpiryDate.Value.Date.ToString("MMM dd, yyyy") + "</span>";
if (!string.IsNullOrEmpty(package.PaymentUrl))
{
link += "&nbsp;&nbsp;<a class=\"btn btn-primary\" style=\"text-decoration: none !important\" href=\"" + package.PaymentUrl + "\" target=\"_new\">" + SharedLocalizer["Extend"] + "</a>";
}
}
}
}
return link;
}
private async Task DownloadModule(string moduledefinitionname, string version)
{
try
{
await PackageService.DownloadPackageAsync(moduledefinitionname, version, "Modules");
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", moduledefinitionname, version);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Module {ModuleDefinitionName} {Version} {Error}", moduledefinitionname, version, ex.Message);
AddModuleMessage("Error Downloading Module", MessageType.Error);
}
}
private string UpgradeAvailable(string packagename, string version)
{
if (!string.IsNullOrEmpty(packagename) && _packages != null)
{
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
if (package != null && Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0)
{
return package.Version;
}
}
return version;
}
private async Task DeleteModule(ModuleDefinition moduleDefinition)
{
try
{
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
await logger.LogInformation("Module Deleted {ModuleDefinition}", moduleDefinition);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Module {ModuleDefinition} {Error}", moduleDefinition, ex.Message);
AddModuleMessage("Error Deleting Module", MessageType.Error);
}
}
private async Task DownloadModule(string packagename, string version)
{
try
{
await PackageService.DownloadPackageAsync(packagename, version, Constants.PackagesFolder);
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", packagename, version);
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
AddModuleMessage(string.Format(Localizer["Success.Module.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Module {ModuleDefinitionName} {Version} {Error}", packagename, version, ex.Message);
AddModuleMessage(Localizer["Error.Module.Download"], MessageType.Error);
}
}
private async Task DeleteModule(ModuleDefinition moduleDefinition)
{
try
{
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
AddModuleMessage(Localizer["Success.Module.Delete"], MessageType.Success);
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, true));
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Module {ModuleDefinition} {Error}", moduleDefinition, ex.Message);
AddModuleMessage(Localizer["Error.Module.Delete"], MessageType.Error);
}
}
private void CategoryChanged(ChangeEventArgs e)
{
_category = (string)e.Value;
StateHasChanged();
}
}

View File

@ -1,33 +1,39 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IModuleService ModuleService
@inject IStringLocalizer<Export> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tbody>
<tr>
<td>
<Label For="content" HelpText="Enter the module content">Content: </Label>
</td>
<td>
<textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-success" @onclick="ExportModule">Export</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="content" HelpText="The Exported Module Content" ResourceKey="Content">Content: </Label>
<div class="col-sm-9">
<textarea id="content" class="form-control" @bind="@_content" rows="5" readonly></textarea>
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="ExportModule">@Localizer["Export"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
@code {
private string _content = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
public override string Title => "Export Module";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Title => "Export Content";
private async Task ExportModule()
{
_content = await ModuleService.ExportModuleAsync(ModuleState.ModuleId);
try
{
_content = await ModuleService.ExportModuleAsync(ModuleState.ModuleId, PageState.Page.PageId);
AddModuleMessage(Localizer["Success.Content.Export"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Exporting Module {ModuleId} {Error}", ModuleState.ModuleId, ex.Message);
AddModuleMessage(Localizer["Error.Module.Export"], MessageType.Error);
}
}
}

View File

@ -1,49 +1,67 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IModuleService ModuleService
@inject IStringLocalizer<Import> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tbody>
<tr>
<td>
<Label For="content" HelpText="Enter the module content">Content: </Label>
</td>
<td>
<textarea id="content" class="form-control" @bind="@_content" rows="5"></textarea>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-success" @onclick="ImportModule">Import</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="content" HelpText="Enter The Module Content To Import" ResourceKey="Content">Content: </Label>
<div class="col-sm-9">
<textarea id="content" class="form-control" @bind="@_content" rows="5" required></textarea>
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="ImportModule">@Localizer["Import"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</form>
@code {
private string _content = string.Empty;
private ElementReference form;
private bool validated = false;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
public override string Title => "Import Module";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Title => "Import Content";
private async Task ImportModule()
{
if (_content != string.Empty)
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
try
if (_content != string.Empty)
{
await ModuleService.ImportModuleAsync(ModuleState.ModuleId, _content);
StateHasChanged();
NavigationManager.NavigateTo(NavigateUrl());
try
{
bool success = await ModuleService.ImportModuleAsync(ModuleState.ModuleId, PageState.Page.PageId, _content);
if (success)
{
AddModuleMessage(Localizer["Success.Content.Import"], MessageType.Success);
}
else
{
AddModuleMessage(Localizer["Message.Content.ImportProblem"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Importing Module {ModuleId} {Error}", ModuleState.ModuleId, ex.Message);
AddModuleMessage(Localizer["Error.Module.Import"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Importing Module {ModuleId} {Error}", ModuleState.ModuleId, ex.Message);
AddModuleMessage("Error Importing Module", MessageType.Error);
AddModuleMessage(Localizer["Message.Required.ImportContent"], MessageType.Warning);
}
}
else
{
AddModuleMessage("You Must Enter Some Content To Import", MessageType.Warning);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -1,160 +1,245 @@
@namespace Oqtane.Modules.Admin.Modules
@namespace Oqtane.Modules.Admin.Modules
@using Oqtane.Interfaces
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IThemeService ThemeService
@inject IModuleService ModuleService
@inject IPageModuleService PageModuleService
@inject IStringLocalizer<Settings> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<TabStrip>
<TabPanel Name="Settings" Heading="Module Settings">
@if (_containers != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="title" HelpText="Enter the title of the module">Title: </Label>
</td>
<td>
<input id="title" type="text" name="Title" class="form-control" @bind="@_title" />
</td>
</tr>
<tr>
<td>
<Label For="container" HelpText="Select the module's container">Container: </Label>
</td>
<td>
<select id="container" class="form-control" @bind="@_containerType">
<option value="">&lt;Select Container&gt;</option>
@foreach (KeyValuePair<string, string> container in _containers)
{
<option value="@container.Key">@container.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="allpages" HelpText="Indicate if this module should be displayed on all pages">Display On All Pages? </Label>
</td>
<td>
<select id="allpages" class="form-control" @bind="@_allPages">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="page" HelpText="The page that the module is on">Page: </Label>
</td>
<td>
<select id="page" class="form-control" @bind="@_pageId">
@foreach (Page p in PageState.Pages)
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<TabStrip>
<TabPanel Name="Settings" Heading="Settings" ResourceKey="Settings">
@if (_containers != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="title" HelpText="Enter the title of the module" ResourceKey="Title">Title: </Label>
<div class="col-sm-9">
<input id="title" type="text" name="Title" class="form-control" @bind="@_title" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="container" HelpText="Select the module's container" ResourceKey="Container">Container: </Label>
<div class="col-sm-9">
<select id="container" class="form-select" @bind="@_containerType" required>
@foreach (var container in _containers)
{
<option value="@p.PageId">@(new string('-', p.Level * 2))@(p.Name)</option>
<option value="@container.TypeName">@container.Name</option>
}
}
</select>
</td>
</tr>
</table>
}
</TabPanel>
<TabPanel Name="Permissions">
@if (_containers != null)
{
<table class="table table-borderless">
<tr>
<td>
<PermissionGrid EntityName="@EntityNames.Module" PermissionNames="@_permissionNames" Permissions="@_permissions" @ref="_permissionGrid" />
</td>
</tr>
</table>
}
</TabPanel>
@if (_settingsModuleType != null)
{
<TabPanel Name="ModuleSettings" Heading="@_settingstitle">
@DynamicComponent
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="allpages" HelpText="Indicate if this module should be displayed on all pages" ResourceKey="DisplayOnAllPages">Display On All Pages? </Label>
<div class="col-sm-9">
<select id="allpages" class="form-select" @bind="@_allPages" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="page" HelpText="The page that the module is located on" ResourceKey="Page">Page: </Label>
<div class="col-sm-9">
<select id="page" class="form-select" @bind="@_pageId" required>
@foreach (Page p in PageState.Pages)
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
{
<option value="@p.PageId">@(new string('-', p.Level * 2))@(p.Name)</option>
}
}
</select>
</div>
</div>
</div>
}
</TabPanel>
}
</TabStrip>
<button type="button" class="btn btn-success" @onclick="SaveModule">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<TabPanel Name="Permissions" ResourceKey="Permissions">
@if (_permissions != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<PermissionGrid EntityName="@EntityNames.Module" PermissionNames="@_permissionNames" Permissions="@_permissions" @ref="_permissionGrid" />
</div>
</div>
}
</TabPanel>
@if (_moduleSettingsType != null)
{
<TabPanel Name="ModuleSettings" Heading="@_moduleSettingsTitle" ResourceKey="ModuleSettings">
@ModuleSettingsComponent
</TabPanel>
}
@if (_containerSettingsType != null)
{
<TabPanel Name="ContainerSettings" Heading="Container Settings" ResourceKey="ContainerSettings">
@ContainerSettingsComponent
</TabPanel>
}
</TabStrip>
<br />
<button type="button" class="btn btn-success" @onclick="SaveModule">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon"></AuditInfo>
</form>
@code {
private Dictionary<string, string> _containers;
private string _title;
private string _containerType;
private string _allPages = "false";
private string _permissionNames = "";
private string _permissions;
private string _pageId;
private PermissionGrid _permissionGrid;
private Type _settingsModuleType;
private string _settingstitle = "Other Settings";
private object _settings;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Title => "Module Settings";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Title => "Module Settings";
private ElementReference form;
private bool validated = false;
private List<Theme> _themes;
private List<ThemeControl> _containers = new List<ThemeControl>();
private string _title;
private string _containerType;
private string _allPages = "false";
private string _permissionNames = "";
private string _permissions = null;
private string _pageId;
private PermissionGrid _permissionGrid;
private Type _moduleSettingsType;
private object _moduleSettings;
private string _moduleSettingsTitle = "Module Settings";
private RenderFragment ModuleSettingsComponent { get; set; }
private Type _containerSettingsType;
private object _containerSettings;
private RenderFragment ContainerSettingsComponent { get; set; }
private string createdby;
private DateTime createdon;
private string modifiedby;
private DateTime modifiedon;
private RenderFragment DynamicComponent { get; set; }
protected override async Task OnInitializedAsync()
{
_title = ModuleState.Title;
_themes = await ThemeService.GetThemesAsync();
_containers = ThemeService.GetContainerControls(_themes, PageState.Page.ThemeType);
_containerType = ModuleState.ContainerType;
_allPages = ModuleState.AllPages.ToString();
_permissions = ModuleState.Permissions;
_pageId = ModuleState.PageId.ToString();
createdby = ModuleState.CreatedBy;
createdon = ModuleState.CreatedOn;
modifiedby = ModuleState.ModifiedBy;
modifiedon = ModuleState.ModifiedOn;
protected override async Task OnInitializedAsync()
{
_title = ModuleState.Title;
_containers = ThemeService.GetContainerTypes(await ThemeService.GetThemesAsync());
_containerType = ModuleState.ContainerType;
_allPages = ModuleState.AllPages.ToString();
_permissions = ModuleState.Permissions;
_permissionNames = ModuleState.ModuleDefinition.PermissionNames;
_pageId = ModuleState.PageId.ToString();
if (ModuleState.ModuleDefinition != null)
{
_permissionNames = ModuleState.ModuleDefinition?.PermissionNames;
_settingsModuleType = Type.GetType(ModuleState.ModuleType);
if (_settingsModuleType != null)
{
var moduleobject = Activator.CreateInstance(_settingsModuleType);
_settingstitle = (string)_settingsModuleType.GetProperty("Title").GetValue(moduleobject, null);
if (string.IsNullOrEmpty(_settingstitle))
{
_settingstitle = "Other Settings";
if (!string.IsNullOrEmpty(ModuleState.ModuleDefinition.SettingsType))
{
// module settings type explicitly declared in IModule interface
_moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.SettingsType);
}
else
{
// legacy support - module settings type determined by convention ( ie. existence of a "Settings.razor" component in module )
_moduleSettingsType = Type.GetType(ModuleState.ModuleDefinition.ControlTypeTemplate.Replace(Constants.ActionToken, PageState.Action), false, true);
}
if (_moduleSettingsType != null)
{
var moduleobject = Activator.CreateInstance(_moduleSettingsType) as IModuleControl;
if (!string.IsNullOrEmpty(moduleobject.Title))
{
_moduleSettingsTitle = moduleobject.Title;
}
ModuleSettingsComponent = builder =>
{
builder.OpenComponent(0, _moduleSettingsType);
builder.AddComponentReferenceCapture(1, inst => { _moduleSettings = Convert.ChangeType(inst, _moduleSettingsType); });
builder.CloseComponent();
};
}
}
else
{
AddModuleMessage(string.Format(Localizer["Error.Module.Load"], ModuleState.ModuleDefinitionName), MessageType.Error);
}
var theme = _themes.FirstOrDefault(item => item.Containers.Any(themecontrol => themecontrol.TypeName.Equals(_containerType)));
if (theme != null && !string.IsNullOrEmpty(theme.ContainerSettingsType))
{
_containerSettingsType = Type.GetType(theme.ContainerSettingsType);
if (_containerSettingsType != null)
{
ContainerSettingsComponent = builder =>
{
builder.OpenComponent(0, _containerSettingsType);
builder.AddComponentReferenceCapture(1, inst => { _containerSettings = Convert.ChangeType(inst, _containerSettingsType); });
builder.CloseComponent();
};
}
}
}
private async Task SaveModule()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (!string.IsNullOrEmpty(_title))
{
var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
pagemodule.PageId = int.Parse(_pageId);
pagemodule.Title = _title;
pagemodule.ContainerType = (_containerType != "-") ? _containerType : string.Empty;
if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Page.DefaultContainerType)
{
pagemodule.ContainerType = string.Empty;
}
if (!string.IsNullOrEmpty(pagemodule.ContainerType) && pagemodule.ContainerType == PageState.Site.DefaultContainerType)
{
pagemodule.ContainerType = string.Empty;
}
await PageModuleService.UpdatePageModuleAsync(pagemodule);
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
var module = ModuleState;
module.AllPages = bool.Parse(_allPages);
module.PageModuleId = ModuleState.PageModuleId;
module.Permissions = _permissionGrid.GetPermissions();
await ModuleService.UpdateModuleAsync(module);
if (_moduleSettingsType != null)
{
if (_moduleSettings is ISettingsControl moduleSettingsControl)
{
// module settings updated using explicit interface
await moduleSettingsControl.UpdateSettings();
}
else
{
// legacy support - module settings updated by convention ( ie. by calling a public method named "UpdateSettings" in settings component )
_moduleSettings?.GetType().GetMethod("UpdateSettings")?.Invoke(_moduleSettings, null);
}
}
if (_containerSettingsType != null && _containerSettings is ISettingsControl containerSettingsControl)
{
await containerSettingsControl.UpdateSettings();
}
NavigationManager.NavigateTo(NavigateUrl());
}
DynamicComponent = builder =>
else
{
builder.OpenComponent(0, _settingsModuleType);
builder.AddComponentReferenceCapture(1, inst => { _settings = Convert.ChangeType(inst, _settingsModuleType); });
builder.CloseComponent();
};
}
}
private async Task SaveModule()
{
var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
pagemodule.PageId = int.Parse(_pageId);
pagemodule.Title = _title;
pagemodule.ContainerType = _containerType;
await PageModuleService.UpdatePageModuleAsync(pagemodule);
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
var module = ModuleState;
module.AllPages = bool.Parse(_allPages);
module.Permissions = _permissionGrid.GetPermissions();
await ModuleService.UpdateModuleAsync(module);
if (_settingsModuleType != null)
{
var moduleType = Type.GetType(ModuleState.ModuleType);
if (moduleType != null)
{
moduleType.GetMethod("UpdateSettings")?.Invoke(_settings, null); // method must be public in settings component
AddModuleMessage(Localizer["Message.Required.Title"], MessageType.Warning);
}
}
NavigationManager.NavigateTo(NavigateUrl());
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -1,388 +1,427 @@
@namespace Oqtane.Modules.Admin.Pages
@namespace Oqtane.Modules.Admin.Pages
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IPageService PageService
@inject IThemeService ThemeService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<TabStrip>
<TabPanel Name="Settings">
@if (_themeList != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="Name" HelpText="Enter the page name">Name: </Label>
</td>
<td>
<input id="Name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="Parent" HelpText="Select the parent for the page in the site hierarchy">Parent: </Label>
</td>
<td>
<select id="Parent" class="form-control" @onchange="(e => ParentChanged(e))">
<option value="-1">&lt;Site Root&gt;</option>
@foreach (Page page in _pageList)
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<TabStrip Refresh="@_refresh">
<TabPanel Name="Settings" ResourceKey="Settings">
@if (_themeList != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the page name" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="parent" HelpText="Select the parent for the page in the site hierarchy" ResourceKey="Parent">Parent: </Label>
<div class="col-sm-9">
<select id="parent" class="form-select" @onchange="(e => ParentChanged(e))" required>
<option value="-1">&lt;@Localizer["SiteRoot"]&gt;</option>
@foreach (Page page in PageState.Pages)
{
<option value="@(page.PageId)">@(new string('-', page.Level * 2))@(page.Name)</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="insert" HelpText="Select the location where you would like the page to be inserted in relation to other pages" ResourceKey="Insert">Insert: </Label>
<div class="col-sm-9">
<select id="insert" class="form-select" @bind="@_insert" required>
<option value="<<">@Localizer["AtBeginning"]</option>
@if (_children != null && _children.Count > 0)
{
<option value="<">@Localizer["Before"]</option>
<option value=">">@Localizer["After"]</option>
}
<option value=">>">@Localizer["AtEnd"]</option>
</select>
@if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">"))
{
<option value="@(page.PageId)">@(new string('-', page.Level * 2))@(page.Name)</option>
<select class="form-select" @bind="@_childid">
<option value="-1">&lt;@Localizer["Page.Select"]&gt;</option>
@foreach (Page page in _children)
{
<option value="@(page.PageId)">@(page.Name)</option>
}
</select>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="Insert" HelpText="Select the location where you would like the page to be inserted in relation to other pages">Insert: </Label>
</td>
<td>
<select id="Insert" class="form-control" @bind="@_insert">
<option value="<<">At Beginning</option>
@if (_children != null && _children.Count > 0)
{
<option value="<">Before</option>
<option value=">">After</option>
}
<option value=">>">At End</option>
</select>
@if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">"))
{
<select class="form-control" @bind="@_childid">
<option value="-1">&lt;Select Page&gt;</option>
@foreach (Page page in _children)
{
<option value="@(page.PageId)">@(page.Name)</option>
}
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="navigation" HelpText="Select whether the page is part of the site navigation or hidden" ResourceKey="Navigation">Navigation? </Label>
<div class="col-sm-9">
<select id="navigation" class="form-select" @bind="@_isnavigation" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
}
</td>
</tr>
<tr>
<td>
<Label For="Navigation" HelpText="Select whether the page is part of the site navigation or hidden">Navigation? </Label>
</td>
<td>
<select id="Navigation" class="form-control" @bind="@_isnavigation">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="Path" HelpText="Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used.">Url Path: </Label>
</td>
<td>
<input id="Path" class="form-control" @bind="@_path" />
</td>
</tr>
<tr>
<td>
<Label For="Url" HelpText="Optionally enter a url which this page should redirect to when a user navigates to it">Redirect: </Label>
</td>
<td>
<input id="Url" class="form-control" @bind="@_url" />
</td>
</tr>
</table>
<Section Name="Appearance">
<table class="table table-borderless">
<tr>
<td>
<Label For="Title" HelpText="Optionally enter the page title. If you do not provide a page title, the page name will be used.">Title: </Label>
</td>
<td>
<input id="Title" class="form-control" @bind="@_title" />
</td>
</tr>
<tr>
<td>
<Label For="Theme" HelpText="Select the theme for this page">Theme: </Label>
</td>
<td>
<select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="-">&lt;Select Theme&gt;</option>
@foreach (KeyValuePair<string, string> item in _themes)
{
if (item.Key == _themetype)
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="clickable" HelpText="Select whether the link in the site navigation is enabled or disabled" ResourceKey="Clickable">Clickable? </Label>
<div class="col-sm-9">
<select id="clickable" class="form-select" @bind="@_isclickable" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="path" HelpText="Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used. If the page is intended to be the root path specify '/'." ResourceKey="UrlPath">Url Path: </Label>
<div class="col-sm-9">
<input id="path" class="form-control" @bind="@_path" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="Optionally enter a url which this page should redirect to when a user navigates to it" ResourceKey="Redirect">Redirect: </Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" />
</div>
</div>
</div>
<Section Name="Appearance" ResourceKey="Appearance">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="title" HelpText="Optionally enter the page title. If you do not provide a page title, the page name will be used." ResourceKey="Title">Title: </Label>
<div class="col-sm-9">
<input id="title" class="form-control" @bind="@_title" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="meta" HelpText="Optionally enter meta tags (in exactly the form you want them to be included in the page output)." ResourceKey="Meta">Meta: </Label>
<div class="col-sm-9">
<textarea id="meta" class="form-control" @bind="@_meta" rows="3"></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="theme" HelpText="Select the theme for this page" ResourceKey="Theme">Theme: </Label>
<div class="col-sm-9">
<select id="theme" class="form-select" value="@_themetype" @onchange="(e => ThemeChanged(e))" required>
@foreach (var theme in _themes)
{
<option value="@item.Key" selected>@item.Value</option>
<option value="@theme.TypeName">@theme.Name</option>
}
else
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="container" HelpText="Select the default container for the page" ResourceKey="DefaultContainer">Default Container: </Label>
<div class="col-sm-9">
<select id="container" class="form-select" @bind="@_containertype" required>
<option value="-">&lt;@Localizer["Container.Select"]&gt;</option>
@foreach (var container in _containers)
{
<option value="@item.Key">@item.Value</option>
<option value="@container.TypeName">@container.Name</option>
}
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="Layout" HelpText="Select a layout for the page (if the selected theme supports it)">Layout: </Label>
</td>
<td>
<select id="Layout" class="form-control" @bind="@_layouttype">
<option value="-">&lt;Select Layout&gt;</option>
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
{
if (panelayout.Key == _layouttype)
{
<option value="@panelayout.Key" selected>@panelayout.Value</option>
}
else
{
<option value="@panelayout.Key">@panelayout.Value</option>
}
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="Icon" HelpText="Optionally provide an icon for this page which will be displayed in the site navigation">Icon: </Label>
</td>
<td>
<input id="Icon" class="form-control" @bind="@_icon" />
</td>
</tr>
<tr>
<td>
<Label For="Default-Mode" HelpText="Select the default administration mode you want for this page">Default Mode? </Label>
</td>
<td>
<select id="Default-Mode" class="form-control" @bind="@_mode">
<option value="view">View Mode</option>
<option value="edit">Edit Mode</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
</td>
<td>
<select id="Personalizable" class="form-control" @bind="@_ispersonalizable">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
</table>
</Section>
}
</TabPanel>
<TabPanel Name="Permissions">
<table class="table table-borderless">
<tr>
<td>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="icon" HelpText="Optionally provide an icon class name for this page which will be displayed in the site navigation" ResourceKey="Icon">Icon: </Label>
<div class="col-sm-9">
<input id="icon" class="form-control" @bind="@_icon" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content" ResourceKey="Personalizable">Personalizable? </Label>
<div class="col-sm-9">
<select id="personalizable" class="form-select" @bind="@_ispersonalizable" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
</div>
</Section>
}
</TabPanel>
<TabPanel Name="Permissions" ResourceKey="Permissions">
<div class="container">
<div class="row mb-1 align-items-center">
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
</td>
</tr>
</table>
</TabPanel>
</TabStrip>
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
</div>
</div>
</TabPanel>
@if (_themeSettingsType != null)
{
<TabPanel Name="ThemeSettings" Heading="Theme Settings" ResourceKey="ThemeSettings">
@ThemeSettingsComponent
</TabPanel>
}
</TabStrip>
<button type="button" class="btn btn-success" @onclick="SavePage">@SharedLocalizer["Save"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
</form>
@code {
private Dictionary<string, string> _themes;
private Dictionary<string, string> _panelayouts;
private List<Theme> _themeList;
private List<Page> _pageList;
private string _name;
private string _title;
private string _path = string.Empty;
private string _parentid;
private string _insert = ">>";
private List<Page> _children;
private int _childid = -1;
private string _isnavigation = "True";
private string _url;
private string _ispersonalizable = "False";
private string _mode = "view";
private string _themetype = "-";
private string _layouttype = "-";
private string _icon = string.Empty;
private string _permissions = string.Empty;
private PermissionGrid _permissionGrid;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
private List<Theme> _themeList;
private List<ThemeControl> _themes = new List<ThemeControl>();
private List<ThemeControl> _containers = new List<ThemeControl>();
private string _name;
private string _title;
private string _meta;
private string _path = string.Empty;
private string _parentid = "-1";
private string _insert = ">>";
private List<Page> _children;
private int _childid = -1;
private string _isnavigation = "True";
private string _isclickable = "True";
private string _url;
private string _ispersonalizable = "False";
private string _themetype = string.Empty;
private string _containertype = string.Empty;
private string _icon = string.Empty;
private string _permissions = string.Empty;
private PermissionGrid _permissionGrid;
private Type _themeSettingsType;
private object _themeSettings;
private RenderFragment ThemeSettingsComponent { get; set; }
private bool _refresh = false;
private ElementReference form;
private bool validated = false;
protected override async Task OnInitializedAsync()
{
try
{
_themeList = await ThemeService.GetThemesAsync();
_pageList = PageState.Pages;
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
protected override async Task OnInitializedAsync()
{
try
{
_themeList = await ThemeService.GetThemesAsync();
_themes = ThemeService.GetThemeControls(_themeList);
_themetype = PageState.Site.DefaultThemeType;
_containers = ThemeService.GetContainerControls(_themeList, _themetype);
_containertype = PageState.Site.DefaultContainerType;
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
_permissions = string.Empty;
ThemeSettings();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Initializing Page {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Page.Initialize"], MessageType.Error);
}
}
_themetype = PageState.Site.DefaultThemeType;
_layouttype = PageState.Site.DefaultLayoutType;
private async void ParentChanged(ChangeEventArgs e)
{
try
{
_parentid = (string)e.Value;
_children = new List<Page>();
if (_parentid == "-1")
{
foreach (Page p in PageState.Pages.Where(item => item.ParentId == null))
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
{
_children.Add(p);
}
}
}
else
{
foreach (Page p in PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)))
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
{
_children.Add(p);
}
}
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Child Pages For Parent {PageId} {Error}", _parentid, ex.Message);
AddModuleMessage(Localizer["Error.ChildPage.Load"], MessageType.Error);
}
}
_themes = ThemeService.GetThemeTypes(_themeList);
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
private async void ThemeChanged(ChangeEventArgs e)
{
try
{
_themetype = (string)e.Value;
_containers = ThemeService.GetContainerControls(_themeList, _themetype);
_containertype = "-";
ThemeSettings();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Pane Layouts For Theme {ThemeType} {Error}", _themetype, ex.Message);
AddModuleMessage(Localizer["Error.Pane.Load"], MessageType.Error);
}
}
_permissions = string.Empty;
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Initializing Page {Error}", ex.Message);
AddModuleMessage("Error Initializing Page", MessageType.Error);
}
}
private void ThemeSettings()
{
_themeSettingsType = null;
var theme = _themeList.FirstOrDefault(item => item.Themes.Any(themecontrol => themecontrol.TypeName.Equals(_themetype)));
if (theme != null && !string.IsNullOrEmpty(theme.ThemeSettingsType))
{
_themeSettingsType = Type.GetType(theme.ThemeSettingsType);
if (_themeSettingsType != null)
{
ThemeSettingsComponent = builder =>
{
builder.OpenComponent(0, _themeSettingsType);
builder.AddComponentReferenceCapture(1, inst => { _themeSettings = Convert.ChangeType(inst, _themeSettingsType); });
builder.CloseComponent();
};
}
_refresh = true;
}
}
private async void ParentChanged(ChangeEventArgs e)
{
try
{
_parentid = (string)e.Value;
_children = new List<Page>();
if (_parentid == "-1")
{
foreach (Page p in PageState.Pages.Where(item => item.ParentId == null))
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
private async Task SavePage()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
Page page = null;
try
{
if (!string.IsNullOrEmpty(_themetype) && _containertype != "-")
{
page = new Page();
page.SiteId = PageState.Page.SiteId;
page.Name = _name;
page.Title = _title;
if (string.IsNullOrEmpty(_path))
{
_path = _name;
}
if (_path.Contains("/"))
{
if (_path.EndsWith("/") && _path != "/")
{
_path = _path.Substring(0, _path.Length - 1);
}
_path = _path.Substring(_path.LastIndexOf("/") + 1);
}
if (_parentid == "-1")
{
page.ParentId = null;
page.Path = Utilities.GetFriendlyUrl(_path);
}
else
{
page.ParentId = Int32.Parse(_parentid);
var parent = PageState.Pages.Where(item => item.PageId == page.ParentId).FirstOrDefault();
if (parent.Path == string.Empty)
{
page.Path = Utilities.GetFriendlyUrl(parent.Name) + "/" + Utilities.GetFriendlyUrl(_path);
}
else
{
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(_path);
}
}
var _pages = await PageService.GetPagesAsync(PageState.Site.SiteId);
if (_pages.Any(item => item.Path == page.Path))
{
AddModuleMessage(string.Format(Localizer["Message.Page.Exists"], _path), MessageType.Warning);
return;
}
if (page.ParentId == null && Constants.ReservedRoutes.Contains(page.Name.ToLower()))
{
AddModuleMessage(string.Format(Localizer["Message.Page.Reserved"], page.Name), MessageType.Warning);
return;
}
Page child;
switch (_insert)
{
case "<<":
page.Order = 0;
break;
case "<":
child = PageState.Pages.Where(item => item.PageId == _childid).FirstOrDefault();
page.Order = child.Order - 1;
break;
case ">":
child = PageState.Pages.Where(item => item.PageId == _childid).FirstOrDefault();
page.Order = child.Order + 1;
break;
case ">>":
page.Order = int.MaxValue;
break;
}
page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation));
page.IsClickable = (_isclickable == null ? true : Boolean.Parse(_isclickable));
page.Url = _url;
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
if (!string.IsNullOrEmpty(page.ThemeType) && page.ThemeType == PageState.Site.DefaultThemeType)
{
page.ThemeType = string.Empty;
}
page.DefaultContainerType = (_containertype != "-") ? _containertype : string.Empty;
if (!string.IsNullOrEmpty(page.DefaultContainerType) && page.DefaultContainerType == PageState.Site.DefaultContainerType)
{
page.DefaultContainerType = string.Empty;
}
page.Icon = (_icon == null ? string.Empty : _icon);
page.Permissions = _permissionGrid.GetPermissions();
page.IsPersonalizable = (_ispersonalizable == null ? false : Boolean.Parse(_ispersonalizable));
page.UserId = null;
page.Meta = _meta;
page = await PageService.AddPageAsync(page);
await PageService.UpdatePageOrderAsync(page.SiteId, page.PageId, page.ParentId);
await logger.LogInformation("Page Added {Page}", page);
if (PageState.QueryString.ContainsKey("cp"))
{
_children.Add(p);
}
}
}
else
{
foreach (Page p in PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)))
{
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
{
_children.Add(p);
}
}
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Child Pages For Parent {PageId} {Error}", _parentid, ex.Message);
AddModuleMessage("Error Loading Child Pages For Parent", MessageType.Error);
}
}
private async void ThemeChanged(ChangeEventArgs e)
{
try
{
_themetype = (string)e.Value;
if (_themetype != "-")
{
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
}
else
{
_panelayouts = new Dictionary<string, string>();
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Pane Layouts For Theme {ThemeType} {Error}", _themetype, ex.Message);
AddModuleMessage("Error Loading Pane Layouts For Theme", MessageType.Error);
}
}
private async Task SavePage()
{
Page page = null;
try
{
if (_name != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)))
{
page = new Page();
page.SiteId = PageState.Page.SiteId;
page.Name = _name;
page.Title = _title;
if (_path == "")
{
_path = _name;
}
if (_path.Contains("/"))
{
_path = _path.Substring(_path.LastIndexOf("/") + 1);
}
if (string.IsNullOrEmpty(_parentid))
{
page.ParentId = null;
page.Path = Utilities.GetFriendlyUrl(_path);
}
else
{
page.ParentId = Int32.Parse(_parentid);
var parent = PageState.Pages.Where(item => item.PageId == page.ParentId).FirstOrDefault();
if (parent.Path == string.Empty)
{
page.Path = Utilities.GetFriendlyUrl(parent.Name) + "/" + Utilities.GetFriendlyUrl(_path);
NavigationManager.NavigateTo(NavigateUrl(PageState.Pages.First(item => item.PageId == int.Parse(PageState.QueryString["cp"])).Path));
}
else
{
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(_path);
NavigationManager.NavigateTo(NavigateUrl(page.Path));
}
}
Page child;
switch (_insert)
else
{
case "<<":
page.Order = 0;
break;
case "<":
child = PageState.Pages.Where(item => item.PageId == _childid).FirstOrDefault();
page.Order = child.Order - 1;
break;
case ">":
child = PageState.Pages.Where(item => item.PageId == _childid).FirstOrDefault();
page.Order = child.Order + 1;
break;
case ">>":
page.Order = int.MaxValue;
break;
AddModuleMessage(Localizer["Message.Required.PageInfo"], MessageType.Warning);
}
page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation));
page.Url = _url;
page.EditMode = (_mode == "edit" ? true : false);
page.ThemeType = (_themetype != "-") ? _themetype : string.Empty;
page.LayoutType = (_layouttype != "-") ? _layouttype : string.Empty;
if (page.ThemeType == PageState.Site.DefaultThemeType)
{
page.ThemeType = string.Empty;
}
if (page.LayoutType == PageState.Site.DefaultLayoutType)
{
page.LayoutType = string.Empty;
}
page.Icon = (_icon == null ? string.Empty : _icon);
page.Permissions = _permissionGrid.GetPermissions();
page.IsPersonalizable = (_ispersonalizable == null ? false : Boolean.Parse(_ispersonalizable));
page.UserId = null;
page = await PageService.AddPageAsync(page);
await PageService.UpdatePageOrderAsync(page.SiteId, page.PageId, page.ParentId);
await logger.LogInformation("Page Added {Page}", page);
NavigationManager.NavigateTo(NavigateUrl(page.Path));
}
else
catch (Exception ex)
{
AddModuleMessage("You Must Provide Page Name And Theme", MessageType.Warning);
await logger.LogError(ex, "Error Saving Page {Page} {Error}", page, ex.Message);
AddModuleMessage(Localizer["Error.Page.Save"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Saving Page {Page} {Error}", page, ex.Message);
AddModuleMessage("Error Saving Page", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private void Cancel()
{
if (PageState.QueryString.ContainsKey("cp"))
{
NavigationManager.NavigateTo(NavigateUrl(PageState.Pages.First(item => item.PageId == int.Parse(PageState.QueryString["cp"])).Path));
}
else
{
NavigationManager.NavigateTo(NavigateUrl());
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,25 @@
@namespace Oqtane.Modules.Admin.Pages
@namespace Oqtane.Modules.Admin.Pages
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IPageService PageService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (PageState.Pages != null)
{
<ActionLink Action="Add" Text="Add Page" />
<ActionLink Action="Add" Text="Add Page" ResourceKey="AddPage" />
<Pager Items="@PageState.Pages.Where(item => !item.IsDeleted)">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.PageId.ToString())" /></td>
<td><ActionDialog Header="Delete Page" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Page?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" /></td>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.PageId.ToString())" ResourceKey="EditPage" /></td>
<td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td>
<td><button type="button" class="btn btn-secondary" @onclick="@(async () => NavigationManager.NavigateTo(Browse(context)))">@Localizer["Browse"]</button></td>
<td>@(new string('-', context.Level * 2))@(context.Name)</td>
</Row>
</Pager>
@ -29,7 +33,7 @@
try
{
page.IsDeleted = true;
await PageService.UpdatePageAsync(page);
await logger.LogInformation("Page Deleted {Page}", page);
NavigationManager.NavigateTo(NavigateUrl("admin/pages"));
@ -37,7 +41,11 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Page {Page} {Error}", page, ex.Message);
AddModuleMessage("Error Deleting Page", MessageType.Error);
AddModuleMessage(Localizer["Error.Page.Delete"], MessageType.Error);
}
}
protected string Browse(Page page)
{
return string.IsNullOrEmpty(page.Url) ? NavigateUrl(page.Path) : page.Url;
}
}

View File

@ -1,93 +1,94 @@
@namespace Oqtane.Modules.Admin.Profiles
@namespace Oqtane.Modules.Admin.Profiles
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IProfileService ProfileService
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="The name of this field">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="title" HelpText="The title of the field">Title: </Label>
</td>
<td>
<input id="title" class="form-control" @bind="@_title" />
</td>
</tr>
<tr>
<td>
<Label For="description" HelpText="What the profile field is">Description: </Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="category" HelpText="What larger category does this field belong to">Category: </Label>
</td>
<td>
<input id="category" class="form-control" @bind="@_category" />
</td>
</tr>
<tr>
<td>
<Label For="order" HelpText="What place is this field in a larger category list">Order: </Label>
</td>
<td>
<input id="order" class="form-control" @bind="@_vieworder" />
</td>
</tr>
<tr>
<td>
<Label For="length" HelpText="What is the max amount of characters should this field accept">Length: </Label>
</td>
<td>
<input id="length" class="form-control" @bind="@_maxlength" />
</td>
</tr>
<tr>
<td>
<Label For="defaultVal" HelpText="What value do you want this field to start with">Default Value: </Label>
</td>
<td>
<input id="defaultVal" class="form-control" @bind="@_defaultvalue" />
</td>
</tr>
<tr>
<td>
<Label For="required" HelpText="Is a user required to input something into this field?">Required? </Label>
</td>
<td>
<select id="required" class="form-control" @bind="@_isrequired">
<option value="True">Yes</option>
<option value="False">No</option>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="The name of this profile item" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="50" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="title" HelpText="The title of the profile item to display to the user" ResourceKey="Title">Title: </Label>
<div class="col-sm-9">
<input id="title" class="form-control" @bind="@_title" maxlength="50" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="The help text displayed to the user for this profile item" ResourceKey="Description">Description: </Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="5" maxlength="256" required ></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="category" HelpText="The category of this profile item (for grouping)" ResourceKey="Category">Category: </Label>
<div class="col-sm-9">
<input id="category" class="form-control" @bind="@_category" maxlength="50" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="order" HelpText="The index order of where this profile item should be displayed" ResourceKey="Order">Order: </Label>
<div class="col-sm-9">
<input id="order" class="form-control" @bind="@_vieworder" maxlength="4" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="length" HelpText="The max number of characters this profile item should accept (enter zero for unlimited)" ResourceKey="Length">Length: </Label>
<div class="col-sm-9">
<input id="length" class="form-control" @bind="@_maxlength" maxlength="4" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="defaultVal" HelpText="The default value for this profile item" ResourceKey="DefaultValue">Default Value: </Label>
<div class="col-sm-9">
<input id="defaultVal" class="form-control" @bind="@_defaultvalue" maxlength="2000"/>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="options" HelpText="A comma delimited list of options the user can select from" ResourceKey="Options">Options: </Label>
<div class="col-sm-9">
<input id="options" class="form-control" @bind="@_options" maxlength="2000" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="required" HelpText="Should a user be required to provide a value for this profile item?" ResourceKey="Required">Required? </Label>
<div class="col-sm-9">
<select id="required" class="form-select" @bind="@_isrequired" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="private" HelpText="Is this field private?">Private? </Label>
</td>
<td>
<select id="private" class="form-control" @bind="@_isprivate">
<option value="True">Yes</option>
<option value="False">No</option>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="private" HelpText="Should this profile item be visible to all users?" ResourceKey="Private">Private? </Label>
<div class="col-sm-9">
<select id="private" class="form-select" @bind="@_isprivate" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveProfile">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
</div>
</div>
</div>
<br />
<button type="button" class="btn btn-success" @onclick="SaveProfile">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
@if (PageState.QueryString.ContainsKey("id"))
{
<br />
<br />
<AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon"></AuditInfo>
}
</form>
@code {
private int _profileid = -1;
private ElementReference form;
private bool validated = false;
private string _name = string.Empty;
private string _title = string.Empty;
private string _description = string.Empty;
@ -95,8 +96,13 @@
private string _vieworder = "0";
private string _maxlength = "0";
private string _defaultvalue = string.Empty;
private string _options = string.Empty;
private string _isrequired = "False";
private string _isprivate = "False";
private string createdby;
private DateTime createdon;
private string modifiedby;
private DateTime modifiedon;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
@ -119,56 +125,73 @@
_vieworder = profile.ViewOrder.ToString();
_maxlength = profile.MaxLength.ToString();
_defaultvalue = profile.DefaultValue;
_options = profile.Options;
_isrequired = profile.IsRequired.ToString();
_isprivate = profile.IsPrivate.ToString();
createdby = profile.CreatedBy;
createdon = profile.CreatedOn;
modifiedby = profile.ModifiedBy;
modifiedon = profile.ModifiedOn;
}
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Profile {ProfileId} {Error}", _profileid, ex.Message);
AddModuleMessage("Error Loading Profile", MessageType.Error);
AddModuleMessage(Localizer["Error.Profile.Load"], MessageType.Error);
}
}
private async Task SaveProfile()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
Profile profile;
if (_profileid != -1)
try
{
profile = await ProfileService.GetProfileAsync(_profileid);
}
else
{
profile = new Profile();
}
Profile profile;
if (_profileid != -1)
{
profile = await ProfileService.GetProfileAsync(_profileid);
}
else
{
profile = new Profile();
}
profile.Name = _name;
profile.Title = _title;
profile.Description = _description;
profile.Category = _category;
profile.ViewOrder = int.Parse(_vieworder);
profile.MaxLength = int.Parse(_maxlength);
profile.DefaultValue = _defaultvalue;
profile.IsRequired = (_isrequired == null ? false : Boolean.Parse(_isrequired));
profile.IsPrivate = (_isprivate == null ? false : Boolean.Parse(_isprivate));
if (_profileid != -1)
{
profile = await ProfileService.UpdateProfileAsync(profile);
}else
{
profile = await ProfileService.AddProfileAsync(profile);
}
profile.SiteId = PageState.Site.SiteId;
profile.Name = _name;
profile.Title = _title;
profile.Description = _description;
profile.Category = _category;
profile.ViewOrder = int.Parse(_vieworder);
profile.MaxLength = int.Parse(_maxlength);
profile.DefaultValue = _defaultvalue;
profile.Options = _options;
profile.IsRequired = (_isrequired == null ? false : Boolean.Parse(_isrequired));
profile.IsPrivate = (_isprivate == null ? false : Boolean.Parse(_isprivate));
if (_profileid != -1)
{
profile = await ProfileService.UpdateProfileAsync(profile);
}
else
{
profile = await ProfileService.AddProfileAsync(profile);
}
await logger.LogInformation("Profile Saved {Profile}", profile);
NavigationManager.NavigateTo(NavigateUrl());
await logger.LogInformation("Profile Saved {Profile}", profile);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Profile {ProfleId} {Error}", _profileid, ex.Message);
AddModuleMessage(Localizer["Error.Profile.Save"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Saving Profile {ProfleId} {Error}", _profileid, ex.Message);
AddModuleMessage("Error Saving Profile", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -1,24 +1,26 @@
@namespace Oqtane.Modules.Admin.Profiles
@namespace Oqtane.Modules.Admin.Profiles
@inherits ModuleBase
@inject IProfileService ProfileService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_profiles == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Security="SecurityAccessLevel.Admin" Text="Add Profile" />
<ActionLink Action="Add" Security="SecurityAccessLevel.Admin" Text="Add Profile" ResourceKey="AddProfile" />
<Pager Items="@_profiles">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.ProfileId.ToString())" /></td>
<td><ActionDialog Header="Delete Profile" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Class="btn btn-danger" OnClick="@(async () => await DeleteProfile(context.ProfileId))" /></td>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.ProfileId.ToString())" ResourceKey="EditProfile" /></td>
<td><ActionDialog Header="Delete Profile" Message="@string.Format(Localizer["Confirm.Profile.Delete"], context.Name)" Action="Delete" Class="btn btn-danger" OnClick="@(async () => await DeleteProfile(context.ProfileId))" ResourceKey="DeleteProfile" /></td>
<td>@context.Name</td>
</Row>
</Pager>
@ -29,9 +31,9 @@ else
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override async Task OnInitializedAsync()
protected override async Task OnParametersSetAsync()
{
_profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
await GetProfilesAsync();
}
private async Task DeleteProfile(int profileId)
@ -40,12 +42,22 @@ else
{
await ProfileService.DeleteProfileAsync(profileId);
await logger.LogInformation("Profile Deleted {ProfileId}", profileId);
AddModuleMessage("Profile Deleted", MessageType.Success);
AddModuleMessage(Localizer["Success.Profile.Delete"], MessageType.Success);
await GetProfilesAsync();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Profile {ProfileId} {Error}", profileId, ex.Message);
AddModuleMessage("Error Deleting Profile", MessageType.Error);
AddModuleMessage(Localizer["Error.Profile.Delete"], MessageType.Error);
}
}
private async Task GetProfilesAsync()
{
_profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
}
}

View File

@ -1,70 +1,83 @@
@namespace Oqtane.Modules.Admin.RecycleBin
@namespace Oqtane.Modules.Admin.RecycleBin
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IPageModuleService PageModuleService
@inject IModuleService ModuleService
@inject IPageService PageService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<TabStrip>
<TabPanel Name="Pages">
@if (_pages == null)
{
<br />
<p>No Deleted Pages</p>
}
else
{
<Pager Items="@_pages">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th>Deleted By</th>
<th>Deleted On</th>
</Header>
<Row>
<td><button @onclick="@(() => RestorePage(context))" class="btn btn-info" title="Restore">Restore</button></td>
<td><ActionDialog Header="Delete Page" Message="@("Are You Sure You Wish To Permanently Delete The " + context.Name + " Page?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" /></td>
<td>@context.Name</td>
<td>@context.DeletedBy</td>
<td>@context.DeletedOn</td>
</Row>
</Pager>
}
</TabPanel>
<TabPanel Name="Modules">
@if (_modules == null)
{
<br />
<p>No Deleted Modules</p>
}
else
{
<Pager Items="@_modules">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Page</th>
<th>Module</th>
<th>Deleted By</th>
<th>Deleted On</th>
</Header>
<Row>
<td><button @onclick="@(() => RestoreModule(context))" class="btn btn-info" title="Restore">Restore</button></td>
<td><ActionDialog Header="Delete Module" Message="@("Are You Sure You Wish To Permanently Delete The " + context.Title + " Module?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" /></td>
<td>@PageState.Pages.Find(item => item.PageId == context.PageId).Name</td>
<td>@context.Title</td>
<td>@context.DeletedBy</td>
<td>@context.DeletedOn</td>
</Row>
</Pager>
}
</TabPanel>
</TabStrip>
@if (_pages == null || _modules == null)
{
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<TabStrip>
<TabPanel Name="Pages" ResourceKey="Pages">
@if (!_pages.Where(item => item.IsDeleted).Any())
{
<br />
<p>@Localizer["NoPage.Deleted"]</p>
}
else
{
<Pager Items="@_pages.Where(item => item.IsDeleted)">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@Localizer["DeletedBy"]</th>
<th>@Localizer["DeletedOn"]</th>
</Header>
<Row>
<td><button type="button" @onclick="@(() => RestorePage(context))" class="btn btn-success" title="Restore">Restore</button></td>
<td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td>
<td>@context.Name</td>
<td>@context.DeletedBy</td>
<td>@context.DeletedOn</td>
</Row>
</Pager>
<br />
<ActionDialog Header="Remove All Deleted Pages" Message="Are You Sure You Wish To Permanently Remove All Deleted Pages?" Action="Remove All Deleted Pages" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllPages())" ResourceKey="DeleteAllPages" />
}
</TabPanel>
<TabPanel Name="Modules" ResourceKey="Modules">
@if (!_modules.Where(item => item.IsDeleted).Any())
{
<br />
<p>@Localizer["NoModule.Deleted"]</p>
}
else
{
<Pager Items="@_modules.Where(item => item.IsDeleted)">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@Localizer["Page"]</th>
<th>@Localizer["Module"]</th>
<th>@Localizer["DeletedBy"]</th>
<th>@Localizer["DeletedOn"]</th>
</Header>
<Row>
<td><button type="button" @onclick="@(() => RestoreModule(context))" class="btn btn-success" title="Restore">@Localizer["Restore"]</button></td>
<td><ActionDialog Header="Delete Module" Message="@string.Format(Localizer["Confirm.Module.Delete"], context.Title)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteModule(context))" ResourceKey="DeleteModule" /></td>
<td>@_pages.Find(item => item.PageId == context.PageId).Name</td>
<td>@context.Title</td>
<td>@context.DeletedBy</td>
<td>@context.DeletedOn</td>
</Row>
</Pager>
<br />
<ActionDialog Header="Remove All Deleted Modules" Message="Are You Sure You Wish To Permanently Remove All Deleted Modules?" Action="Remove All Deleted Modules" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllModules())" ResourceKey="DeleteAllModules" />
}
</TabPanel>
</TabStrip>
}
@code {
private List<Page> _pages;
private List<Module> _modules;
private List<Page> _pages;
private List<Module> _modules;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
@ -77,17 +90,14 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Deleted Pages Or Modules {Error}", ex.Message);
AddModuleMessage("Error Loading Deleted Pages Or Modules", MessageType.Error);
AddModuleMessage(Localizer["Error.DeletedModulePage.Load"], MessageType.Error);
}
}
private async Task Load()
{
_pages = await PageService.GetPagesAsync(PageState.Site.SiteId);
_pages = _pages.Where(item => item.IsDeleted).ToList();
_modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId);
_modules = _modules.Where(item => item.IsDeleted).ToList();
}
private async Task RestorePage(Page page)
@ -104,7 +114,7 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Restoring Deleted Page {Page} {Error}", page, ex.Message);
AddModuleMessage("Error Restoring Deleted Page", MessageType.Error);
AddModuleMessage(Localizer["Error.Page.Restore"], MessageType.Error);
}
}
@ -125,6 +135,31 @@
}
}
private async Task DeleteAllPages()
{
try
{
ModuleInstance.ShowProgressIndicator();
foreach (Page page in _pages.Where(item => item.IsDeleted))
{
await PageService.DeletePageAsync(page.PageId);
await logger.LogInformation("Page Permanently Deleted {Page}", page);
}
await logger.LogInformation("Pages Permanently Deleted");
await Load();
ModuleInstance.HideProgressIndicator();
StateHasChanged();
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Permanently Deleting Pages {Error}", ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
ModuleInstance.HideProgressIndicator();
}
}
private async Task RestoreModule(Module module)
{
try
@ -139,7 +174,7 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Restoring Deleted Module {Module} {Error}", module, ex.Message);
AddModuleMessage("Error Restoring Deleted Module", MessageType.Error);
AddModuleMessage(Localizer["Error.Module.Restore"], MessageType.Error);
}
}
@ -148,14 +183,13 @@
try
{
await PageModuleService.DeletePageModuleAsync(module.PageModuleId);
// check if there are any remaining module instances in the site
_modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId);
if (!_modules.Exists(item => item.ModuleId == module.ModuleId))
{
await ModuleService.DeleteModuleAsync(module.ModuleId);
}
await logger.LogInformation("Module Permanently Deleted {Module}", module);
await Load();
StateHasChanged();
@ -163,7 +197,36 @@
catch (Exception ex)
{
await logger.LogError(ex, "Error Permanently Deleting Module {Module} {Error}", module, ex.Message);
AddModuleMessage("Error Permanently Deleting Module", MessageType.Error);
AddModuleMessage(Localizer["Error.Module.Delete"], MessageType.Error);
}
}
private async Task DeleteAllModules()
{
try
{
ModuleInstance.ShowProgressIndicator();
foreach (Module module in _modules.Where(item => item.IsDeleted))
{
await PageModuleService.DeletePageModuleAsync(module.PageModuleId);
// check if there are any remaining module instances in the site
if (!_modules.Exists(item => item.ModuleId == module.ModuleId))
{
await ModuleService.DeleteModuleAsync(module.ModuleId);
}
}
await logger.LogInformation("Modules Permanently Deleted");
await Load();
ModuleInstance.HideProgressIndicator();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Permanently Deleting Modules {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Modules.Delete"], MessageType.Error);
ModuleInstance.HideProgressIndicator();
}
}
}

View File

@ -1,106 +1,145 @@
@namespace Oqtane.Modules.Admin.Register
@namespace Oqtane.Modules.Admin.Register
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (PageState.Site.AllowRegistration)
{
<AuthorizeView>
<AuthorizeView Roles="@RoleNames.Registered">
<Authorizing>
<text>...</text>
</Authorizing>
<Authorized>
<ModuleMessage Message="You Are Already Registered" Type="MessageType.Info" />
<ModuleMessage Message="@Localizer["Info.Registration.Exists"]" Type="MessageType.Info" />
</Authorized>
<NotAuthorized>
<ModuleMessage Message="Please Note That Registration Requires A Valid Email Address In Order To Verify Your Identity" Type="MessageType.Info" />
<div class="container">
<div class="form-group">
<label for="Username" class="control-label">Username: </label>
<input type="text" class="form-control" placeholder="Username" @bind="@_username" id="Username" />
<ModuleMessage Message="@Localizer["Info.Registration.InvalidEmail"]" Type="MessageType.Info" />
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="username" HelpText="Your username. Note that this field can not be modified once it is saved." ResourceKey="Username"></Label>
<div class="col-sm-9">
<input id="username" class="form-control" @bind="@_username" maxlength="256" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="password" HelpText="Please choose a sufficiently secure password and enter it here" ResourceKey="Password"></Label>
<div class="col-sm-9">
<div class="input-group">
<input id="password" type="@_passwordtype" class="form-control" @bind="@_password" autocomplete="new-password" required />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirm" HelpText="Enter your password again to confirm it matches the value entered above" ResourceKey="Confirm"></Label>
<div class="col-sm-9">
<div class="input-group">
<input id="confirm" type="@_passwordtype" class="form-control" @bind="@_confirm" autocomplete="new-password" required />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="email" HelpText="Your email address where you wish to receive notifications" ResourceKey="Email"></Label>
<div class="col-sm-9">
<input id="email" class="form-control" @bind="@_email" maxlength="256" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="displayname" HelpText="Your full name" ResourceKey="DisplayName"></Label>
<div class="col-sm-9">
<input id="displayname" class="form-control" @bind="@_displayname" maxlength="50" />
</div>
</div>
</div>
<div class="form-group">
<label for="Password" class="control-label">Password: </label>
<input type="password" class="form-control" placeholder="Password" @bind="@_password" id="Password" />
</div>
<div class="form-group">
<label for="Confirm" class="control-label">Confirm Password: </label>
<input type="password" class="form-control" placeholder="Password" @bind="@_confirm" id="Confirm" />
</div>
<div class="form-group">
<label for="Email" class="control-label">Email: </label>
<input type="text" class="form-control" placeholder="Email" @bind="@_email" id="Email" />
</div>
<div class="form-group">
<label for="DisplayName" class="control-label">Full Name: </label>
<input type="text" class="form-control" placeholder="Full Name" @bind="@_displayName" id="DisplayName" />
</div>
<button type="button" class="btn btn-primary" @onclick="Register">Register</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
</div>
<br />
<button type="button" class="btn btn-primary" @onclick="Register">@Localizer["Register"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
</form>
</NotAuthorized>
</AuthorizeView>
}
else
{
<ModuleMessage Message="Registration is Disabled For This Site" Type="MessageType.Info" />
<ModuleMessage Message="@Localizer["Info.Registration.Disabled"]" Type="MessageType.Info" />
}
@code {
private string _username = string.Empty;
private string _password = string.Empty;
private string _confirm = string.Empty;
private string _email = string.Empty;
private string _displayName = string.Empty;
private string _username = string.Empty;
private ElementReference form;
private bool validated = false;
private string _password = string.Empty;
private string _passwordtype = "password";
private string _togglepassword = string.Empty;
private string _confirm = string.Empty;
private string _email = string.Empty;
private string _displayname = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
protected override void OnParametersSet()
{
_togglepassword = SharedLocalizer["ShowPassword"];
}
private async Task Register()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
bool _isEmailValid = Utilities.IsValidEmail(_email);
if (_username != "" && _password != "" && _confirm != "" && _isEmailValid)
try
{
if (_password == _confirm)
{
var user = new User
{
SiteId = PageState.Site.SiteId,
Username = _username,
DisplayName = (_displayName == string.Empty ? _username : _displayName),
Email = _email,
Password = _password
};
user = await UserService.AddUserAsync(user);
bool _isEmailValid = Utilities.IsValidEmail(_email);
if (user != null)
if (_isEmailValid)
{
if (_password == _confirm)
{
await logger.LogInformation("User Created {Username} {Email}", _username, _email);
AddModuleMessage("User Account Created. Please Check Your Email For Verification Instructions.", MessageType.Info);
var user = new User
{
SiteId = PageState.Site.SiteId,
Username = _username,
Password = _password,
Email = _email,
DisplayName = (_displayname == string.Empty ? _username : _displayname),
PhotoFileId = null
};
user = await UserService.AddUserAsync(user);
if (user != null)
{
await logger.LogInformation("User Created {Username} {Email}", _username, _email);
AddModuleMessage(Localizer["Info.User.AccountCreate"], MessageType.Info);
}
else
{
await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
AddModuleMessage(Localizer["Error.User.AddInfo"], MessageType.Error);
}
}
else
{
await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
AddModuleMessage("Error Adding User. Please Ensure Password Meets Complexity Requirements And Username Is Not Already In Use.", MessageType.Error);
AddModuleMessage(Localizer["Message.Password.NoMatch"], MessageType.Warning);
}
}
else
{
AddModuleMessage("Passwords Entered Do Not Match", MessageType.Warning);
AddModuleMessage(Localizer["Message.Required.UserInfo"], MessageType.Warning);
}
}
else
catch (Exception ex)
{
AddModuleMessage("You Must Provide A Username, Password, and Email Address", MessageType.Warning);
await logger.LogError(ex, "Error Adding User {Username} {Email} {Error}", _username, _email, ex.Message);
AddModuleMessage(Localizer["Error.User.Add"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Adding User {Username} {Email} {Error}", _username, _email, ex.Message);
AddModuleMessage("Error Adding User", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
@ -108,4 +147,18 @@ else
{
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
}
}
private void TogglePassword()
{
if (_passwordtype == "password")
{
_passwordtype = "text";
_togglepassword = SharedLocalizer["HidePassword"];
}
else
{
_passwordtype = "password";
_togglepassword = SharedLocalizer["ShowPassword"];
}
}
}

View File

@ -1,85 +1,118 @@
@namespace Oqtane.Modules.Admin.Reset
@namespace Oqtane.Modules.Admin.Reset
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="container">
<div class="form-group">
<label for="Username" class="control-label">Username: </label>
<input type="text" class="form-control" placeholder="Username" @bind="@_username" readonly id="Username"/>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="username" HelpText="Your username will be populated from the link you received in the password reset notification" ResourceKey="Username">Username: </Label>
<div class="col-sm-9">
<input id="username" type="text" class="form-control" @bind="@_username" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="password" HelpText="The new password. It must satisfy complexity rules for the site." ResourceKey="Password">Password: </Label>
<div class="col-sm-9">
<div class="input-group">
<input id="password" type="@_passwordtype" class="form-control" @bind="@_password" autocomplete="new-password" required />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirm" HelpText="Enter the password again. It must exactly match the password entered above." ResourceKey="Confirm">Confirm: </Label>
<div class="col-sm-9">
<div class="input-group">
<input id="confirm" type="@_passwordtype" class="form-control" @bind="@_confirm" autocomplete="new-password" required />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="Password" class="control-label">Password: </label>
<input type="password" class="form-control" placeholder="Password" @bind="@_password" id="Password"/>
</div>
<div class="form-group">
<label for="Confirm" class="control-label">Confirm Password: </label>
<input type="password" class="form-control" placeholder="Password" @bind="@_confirm" id="Confirm"/>
</div>
<button type="button" class="btn btn-primary" @onclick="Reset">Reset Password</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
</div>
<br />
<button type="button" class="btn btn-primary" @onclick="Reset">@Localizer["Password.Reset"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
</form>
@code {
private string _username = string.Empty;
private string _password = string.Empty;
private string _confirm = string.Empty;
private ElementReference form;
private bool validated = false;
private string _username = string.Empty;
private string _password = string.Empty;
private string _passwordtype = "password";
private string _togglepassword = string.Empty;
private string _confirm = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
protected override void OnInitialized()
{
if (PageState.QueryString.ContainsKey("name") && PageState.QueryString.ContainsKey("token"))
protected override async Task OnInitializedAsync()
{
_togglepassword = SharedLocalizer["ShowPassword"];
if (PageState.QueryString.ContainsKey("name") && PageState.QueryString.ContainsKey("token"))
{
_username = PageState.QueryString["name"];
}
else
{
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
{
await logger.LogError(LogFunction.Security, "Invalid Attempt To Access User Password Reset");
NavigationManager.NavigateTo(NavigateUrl("")); // home page
}
}
private async Task Reset()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (_username != string.Empty && _password != string.Empty && _confirm != string.Empty)
try
{
if (_password == _confirm)
if (_username != string.Empty && _password != string.Empty && _confirm != string.Empty)
{
var user = new User
if (_password == _confirm)
{
SiteId = PageState.Site.SiteId,
Username = _username,
Password = _password
};
user = await UserService.ResetPasswordAsync(user, PageState.QueryString["token"]);
var user = new User
{
SiteId = PageState.Site.SiteId,
Username = _username,
Password = _password
};
user = await UserService.ResetPasswordAsync(user, PageState.QueryString["token"]);
if (user != null)
{
await logger.LogInformation("User Password Reset {Username}", _username);
NavigationManager.NavigateTo(NavigateUrl("login"));
if (user != null)
{
await logger.LogInformation("User Password Reset {Username}", _username);
NavigationManager.NavigateTo(NavigateUrl("login"));
}
else
{
await logger.LogError("Error Resetting User Password {Username}", _username);
AddModuleMessage(Localizer["Error.Password.ResetInfo"], MessageType.Error);
}
}
else
{
await logger.LogError("Error Resetting User Password {Username}", _username);
AddModuleMessage("Error Resetting User Password. Please Ensure Password Meets Complexity Requirements.", MessageType.Error);
AddModuleMessage(Localizer["Message.Password.NoMatch"], MessageType.Warning);
}
}
else
{
AddModuleMessage("Passwords Entered Do Not Match", MessageType.Warning);
AddModuleMessage(Localizer["Message.Required.UserInfo"], MessageType.Warning);
}
}
else
catch (Exception ex)
{
AddModuleMessage("You Must Provide A Username, Password, and Email Address", MessageType.Warning);
await logger.LogError(ex, "Error Resetting User Password {Username} {Error}", _username, ex.Message);
AddModuleMessage(Localizer["Error.Password.Reset"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Resetting User Password {Username} {Error}", _username, ex.Message);
AddModuleMessage("Error Resetting User Password", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
@ -87,4 +120,18 @@
{
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
}
private void TogglePassword()
{
if (_passwordtype == "password")
{
_passwordtype = "text";
_togglepassword = SharedLocalizer["HidePassword"];
}
else
{
_passwordtype = "password";
_togglepassword = SharedLocalizer["ShowPassword"];
}
}
}

View File

@ -1,41 +1,43 @@
@namespace Oqtane.Modules.Admin.Roles
@namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IRoleService RoleService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Name Of The Role">Name:</Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose">Description:</Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role">Auto Assigned?</Label>
</td>
<td>
<select id="isautoassigned" class="form-control" @bind="@_isautoassigned">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveRole">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Name Of The Role" ResourceKey="Name">Name:</Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="256" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose" ResourceKey="Description">Description:</Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="5" maxlength="256" required></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role" ResourceKey="AutoAssigned">Auto Assigned?</Label>
<div class="col-sm-9">
<select id="isautoassigned" class="form-select" @bind="@_isautoassigned" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveRole">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</div>
</form>
@code {
private ElementReference form;
private bool validated = false;
@code {
private string _name = string.Empty;
private string _description = string.Empty;
private string _isautoassigned = "False";
@ -44,24 +46,33 @@
private async Task SaveRole()
{
var role = new Role();
role.SiteId = PageState.Page.SiteId;
role.Name = _name;
role.Description = _description;
role.IsAutoAssigned = (_isautoassigned == null ? false : Boolean.Parse(_isautoassigned));
role.IsSystem = false;
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
role = await RoleService.AddRoleAsync(role);
await logger.LogInformation("Role Added {Role}", role);
var role = new Role();
role.SiteId = PageState.Page.SiteId;
role.Name = _name;
role.Description = _description;
role.IsAutoAssigned = (_isautoassigned == null ? false : Boolean.Parse(_isautoassigned));
role.IsSystem = false;
NavigationManager.NavigateTo(NavigateUrl());
try
{
role = await RoleService.AddRoleAsync(role);
await logger.LogInformation("Role Added {Role}", role);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Role {Role} {Error}", role, ex.Message);
AddModuleMessage(Localizer["Error.AddRole"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Adding Role {Role} {Error}", role, ex.Message);
AddModuleMessage("Error Adding Role", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}

View File

@ -1,45 +1,53 @@
@namespace Oqtane.Modules.Admin.Roles
@namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IRoleService RoleService
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Name Of The Role">Name:</Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose">Description:</Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role">Auto Assigned?</Label>
</td>
<td>
<select id="isautoassigned" class="form-control" @bind="@_isautoassigned">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveRole">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Name Of The Role" ResourceKey="Name">Name:</Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="256" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose" ResourceKey="Description">Description:</Label>
<div class="col-sm-9">
<textarea id="description" class="form-control" @bind="@_description" rows="5" maxlength="256" required></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role" ResourceKey="AutoAssigned">Auto Assigned?</Label>
<div class="col-sm-9">
<select id="isautoassigned" class="form-select" @bind="@_isautoassigned" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveRole">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br /><br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
</div>
</form>
@code {
private ElementReference form;
private bool validated = false;
private int _roleid;
private string _name = string.Empty;
private string _description = string.Empty;
private string _isautoassigned = "False";
private string _createdby;
private DateTime _createdon;
private string _modifiedby;
private DateTime _modifiedon;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
@ -54,33 +62,46 @@
_name = role.Name;
_description = role.Description;
_isautoassigned = role.IsAutoAssigned.ToString();
_createdby = role.CreatedBy;
_createdon = role.CreatedOn;
_modifiedby = role.ModifiedBy;
_modifiedon = role.ModifiedOn;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Role {RoleId} {Error}", _roleid, ex.Message);
AddModuleMessage("Error Loading Role", MessageType.Error);
AddModuleMessage(Localizer["Error.LoadRole"], MessageType.Error);
}
}
private async Task SaveRole()
{
var role = await RoleService.GetRoleAsync(_roleid);
role.Name = _name;
role.Description = _description;
role.IsAutoAssigned = (_isautoassigned != null && Boolean.Parse(_isautoassigned));
role.IsSystem = false;
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
var role = await RoleService.GetRoleAsync(_roleid);
role.Name = _name;
role.Description = _description;
role.IsAutoAssigned = (_isautoassigned != null && Boolean.Parse(_isautoassigned));
role.IsSystem = false;
try
{
role = await RoleService.UpdateRoleAsync(role);
await logger.LogInformation("Role Saved {Role}", role);
NavigationManager.NavigateTo(NavigateUrl());
try
{
role = await RoleService.UpdateRoleAsync(role);
await logger.LogInformation("Role Saved {Role}", role);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Role {Role} {Error}", role, ex.Message);
AddModuleMessage(Localizer["Error.SaveRole"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Saving Role {Role} {Error}", role, ex.Message);
AddModuleMessage("Error Saving Role", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -1,26 +1,28 @@
@namespace Oqtane.Modules.Admin.Roles
@namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase
@inject IRoleService RoleService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_roles == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Text="Add Role" />
<ActionLink Action="Add" Text="Add Role" ResourceKey="AddRole" />
<Pager Items="@_roles">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.RoleId.ToString())" Disabled="@(context.IsSystem)" /></td>
<td><ActionDialog Header="Delete Role" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Role?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteRole(context))" Disabled="@(context.IsSystem)" /></td>
<td><ActionLink Action="Users" Parameters="@($"id=" + context.RoleId.ToString())" /></td>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.RoleId.ToString())" Disabled="@(context.IsSystem)" ResourceKey="Edit" /></td>
<td><ActionDialog Header="Delete Role" Message="@string.Format(Localizer["Confirm.DeleteUser"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteRole(context))" Disabled="@(context.IsSystem)" ResourceKey="DeleteRole" /></td>
<td><ActionLink Action="Users" Parameters="@($"id=" + context.RoleId.ToString())" ResourceKey="Users" /></td>
<td>@context.Name</td>
</Row>
</Pager>
@ -33,7 +35,7 @@ else
protected override async Task OnParametersSetAsync()
{
_roles = await RoleService.GetRolesAsync(PageState.Site.SiteId);
await GetRoles();
}
private async Task DeleteRole(Role role)
@ -42,12 +44,26 @@ else
{
await RoleService.DeleteRoleAsync(role.RoleId);
await logger.LogInformation("Role Deleted {Role}", role);
await GetRoles();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Role {Role} {Error}", role, ex.Message);
AddModuleMessage("Error Deleting Role", MessageType.Error);
AddModuleMessage(Localizer["Error.DeleteRole"], MessageType.Error);
}
}
private async Task GetRoles()
{
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
_roles = await RoleService.GetRolesAsync(PageState.Site.SiteId, true);
_roles.RemoveAll(item => item.Name == RoleNames.Everyone || item.Name == RoleNames.Unauthenticated);
}
else
{
_roles = await RoleService.GetRolesAsync(PageState.Site.SiteId);
}
}
}

View File

@ -1,81 +1,89 @@
@namespace Oqtane.Modules.Admin.Roles
@namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase
@inject IRoleService RoleService
@inject IUserRoleService UserRoleService
@inject IStringLocalizer<Users> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (userroles == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<table class="table table-borderless">
<tr>
<td>
<Label For="role" HelpText="The role you are assigning users to">Role: </Label>
</td>
<td>
<input id="role" class="form-control" @bind="@name" disabled />
</td>
</tr>
<tr>
<td>
<Label For="user" HelpText="Select a user">User: </Label>
</td>
<td>
<select id="user" class="form-control" @bind="@userid">
<option value="-1">&lt;Select User&gt;</option>
@foreach (UserRole userrole in users)
{
<option value="@(userrole.UserId)">@userrole.User.DisplayName</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="effectiveDate" HelpText="The date that this role assignment is active">Effective Date: </Label>
</td>
<td>
<input id="effectiveDate" class="form-control" @bind="@effectivedate" />
</td>
</tr>
<tr>
<td>
<Label For="expiryDate" HelpText="The date that this role assignment expires">Expiry Date: </Label>
</td>
<td>
<input id="expiryDate" class="form-control" @bind="@expirydate" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveUserRole">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<hr class="app-rule" />
<p align="center">
<Pager Items="@userroles">
<Header>
<th>Users</th>
<th>&nbsp;</th>
</Header>
<Row>
<td>@context.User.DisplayName</td>
<td>
<button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteUserRole(context.UserRoleId))>Delete</button>
</td>
</Row>
</Pager>
</p>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="role" HelpText="The role you are assigning users to" ResourceKey="Role">Role: </Label>
<div class="col-sm-9">
<input id="role" class="form-control" @bind="@name" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="user" HelpText="Select a user" ResourceKey="User">User: </Label>
<div class="col-sm-9">
<select id="user" class="form-select" @bind="@userid" required>
<option value="-1">&lt;@Localizer["User.Select"]&gt;</option>
@foreach (UserRole userrole in users)
{
<option value="@(userrole.UserId)">@userrole.User.DisplayName</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="effectiveDate" HelpText="The date that this role assignment is active" ResourceKey="EffectiveDate">Effective Date: </Label>
<div class="col-sm-9">
<input type="date" id="effectiveDate" class="form-control" @bind="@effectivedate" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="expiryDate" HelpText="The date that this role assignment expires" ResourceKey="ExpiryDate">Expiry Date: </Label>
<div class="col-sm-9">
<input type="date" id="expiryDate" class="form-control" @bind="@expirydate" />
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveUserRole">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<hr class="app-rule" />
<div class="row mb-1 align-items-center">
<p align="center">
<Pager Items="@userroles">
<Header>
<th>@Localizer["Users"]</th>
<th>@SharedLocalizer["Username"]</th>
<th>@Localizer["Effective"]</th>
<th>@Localizer["Expiry"]</th>
<th>&nbsp;</th>
</Header>
<Row>
<td>@context.User.DisplayName</td>
<td>@context.User.Username</td>
<td>@context.EffectiveDate</td>
<td>@context.ExpiryDate</td>
<td>
<ActionDialog Header="Remove User" Message="@string.Format(Localizer["Confirm.User.DeleteRole"], context.User.DisplayName)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUserRole(context.UserRoleId))" Disabled="@(context.Role.IsAutoAssigned || PageState.User.Username == UserNames.Host)" ResourceKey="DeleteUserRole" />
</td>
</Row>
</Pager>
</p>
</div>
</div>
</form>
}
@code {
private ElementReference form;
private bool validated = false;
private int roleid;
private string name = string.Empty;
private List<UserRole> users;
private int userid = -1;
private string effectivedate = string.Empty;
private string expirydate = string.Empty;
private DateTime? effectivedate = null;
private DateTime? expirydate = null;
private List<UserRole> userroles;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
@ -87,14 +95,13 @@ else
roleid = Int32.Parse(PageState.QueryString["id"]);
Role role = await RoleService.GetRoleAsync(roleid);
name = role.Name;
users = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
users = users.Where(item => item.Role.Name == Constants.RegisteredRole).ToList();
users = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId, RoleNames.Registered);
await GetUserRoles();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Users {Error}", ex.Message);
AddModuleMessage("Error Loading Users", MessageType.Error);
AddModuleMessage(Localizer["Error.User.Load"], MessageType.Error);
}
}
@ -102,100 +109,89 @@ else
{
try
{
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
userroles = userroles.Where(item => item.RoleId == roleid).ToList();
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId, name);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading User Roles {RoleId} {Error}", roleid, ex.Message);
AddModuleMessage("Error Loading User Roles", MessageType.Error);
AddModuleMessage(Localizer["Error.User.LoadRole"], MessageType.Error);
}
}
private async Task SaveUserRole()
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (userid != -1)
try
{
var userrole = userroles.Where(item => item.UserId == userid && item.RoleId == roleid).FirstOrDefault();
if (userrole != null)
if (userid != -1)
{
if (string.IsNullOrEmpty(effectivedate))
var userrole = userroles.Where(item => item.UserId == userid && item.RoleId == roleid).FirstOrDefault();
if (userrole != null)
{
userrole.EffectiveDate = null;
userrole.EffectiveDate = effectivedate;
userrole.ExpiryDate = expirydate;
await UserRoleService.UpdateUserRoleAsync(userrole);
}
else
{
userrole.EffectiveDate = DateTime.Parse(effectivedate);
userrole = new UserRole();
userrole.UserId = userid;
userrole.RoleId = roleid;
userrole.EffectiveDate = effectivedate;
userrole.ExpiryDate = expirydate;
await UserRoleService.AddUserRoleAsync(userrole);
}
if (string.IsNullOrEmpty(expirydate))
{
userrole.ExpiryDate = null;
}
else
{
userrole.ExpiryDate = DateTime.Parse(expirydate);
}
await UserRoleService.UpdateUserRoleAsync(userrole);
await logger.LogInformation("User Assigned To Role {UserRole}", userrole);
AddModuleMessage(Localizer["Success.User.AssignedRole"], MessageType.Success);
await GetUserRoles();
StateHasChanged();
}
else
{
userrole = new UserRole();
userrole.UserId = userid;
userrole.RoleId = roleid;
if (string.IsNullOrEmpty(effectivedate))
{
userrole.EffectiveDate = null;
}
else
{
userrole.EffectiveDate = DateTime.Parse(effectivedate);
}
if (string.IsNullOrEmpty(expirydate))
{
userrole.ExpiryDate = null;
}
else
{
userrole.ExpiryDate = DateTime.Parse(expirydate);
}
await UserRoleService.AddUserRoleAsync(userrole);
AddModuleMessage(Localizer["Message.Required.UserSelect"], MessageType.Warning);
}
await GetUserRoles();
await logger.LogInformation("User Assigned To Role {UserRole}", userrole);
AddModuleMessage("User Assigned To Role", MessageType.Success);
}
else
catch (Exception ex)
{
AddModuleMessage("You Must Select A User", MessageType.Warning);
await logger.LogError(ex, "Error Saving User Roles {RoleId} {Error}", roleid, ex.Message);
AddModuleMessage(Localizer["Error.User.SaveRole"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Saving User Roles {RoleId} {Error}", roleid, ex.Message);
AddModuleMessage("Error Saving User Roles", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private async Task DeleteUserRole(int UserRoleId)
{
try
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
await UserRoleService.DeleteUserRoleAsync(UserRoleId);
await GetUserRoles();
await logger.LogInformation("User Removed From Role {UserRoleId}", UserRoleId);
AddModuleMessage("User Removed From Role", MessageType.Success);
try
{
await UserRoleService.DeleteUserRoleAsync(UserRoleId);
await logger.LogInformation("User Removed From Role {UserRoleId}", UserRoleId);
AddModuleMessage(Localizer["Confirm.User.RoleRemoved"], MessageType.Success);
await GetUserRoles();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Removing User From Role {UserRoleId} {Error}", UserRoleId, ex.Message);
AddModuleMessage(Localizer["Error.User.RemoveRole"], MessageType.Error);
}
}
catch (Exception ex)
else
{
await logger.LogError(ex, "Error Removing User From Role {UserRoleId} {Error}", UserRoleId, ex.Message);
AddModuleMessage("Error Removing User From Role", MessageType.Error);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,6 @@
@namespace Oqtane.Modules.Admin.Sites
@namespace Oqtane.Modules.Admin.Sites
@using Oqtane.Interfaces
@using System.Text.RegularExpressions
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ITenantService TenantService
@ -8,396 +10,436 @@
@inject ISiteTemplateService SiteTemplateService
@inject IUserService UserService
@inject IInstallationService InstallationService
@inject IDatabaseService DatabaseService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_tenants == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Enter the name of the site">Site Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="alias" HelpText="Enter the alias for the server">Aliases: </Label>
</td>
<td>
<textarea id="alias" class="form-control" @bind="@_urls" rows="3"></textarea>
</td>
</tr>
<tr>
<td>
<Label For="defaultTheme" HelpText="Select the default theme for the website">Default Theme: </Label>
</td>
<td>
<select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="">&lt;Select Theme&gt;</option>
@foreach (KeyValuePair<string, string> item in _themes)
{
<option value="@item.Key">@item.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="defaultLayout" HelpText="Select the default layout for the site">Default Layout: </Label>
</td>
<td>
<select id="defaultLayout" class="form-control" @bind="@_layouttype">
<option value="">&lt;Select Layout&gt;</option>
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
{
<option value="@panelayout.Key">@panelayout.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="defaultContainer" HelpText="Select the default container for the site">Default Container: </Label>
</td>
<td>
<select id="defaultContainer" class="form-control" @bind="@_containertype">
<option value="">&lt;Select Container&gt;</option>
@foreach (KeyValuePair<string, string> container in _containers)
{
<option value="@container.Key">@container.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="siteTemplate" HelpText="Select the site template">Site Template: </Label>
</td>
<td>
<select id="siteTemplate" class="form-control" @bind="@_sitetemplatetype">
<option value="">&lt;Select Site Template&gt;</option>
@foreach (SiteTemplate siteTemplate in _siteTemplates)
{
<option value="@siteTemplate.TypeName">@siteTemplate.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="tenant" HelpText="Select the tenant for the site">Tenant: </Label>
</td>
<td>
<select id="tenant" class="form-control" @onchange="(e => TenantChanged(e))">
<option value="-">&lt;Select Tenant&gt;</option>
<option value="+">&lt;Create New Tenant&gt;</option>
@foreach (Tenant tenant in _tenants)
{
<option value="@tenant.TenantId">@tenant.Name</option>
}
</select>
</td>
</tr>
@if (_tenantid == "+")
{
<tr>
<td colspan="2">
<hr class="app-rule" />
</td>
</tr>
<tr>
<td>
<Label For="name" HelpText="Enter the name for the tenant">Tenant Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_tenantname" />
</td>
</tr>
<tr>
<td>
<Label For="databaseType" HelpText="Select the database type for the tenant">Database Type: </Label>
</td>
<td>
<select id="databaseType" class="custom-select" @bind="@_databasetype">
<option value="LocalDB">Local Database</option>
<option value="SQLServer">SQL Server</option>
</select>
</td>
</tr>
<tr>
<td>
<Label For="server" HelpText="Enter the server for the tenant">Server: </Label>
</td>
<td>
<input id="server" type="text" class="form-control" @bind="@_server" />
</td>
</tr>
<tr>
<td>
<Label For="database" HelpText="Enter the database for the tenant">Database: </Label>
</td>
<td>
<input id="database" type="text" class="form-control" @bind="@_database" />
</td>
</tr>
<tr>
<td>
<Label For="integratedSecurity" HelpText="Select if you want integrated security or not">Integrated Security: </Label>
</td>
<td>
<select id="integratedSecurity" class="custom-select" @onchange="SetIntegratedSecurity">
<option value="true" selected>True</option>
<option value="false">False</option>
</select>
</td>
</tr>
@if (!_integratedsecurity)
{
<tr>
<td>
<Label For="username" HelpText="Enter the username for the integrated security">Database Username: </Label>
</td>
<td>
<input id="username" type="text" class="form-control" @bind="@_username" />
</td>
</tr>
<tr>
<td>
<Label For="password" HelpText="Enter the password for the integrated security">Database Password: </Label>
</td>
<td>
<input id="password" type="password" class="form-control" @bind="@_password" />
</td>
</tr>
}
<tr>
<td>
<Label For="hostUsername" HelpText="Enter the username of the host for this site">Host Username:</Label>
</td>
<td>
<input id="hostUsername" class="form-control" @bind="@_hostusername" readonly />
</td>
</tr>
<tr>
<td>
<Label For="hostPassword" HelpText="Enter the password for the host of this site">Host Password:</Label>
</td>
<td>
<input id="hostPassword" type="password" class="form-control" @bind="@_hostpassword" />
</td>
</tr>
}
</table>
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the name of the site" ResourceKey="Name">Site Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" maxlength="200" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="alias" HelpText="Enter the aliases for the site. An alias can be a domain name (www.site.com) or a virtual folder (ie. www.site.com/folder)." ResourceKey="Aliases">Aliases: </Label>
<div class="col-sm-9">
<textarea id="alias" class="form-control" @bind="@_urls" rows="3" required></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="defaultTheme" HelpText="Select the default theme for the website" ResourceKey="DefaultTheme">Default Theme: </Label>
<div class="col-sm-9">
<select id="defaultTheme" class="form-select" @onchange="(e => ThemeChanged(e))" required>
<option value="-">&lt;@Localizer["Theme.Select"]&gt;</option>
@foreach (var theme in _themes)
{
<option value="@theme.TypeName">@theme.Name</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="defaultContainer" HelpText="Select the default container for the site" ResourceKey="DefaultContainer">Default Container: </Label>
<div class="col-sm-9">
<select id="defaultContainer" class="form-select" @bind="@_containertype" required>
<option value="-">&lt;@Localizer["Container.Select"]&gt;</option>
@foreach (var container in _containers)
{
<option value="@container.TypeName">@container.Name</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="adminContainer" HelpText="Select the admin container for the site" ResourceKey="AdminContainer">Admin Container: </Label>
<div class="col-sm-9">
<select id="adminContainer" class="form-select" @bind="@_admincontainertype" required>
<option value="-">&lt;@Localizer["Container.Select"]&gt;</option>
<option value="">&lt;@Localizer["DefaultContainer.Admin"]&gt;</option>
@foreach (var container in _containers)
{
<option value="@container.TypeName">@container.Name</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="siteTemplate" HelpText="Select the site template" ResourceKey="SiteTemplate">Site Template: </Label>
<div class="col-sm-9">
<select id="siteTemplate" class="form-select" @bind="@_sitetemplatetype" required>
<option value="-">&lt;@Localizer["SiteTemplate.Select"]&gt;</option>
@foreach (SiteTemplate siteTemplate in _siteTemplates)
{
<option value="@siteTemplate.TypeName">@siteTemplate.Name</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="runtime" HelpText="The runtime hosting model" ResourceKey="Runtime">Runtime: </Label>
<div class="col-sm-9">
<select id="runtime" class="form-select" @bind="@_runtime" required>
<option value="Server">@SharedLocalizer["BlazorServer"]</option>
<option value="WebAssembly">@SharedLocalizer["BlazorWebAssembly"]</option>
<option value="Hybrid">@SharedLocalizer["BlazorHybrid"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="prerender" HelpText="Specifies if the site should be prerendered (for search crawlers, etc...)" ResourceKey="Prerender">Prerender? </Label>
<div class="col-sm-9">
<select id="prerender" class="form-select" @bind="@_prerender" required>
<option value="Prerendered">@SharedLocalizer["Yes"]</option>
<option value="">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="tenant" HelpText="Select the tenant for the site" ResourceKey="Tenant">Tenant: </Label>
<div class="col-sm-9">
<select id="tenant" class="form-select" @onchange="(e => TenantChanged(e))" required>
<option value="-">&lt;@Localizer["Tenant.Select"]&gt;</option>
<option value="+">&lt;@Localizer["Tenant.Add"]&gt;</option>
@foreach (Tenant tenant in _tenants)
{
<option value="@tenant.TenantId">@tenant.Name</option>
}
</select>
</div>
</div>
@if (_tenantid == "+")
{
<div class="row mb-1 align-items-center">
<hr class="app-rule" />
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="Enter the name for the tenant" ResourceKey="TenantName">Tenant Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_tenantName" maxlength="100" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="databaseType" HelpText="Select the database type for the tenant" ResourceKey="DatabaseType">Database Type: </Label>
<div class="col-sm-9">
@if (_databases != null)
{
<div class="input-group">
<select id="databaseType" class="form-select" value="@_databaseName" @onchange="(e => DatabaseChanged(e))" required>
@foreach (var database in _databases)
{
<option value="@database.Name">@Localizer[@database.Name]</option>
}
</select>
@if (!_showConnectionString)
{
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionString"]</button>
}
else
{
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionParameters"]</button>
}
</div>
}
</div>
</div>
@if (!_showConnectionString)
{
if (_databaseConfigType != null)
{
@DatabaseConfigComponent
}
}
else
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="connectionstring" HelpText="Enter a complete connection string including all parameters and delimiters" ResourceKey="ConnectionString">String:</Label>
<div class="col-sm-9">
<textarea id="connectionstring" class="form-control" @bind="@_connectionString" rows="3"></textarea>
</div>
</div>
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="hostUsername" HelpText="Enter the username of an existing host user" ResourceKey="HostUsername">Host Username:</Label>
<div class="col-sm-9">
<input id="hostUsername" class="form-control" @bind="@_hostusername" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="hostPassword" HelpText="Enter the password of an existing host user" ResourceKey="HostPassword">Host Password:</Label>
<div class="col-sm-9">
<input id="hostPassword" type="password" class="form-control" @bind="@_hostpassword" autocomplete="new-password" required />
</div>
</div>
}
</div>
<br />
<br />
<button type="button" class="btn btn-success" @onclick="SaveSite">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</form>
}
@code {
private Dictionary<string, string> _themes = new Dictionary<string, string>();
private Dictionary<string, string> _panelayouts = new Dictionary<string, string>();
private Dictionary<string, string> _containers = new Dictionary<string, string>();
private List<SiteTemplate> _siteTemplates;
private List<Theme> _themeList;
private List<Tenant> _tenants;
private string _tenantid = "-";
private List<Database> _databases;
private ElementReference form;
private bool validated = false;
private string _databaseName;
private Type _databaseConfigType;
private object _databaseConfig;
private RenderFragment DatabaseConfigComponent { get; set; }
private bool _showConnectionString = false;
private string _connectionString = string.Empty;
private string _tenantname = string.Empty;
private string _databasetype = "LocalDB";
private string _server = "(LocalDb)\\MSSQLLocalDB";
private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
private string _username = string.Empty;
private string _password = string.Empty;
private bool _integratedsecurity = true;
private string _hostusername = Constants.HostUser;
private string _hostpassword = string.Empty;
private List<Theme> _themeList;
private List<ThemeControl> _themes = new List<ThemeControl>();
private List<ThemeControl> _containers = new List<ThemeControl>();
private List<SiteTemplate> _siteTemplates;
private List<Tenant> _tenants;
private string _tenantid = "-";
private string _name = string.Empty;
private string _urls = string.Empty;
private string _themetype = string.Empty;
private string _layouttype = string.Empty;
private string _containertype = string.Empty;
private string _sitetemplatetype = string.Empty;
private string _tenantName = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
private string _hostusername = string.Empty;
private string _hostpassword = string.Empty;
protected override async Task OnInitializedAsync()
{
_themeList = await ThemeService.GetThemesAsync();
_tenants = await TenantService.GetTenantsAsync();
_urls = PageState.Alias.Name;
_themes = ThemeService.GetThemeTypes(_themeList);
_containers = ThemeService.GetContainerTypes(_themeList);
_siteTemplates = await SiteTemplateService.GetSiteTemplatesAsync();
}
private string _name = string.Empty;
private string _urls = string.Empty;
private string _themetype = "-";
private string _containertype = "-";
private string _admincontainertype = "";
private string _sitetemplatetype = "-";
private string _runtime = "Server";
private string _prerender = "Prerendered";
private void TenantChanged(ChangeEventArgs e)
{
_tenantid = (string)e.Value;
if (string.IsNullOrEmpty(_tenantname))
{
_tenantname = _name;
}
StateHasChanged();
}
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
private void SetIntegratedSecurity(ChangeEventArgs e)
{
if (Convert.ToBoolean((string)e.Value))
{
_integratedsecurity = true;
}
else
{
_integratedsecurity = false;
}
StateHasChanged();
}
protected override async Task OnInitializedAsync()
{
_tenants = await TenantService.GetTenantsAsync();
_urls = PageState.Alias.Name;
_themeList = await ThemeService.GetThemesAsync();
_themes = ThemeService.GetThemeControls(_themeList);
_siteTemplates = await SiteTemplateService.GetSiteTemplatesAsync();
private async void ThemeChanged(ChangeEventArgs e)
{
try
{
_themetype = (string)e.Value;
if (_themetype != string.Empty)
{
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
}
else
{
_panelayouts = new Dictionary<string, string>();
}
_databases = await DatabaseService.GetDatabasesAsync();
if (_databases.Exists(item => item.IsDefault))
{
_databaseName = _databases.Find(item => item.IsDefault).Name;
}
else
{
_databaseName = "LocalDB";
}
LoadDatabaseConfigComponent();
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Pane Layouts For Theme {ThemeType} {Error}", _themetype, ex.Message);
AddModuleMessage("Error Loading Pane Layouts For Theme", MessageType.Error);
}
}
private void DatabaseChanged(ChangeEventArgs eventArgs)
{
try
{
_databaseName = (string)eventArgs.Value;
_showConnectionString = false;
LoadDatabaseConfigComponent();
}
catch
{
AddModuleMessage(Localizer["Error.Database.LoadConfig"], MessageType.Error);
}
}
private async Task SaveSite()
{
if (_tenantid != "-" && _name != string.Empty && _urls != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)) && !string.IsNullOrEmpty(_containertype) && !string.IsNullOrEmpty(_sitetemplatetype))
{
var duplicates = new List<string>();
var aliases = await AliasService.GetAliasesAsync();
foreach (string name in _urls.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
if (aliases.Exists(item => item.Name == name))
{
duplicates.Add(name);
}
}
private void LoadDatabaseConfigComponent()
{
var database = _databases.SingleOrDefault(d => d.Name == _databaseName);
if (database != null)
{
_databaseConfigType = Type.GetType(database.ControlType);
DatabaseConfigComponent = builder =>
{
builder.OpenComponent(0, _databaseConfigType);
builder.AddComponentReferenceCapture(1, inst => { _databaseConfig = Convert.ChangeType(inst, _databaseConfigType); });
builder.CloseComponent();
};
}
}
if (duplicates.Count == 0)
{
InstallConfig config = new InstallConfig();
private void TenantChanged(ChangeEventArgs e)
{
_tenantid = (string)e.Value;
if (string.IsNullOrEmpty(_tenantName))
{
_tenantName = _name;
}
StateHasChanged();
}
if (_tenantid == "+")
{
if (!string.IsNullOrEmpty(_tenantname) && _tenants.FirstOrDefault(item => item.Name == _tenantname) == null)
{
// validate host credentials
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = Constants.HostUser;
user.Password = _hostpassword;
user = await UserService.LoginUserAsync(user, false, false);
if (user.IsAuthenticated)
{
if (!string.IsNullOrEmpty(_server) && !string.IsNullOrEmpty(_database))
private async void ThemeChanged(ChangeEventArgs e)
{
try
{
_themetype = (string)e.Value;
if (_themetype != "-")
{
_containers = ThemeService.GetContainerControls(_themeList, _themetype);
}
else
{
_containers = new List<ThemeControl>();
}
_containertype = "-";
_admincontainertype = "";
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Containers For Theme {ThemeType} {Error}", _themetype, ex.Message);
AddModuleMessage(Localizer["Error.Theme.LoadContainers"], MessageType.Error);
}
}
private async Task SaveSite()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (_tenantid != "-" && _name != string.Empty && _urls != string.Empty && _themetype != "-" && _containertype != "-" && _sitetemplatetype != "-")
{
_urls = Regex.Replace(_urls, @"\r\n?|\n", ",");
var duplicates = new List<string>();
var aliases = await AliasService.GetAliasesAsync();
foreach (string name in _urls.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
if (aliases.Exists(item => item.Name == name))
{
duplicates.Add(name);
}
}
if (duplicates.Count == 0)
{
InstallConfig config = new InstallConfig();
if (_tenantid == "+")
{
if (!string.IsNullOrEmpty(_tenantName) && _tenants.FirstOrDefault(item => item.Name == _tenantName) == null)
{
// validate host credentials
var user = new User();
user.SiteId = PageState.Site.SiteId;
user.Username = _hostusername;
user.Password = _hostpassword;
user.LastIPAddress = PageState.RemoteIPAddress;
user = await UserService.LoginUserAsync(user, false, false);
if (user.IsAuthenticated)
{
var connectionString = string.Empty;
if (_databasetype == "LocalDB")
var database = _databases.SingleOrDefault(d => d.Name == _databaseName);
var connectionString = String.Empty;
if (_showConnectionString)
{
connectionString = _connectionString;
}
else
{
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
{
connectionString = databaseConfigControl.GetConnectionString();
}
}
if (connectionString != "")
{
connectionString = "Data Source=" + _server + ";AttachDbFilename=|DataDirectory|\\" + _database + ".mdf;Initial Catalog=" + _database + ";Integrated Security=SSPI;";
config.TenantName = _tenantName;
config.DatabaseType = database.DBType;
config.ConnectionString = connectionString;
config.HostUsername = _hostusername;
config.HostPassword = _hostpassword;
config.HostEmail = user.Email;
config.HostName = user.DisplayName;
config.IsNewTenant = true;
}
else
{
connectionString = "Data Source=" + _server + ";Initial Catalog=" + _database + ";";
if (_integratedsecurity)
{
connectionString += "Integrated Security=SSPI;";
}
else
{
connectionString += "User ID=" + _username + ";Password=" + _password;
}
AddModuleMessage(Localizer["Error.Required.ServerDatabase"], MessageType.Error);
}
config.ConnectionString = connectionString;
config.HostPassword = _hostpassword;
config.HostEmail = user.Email;
config.HostName = user.DisplayName;
config.TenantName = _tenantname;
config.IsNewTenant = true;
}
else
{
AddModuleMessage("You Must Specify A Server And Database", MessageType.Error);
AddModuleMessage(Localizer["Error.InvalidPassword"], MessageType.Error);
}
}
else
{
AddModuleMessage("Invalid Host Password", MessageType.Error);
AddModuleMessage(Localizer["Error.TenantName.Exists"], MessageType.Error);
}
}
else
{
AddModuleMessage("Tenant Name Is Missing Or Already Exists", MessageType.Error);
var tenant = _tenants.FirstOrDefault(item => item.TenantId == int.Parse(_tenantid));
if (tenant != null)
{
config.TenantName = tenant.Name;
config.DatabaseType = tenant.DBType;
config.ConnectionString = tenant.DBConnectionString;
config.IsNewTenant = false;
}
}
if (!string.IsNullOrEmpty(config.TenantName))
{
config.SiteName = _name;
config.Aliases = _urls;
config.DefaultTheme = _themetype;
config.DefaultContainer = _containertype;
config.DefaultAdminContainer = _admincontainertype;
config.SiteTemplate = _sitetemplatetype;
config.Runtime = _runtime;
config.RenderMode = _runtime + _prerender;
ShowProgressIndicator();
var installation = await InstallationService.Install(config);
if (installation.Success)
{
var aliasname = config.Aliases.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0];
NavigationManager.NavigateTo(PageState.Uri.Scheme + "://" + aliasname, true);
}
else
{
await logger.LogError("Error Creating Site {Error}", installation.Message);
AddModuleMessage(installation.Message, MessageType.Error);
}
}
}
else
{
var tenant = _tenants.FirstOrDefault(item => item.TenantId == int.Parse(_tenantid));
if (tenant != null)
{
config.TenantName = tenant.Name;
config.ConnectionString= tenant.DBConnectionString;
config.IsNewTenant = false;
}
}
if (!string.IsNullOrEmpty(config.TenantName))
{
config.SiteName = _name;
config.Aliases = _urls.Replace("\n", ",");
config.DefaultTheme = _themetype;
config.DefaultLayout = _layouttype;
config.DefaultContainer = _containertype;
config.SiteTemplate = _sitetemplatetype;
ShowProgressIndicator();
var installation = await InstallationService.Install(config);
if (installation.Success)
{
var aliasname = config.Aliases.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0];
var uri = new Uri(NavigationManager.Uri);
NavigationManager.NavigateTo(uri.Scheme + "://" + aliasname, true);
}
else
{
await logger.LogError("Error Creating Site {Error}", installation.Message);
AddModuleMessage(installation.Message, MessageType.Error);
}
AddModuleMessage(string.Format(Localizer["Message.SiteName.InUse"], string.Join(", ", duplicates.ToArray())), MessageType.Warning);
}
}
else
{
AddModuleMessage(string.Join(", ", duplicates.ToArray()) + " Already Used For Another Site", MessageType.Warning);
AddModuleMessage(Localizer["Message.Required.Tenant"], MessageType.Warning);
}
}
else
{
AddModuleMessage("You Must Provide A Tenant, Site Name, Alias, Default Theme/Container, And Site Template", MessageType.Warning);
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
private void ToggleConnectionString()
{
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
{
_connectionString = databaseConfigControl.GetConnectionString();
}
_showConnectionString = !_showConnectionString;
}
}

View File

@ -1,272 +0,0 @@
@namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ISiteService SiteService
@inject ITenantService TenantService
@inject IAliasService AliasService
@inject IThemeService ThemeService
@if (_themes != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="Enter the name of the site">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
</td>
</tr>
<tr>
<td>
<Label For="tenant" HelpText="Enter the tenant for the site">Tenant: </Label>
</td>
<td>
<input id="tenant" class="form-control" @bind="@_tenant" readonly />
</td>
</tr>
<tr>
<td>
<Label For="alias" HelpText="Enter the alias for the server">Aliases: </Label>
</td>
<td>
<textarea id="alias" class="form-control" @bind="@_urls" rows="3" />
</td>
</tr>
<tr>
<td>
<Label For="defaultTheme" HelpText="Select the default theme for the website">Default Theme: </Label>
</td>
<td>
<select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="">&lt;Select Theme&gt;</option>
@foreach (KeyValuePair<string, string> item in _themes)
{
if (item.Key == _themetype)
{
<option value="@item.Key" selected>@item.Value</option>
}
else
{
<option value="@item.Key">@item.Value</option>
}
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="defaultLayout" HelpText="Select the default layout for the site">Default Layout: </Label>
</td>
<td>
<select id="defaultLayout" class="form-control" @bind="@_layouttype">
<option value="">&lt;Select Layout&gt;</option>
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
{
<option value="@panelayout.Key">@panelayout.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="defaultContainer" HelpText="Select the default container for the site">Default Container: </Label>
</td>
<td>
<select id="defaultIdea" class="form-control" @bind="@_containertype">
<option value="">&lt;Select Container&gt;</option>
@foreach (KeyValuePair<string, string> container in _containers)
{
<option value="@container.Key">@container.Value</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="isDeleted" HelpText="Has this site been deleted?">Is Deleted? </Label>
</td>
<td>
<select id="isDeleted" class="form-control" @bind="@_isdeleted">
<option value="True">Yes</option>
<option value="False">No</option>
</select>
</td>
</tr>
</table>
<br />
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br />
<br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
}
@code {
private Dictionary<string, string> _themes;
private Dictionary<string, string> _panelayouts;
private Dictionary<string, string> _containers;
private Alias _alias;
private List<Theme> _themeList;
private string _name = string.Empty;
private List<Tenant> _tenantList;
private string _tenant = string.Empty;
private List<Alias> _aliasList;
private string _urls = string.Empty;
private string _themetype;
private string _layouttype;
private string _containertype;
private string _createdby;
private DateTime _createdon;
private string _modifiedby;
private DateTime _modifiedon;
private string _deletedby;
private DateTime? _deletedon;
private string _isdeleted;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
_themeList = await ThemeService.GetThemesAsync();
_aliasList = await AliasService.GetAliasesAsync();
_alias = _aliasList.Find(item => item.AliasId == Int32.Parse(PageState.QueryString["id"]));
SiteService.SetAlias(_alias);
var site = await SiteService.GetSiteAsync(_alias.SiteId);
if (site != null)
{
_name = site.Name;
_tenantList = await TenantService.GetTenantsAsync();
_tenant = _tenantList.Find(item => item.TenantId == site.TenantId).Name;
foreach (Alias alias in _aliasList.Where(item => item.SiteId == site.SiteId && item.TenantId == site.TenantId).ToList())
{
_urls += alias.Name + "\n";
}
_themetype = site.DefaultThemeType;
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
_layouttype = site.DefaultLayoutType;
_containertype = site.DefaultContainerType;
_createdby = site.CreatedBy;
_createdon = site.CreatedOn;
_modifiedby = site.ModifiedBy;
_modifiedon = site.ModifiedOn;
_deletedby = site.DeletedBy;
_deletedon = site.DeletedOn;
_isdeleted = site.IsDeleted.ToString();
}
_themes = ThemeService.GetThemeTypes(_themeList);
_containers = ThemeService.GetContainerTypes(_themeList);
}
catch (Exception ex)
{
await Log(_alias, LogLevel.Error, string.Empty, ex, "Error Loading Site {SiteId} {Error}", _alias.SiteId, ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
}
}
private async void ThemeChanged(ChangeEventArgs e)
{
try
{
_themetype = (string)e.Value;
if (_themetype != string.Empty)
{
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
}
else
{
_panelayouts = new Dictionary<string, string>();
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Pane Layouts For Theme {ThemeType} {Error}", _themetype, ex.Message);
AddModuleMessage("Error Loading Pane Layouts For Theme", MessageType.Error);
}
}
private async Task SaveSite()
{
try
{
if (_name != string.Empty && _urls != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)) && !string.IsNullOrEmpty(_containertype))
{
var unique = true;
foreach (string name in _urls.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
if (_aliasList.Exists(item => item.Name == name && item.SiteId != _alias.SiteId && item.TenantId != _alias.TenantId))
{
unique = false;
}
}
if (unique)
{
SiteService.SetAlias(_alias);
var site = await SiteService.GetSiteAsync(_alias.SiteId);
if (site != null)
{
site.Name = _name;
site.LogoFileId = null;
site.DefaultThemeType = _themetype;
site.DefaultLayoutType = _layouttype ?? string.Empty;
site.DefaultContainerType = _containertype;
site.IsDeleted = (_isdeleted == null || Boolean.Parse(_isdeleted));
site = await SiteService.UpdateSiteAsync(site);
_urls = _urls.Replace("\n", ",");
var names = _urls.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (Alias alias in _aliasList.Where(item => item.SiteId == site.SiteId && item.TenantId == site.TenantId).ToList())
{
if (!names.Contains(alias.Name))
{
await AliasService.DeleteAliasAsync(alias.AliasId);
}
}
foreach (string name in names)
{
if (!_aliasList.Exists(item => item.Name == name))
{
Alias alias = new Alias
{
Name = name,
TenantId = site.TenantId,
SiteId = site.SiteId
};
await AliasService.AddAliasAsync(alias);
}
}
await Log(_alias, LogLevel.Information,PermissionNames.Edit, null, "Site Saved {Site}", site);
NavigationManager.NavigateTo(NavigateUrl());
}
}
else
{
AddModuleMessage("An Alias Specified Has Already Been Used For Another Site", MessageType.Warning);
}
}
else
{
AddModuleMessage("You Must Provide A Site Name, Alias, And Default Theme/Container", MessageType.Warning);
}
}
catch (Exception ex)
{
await Log(_alias, LogLevel.Error, string.Empty, ex, "Error Saving Site {SiteId} {Error}", _alias.SiteId, ex.Message);
AddModuleMessage("Error Saving Site", MessageType.Error);
}
}
}

View File

@ -1,8 +1,10 @@
@namespace Oqtane.Modules.Admin.Sites
@namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IAliasService AliasService
@inject ISiteService SiteService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_sites == null)
{
@ -10,71 +12,47 @@
}
else
{
<ActionLink Action="Add" Text="Add Site" />
<ActionLink Action="Add" Text="Add Site" ResourceKey="AddSite" />
<Pager Items="@_sites">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.AliasId.ToString())" /></td>
<td><ActionDialog Header="Delete Site" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Site?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteSite(context))" /></td>
<td><a href="@(_scheme + context.Name)">@context.Name</a></td>
<td><button type="button" class="btn btn-primary" @onclick="@(async () => Edit(context.Name))">@SharedLocalizer["Edit"]</button></td>
<td><button type="button" class="btn btn-secondary" @onclick="@(async () => Browse(context.Name))">@Localizer["Browse"]</button></td>
<td>@context.Name</td>
</Row>
</Pager>
}
@code {
private List<Alias> _sites;
private string _scheme;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnParametersSetAsync()
{
var uri = new Uri(NavigationManager.Uri);
_scheme = uri.Scheme + "://";
var aliases = await AliasService.GetAliasesAsync();
_sites = new List<Alias>();
foreach (Alias alias in aliases)
{
if (!_sites.Exists(item => item.TenantId == alias.TenantId && item.SiteId == alias.SiteId))
if (alias.IsDefault && !_sites.Exists(item => item.TenantId == alias.TenantId && item.SiteId == alias.SiteId))
{
_sites.Add(alias);
}
}
}
private async Task DeleteSite(Alias alias)
private void Edit(string name)
{
try
{
if (alias.SiteId != PageState.Site.SiteId || alias.TenantId != PageState.Site.TenantId)
{
SiteService.SetAlias(alias);
await SiteService.DeleteSiteAsync(alias.SiteId);
await Log(alias, LogLevel.Information, "", null, "Site Deleted {SiteId}", alias.SiteId);
var aliases = await AliasService.GetAliasesAsync();
foreach (Alias a in aliases.Where(item => item.SiteId == alias.SiteId && item.TenantId == alias.TenantId))
{
await AliasService.DeleteAliasAsync(a.AliasId);
}
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage("You Can Not Delete The Current Site", MessageType.Warning);
}
}
catch (Exception ex)
{
await Log(alias, LogLevel.Error, "", ex, "Error Deleting Site {SiteId} {Error}", alias.SiteId, ex.Message);
AddModuleMessage("Error Deleting Site", MessageType.Error);
}
NavigationManager.NavigateTo(PageState.Uri.Scheme + "://" + name + "/admin/site", true);
}
private void Browse(string name)
{
NavigationManager.NavigateTo(PageState.Uri.Scheme + "://" + name, true);
}
}

View File

@ -1,111 +1,151 @@
@namespace Oqtane.Modules.Admin.Sql
@namespace Oqtane.Modules.Admin.Sql
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ITenantService TenantService
@inject IDatabaseService DatabaseService
@inject ISqlService SqlService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_tenants == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<table class="table table-borderless">
<tr>
<td>
<Label For="tenant" HelpText="Select the tenant for the SQL server">Tenant: </Label>
</td>
<td>
<select id="teneant" class="form-control" @bind="_tenantid">
<option value="-1">&lt;Select Tenant&gt;</option>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="tenant" HelpText="Select the tenant for the SQL server" ResourceKey="Tenant">Tenant: </Label>
<div class="col-sm-9">
<select id="tenant" class="form-select" value="@_tenantid" @onchange="(e => TenantChanged(e))">
<option value="-1">&lt;@Localizer["Tenant.Select"]&gt;</option>
@foreach (Tenant tenant in _tenants)
{
<option value="@tenant.TenantId">@tenant.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="sqlQeury" HelpText="Enter the query for the SQL server">SQL Query: </Label>
</td>
<td>
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Execute">Execute</button>
<br /><br />
@if (!string.IsNullOrEmpty(_results))
</div>
</div>
@if (_tenantid != "-1")
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="database" HelpText="The database for the tenant" ResourceKey="Database">Database: </Label>
<div class="col-sm-9">
<input id="database" class="form-control" @bind="@_database" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="connectionstring" HelpText="The connection information for the database" ResourceKey="ConnectionString">Connection: </Label>
<div class="col-sm-9">
<textarea id="connectionstring" class="form-control" @bind="@_connectionstring" rows="2" readonly></textarea>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="sqlQeury" HelpText="Enter the query for the SQL server" ResourceKey="SqlQuery">SQL Query: </Label>
<div class="col-sm-9">
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="3"></textarea>
</div>
</div>
}
</div>
<br />
<button type="button" class="btn btn-success" @onclick="Execute">@Localizer["Execute"]</button>
<br />
<br />
@if (_results != null)
{
@((MarkupString)_results)
@if (_results.Count > 0)
{
<Pager Class="table table-bordered" Items="@_results">
<Header>
@foreach (KeyValuePair<string, string> kvp in _results.First())
{
<th>@kvp.Key</th>
}
</Header>
<Row>
@foreach (KeyValuePair<string, string> kvp in context)
{
<td>@kvp.Value</td>
}
</Row>
</Pager>
}
else
{
@Localizer["Return.NoResult"]
}
<br />
<br />
}
}
@code {
private List<Tenant> _tenants;
private string _tenantid = "-1";
private string _database = string.Empty;
private string _connectionstring = string.Empty;
private string _sql = string.Empty;
private string _results = string.Empty;
private List<Dictionary<string, string>> _results;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
_tenants = await TenantService.GetTenantsAsync();
try
{
_tenants = await TenantService.GetTenantsAsync();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Tenants {Error}", ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
}
}
private async void TenantChanged(ChangeEventArgs e)
{
try
{
_tenantid = (string)e.Value;
var tenants = await TenantService.GetTenantsAsync();
var _databases = await DatabaseService.GetDatabasesAsync();
var tenant = tenants.Find(item => item.TenantId == int.Parse(_tenantid));
if (tenant != null)
{
_database = _databases.Find(item => item.DBType == tenant.DBType)?.Name;
_connectionstring = tenant.DBConnectionString;
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Tenant {TenantId} {Error}", _tenantid, ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
}
}
private async Task Execute()
{
if (_tenantid != "-1" && !string.IsNullOrEmpty(_sql))
try
{
var sqlquery = new SqlQuery { TenantId = int.Parse(_tenantid), Query = _sql };
sqlquery = await SqlService.ExecuteQueryAsync(sqlquery);
_results = DisplayResults(sqlquery.Results);
}
else
{
AddModuleMessage("You Must Select A Tenant And Provide A SQL Query", MessageType.Warning);
}
}
private string DisplayResults(List<Dictionary<string, string>> results)
{
var table = string.Empty;
foreach (Dictionary<string, string> item in results)
{
if (table == string.Empty)
if (_tenantid != "-1" && !string.IsNullOrEmpty(_sql))
{
table = "<div class=\"table-responsive\">";
table += "<table class=\"table table-bordered\"><thead><tr>";
foreach (KeyValuePair<string, string> kvp in item)
{
table += "<th scope=\"col\">" + kvp.Key + "</th>";
}
table += "</tr></thead><tbody>";
var sqlquery = new SqlQuery { TenantId = int.Parse(_tenantid), Query = _sql };
sqlquery = await SqlService.ExecuteQueryAsync(sqlquery);
_results = sqlquery.Results;
AddModuleMessage(Localizer["Success.QueryExecuted"], MessageType.Success);
}
table += "<tr>";
foreach (KeyValuePair<string, string> kvp in item)
else
{
table += "<td>" + kvp.Value + "</td>";
AddModuleMessage(Localizer["Message.Required.Tenant"], MessageType.Warning);
}
table += "</tr>";
}
if (table != string.Empty)
catch (Exception ex)
{
table += "</tbody></table></div>";
await logger.LogError(ex, "Error Executing SQL Query {SQL} {Error}", _sql, ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
}
else
{
table = "No Results Returned";
}
return table;
}
}

View File

@ -1,81 +1,240 @@
@namespace Oqtane.Modules.Admin.SystemInfo
@namespace Oqtane.Modules.Admin.SystemInfo
@inherits ModuleBase
@inject ISystemService SystemService
@inject IInstallationService InstallationService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<table class="table table-borderless">
<tr>
<td>
<Label For="version" HelpText="Framework Version">Framework Version: </Label>
</td>
<td>
<input id="version" class="form-control" @bind="@_version" disabled />
</td>
</tr>
<tr>
<td>
<Label For="runtime" HelpText="Blazor Runtime (Server or WebAssembly)">Blazor Runtime: </Label>
</td>
<td>
<input id="runtime" class="form-control" @bind="@_runtime" disabled />
</td>
</tr>
<tr>
<td>
<Label For="clrversion" HelpText="Common Language Runtime Version">CLR Version: </Label>
</td>
<td>
<input id="clrversion" class="form-control" @bind="@_clrversion" disabled />
</td>
</tr>
<tr>
<td>
<Label For="osversion" HelpText="Operating System Version">OS Version: </Label>
</td>
<td>
<input id="osversion" class="form-control" @bind="@_osversion" disabled />
</td>
</tr>
<tr>
<td>
<Label For="serverpath" HelpText="Server Path">Server Path: </Label>
</td>
<td>
<input id="serverpath" class="form-control" @bind="@_serverpath" disabled />
</td>
</tr>
<tr>
<td>
<Label For="servertime" HelpText="Server Time">Server Time: </Label>
</td>
<td>
<input id="servertime" class="form-control" @bind="@_servertime" disabled />
</td>
</tr>
</table>
<a class="btn btn-primary" href="swagger/index.html" target="_new">Access Framework API</a>
<TabStrip>
<TabPanel Name="Info" Heading="Info" ResourceKey="Info">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="version" HelpText="Framework Version" ResourceKey="FrameworkVersion">Framework Version: </Label>
<div class="col-sm-9">
<input id="version" class="form-control" @bind="@_version" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="clrversion" HelpText="Common Language Runtime Version" ResourceKey="CLRVersion">CLR Version: </Label>
<div class="col-sm-9">
<input id="clrversion" class="form-control" @bind="@_clrversion" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="osversion" HelpText="Operating System Version" ResourceKey="OSVersion">OS Version: </Label>
<div class="col-sm-9">
<input id="osversion" class="form-control" @bind="@_osversion" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="machinename" HelpText="Machine Name" ResourceKey="MachineName">Machine Name: </Label>
<div class="col-sm-9">
<input id="machinename" class="form-control" @bind="@_machinename" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="ipaddress" HelpText="Server IP Address" ResourceKey="IPAddress">IP Address: </Label>
<div class="col-sm-9">
<input id="ipaddress" class="form-control" @bind="@_ipaddress" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="environment" HelpText="Environment name" ResourceKey="Environment">Environment: </Label>
<div class="col-sm-9">
<input id="environment" class="form-control" @bind="@_environment" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="contentrootpath" HelpText="Root Path" ResourceKey="ContentRootPath">Root Path: </Label>
<div class="col-sm-9">
<input id="contentrootpath" class="form-control" @bind="@_contentrootpath" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="webrootpath" HelpText="Web Path" ResourceKey="WebRootPath">Web Path: </Label>
<div class="col-sm-9">
<input id="webrootpath" class="form-control" @bind="@_webrootpath" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="servertime" HelpText="Server Date/Time (in UTC)" ResourceKey="ServerTime">Server Date/Time: </Label>
<div class="col-sm-9">
<input id="servertime" class="form-control" @bind="@_servertime" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="tickcount" HelpText="Amount Of Time The Service Has Been Available And Operational" ResourceKey="TickCount">Service Uptime: </Label>
<div class="col-sm-9">
<input id="tickcount" class="form-control" @bind="@_tickcount" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="workingset" HelpText="Memory Allocation Of Service (in MB)" ResourceKey="WorkingSet">Memory Allocation: </Label>
<div class="col-sm-9">
<input id="workingset" class="form-control" @bind="@_workingset" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="installationid" HelpText="The Unique Identifier For Your Installation" ResourceKey="InstallationId">Installation ID: </Label>
<div class="col-sm-9">
<input id="installationid" class="form-control" @bind="@_installationid" readonly />
</div>
</div>
</div>
<br /><br />
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
</TabPanel>
<TabPanel Name="Options" Heading="Options" ResourceKey="Options">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="detailederrors" HelpText="Specify If Detailed Errors Are Enabled For Blazor. This Option Should Not Not Be Enabled In Production." ResourceKey="DetailedErrors">Detailed Errors? </Label>
<div class="col-sm-9">
<select id="detailederrors" class="form-select" @bind="@_detailederrors">
<option value="true">@SharedLocalizer["True"]</option>
<option value="false">@SharedLocalizer["False"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="logginglevel" HelpText="The Minimum Logging Level For The Event Log. This Option Can Be Used To Control The Volume Of Items Stored In Your Event Log." ResourceKey="LoggingLevel">Logging Level: </Label>
<div class="col-sm-9">
<select id="logginglevel" class="form-select" @bind="@_logginglevel">
<option value="Trace">@Localizer["Trace"]</option>
<option value="Debug">@Localizer["Debug"]</option>
<option value="Information">@Localizer["Information"]</option>
<option value="Warning">@Localizer["Warning"]</option>
<option value="Error">@Localizer["Error"]</option>
<option value="Critical">@Localizer["Critical"]</option>
<option value="None">@Localizer["None"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="notificationlevel" HelpText="The Minimum Logging Level For Which Notifications Should Be Sent To Host Users." ResourceKey="NotificationLevel">Notification Level: </Label>
<div class="col-sm-9">
<select id="notificationlevel" class="form-select" @bind="@_notificationlevel">
<option value="Trace">@Localizer["Trace"]</option>
<option value="Debug">@Localizer["Debug"]</option>
<option value="Information">@Localizer["Information"]</option>
<option value="Warning">@Localizer["Warning"]</option>
<option value="Error">@Localizer["Error"]</option>
<option value="Critical">@Localizer["Critical"]</option>
<option value="None">@Localizer["None"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="swagger" HelpText="Specify If Swagger Is Enabled For Your Server API" ResourceKey="Swagger">Swagger Enabled? </Label>
<div class="col-sm-9">
<select id="swagger" class="form-select" @bind="@_swagger">
<option value="true">@SharedLocalizer["True"]</option>
<option value="false">@SharedLocalizer["False"]</option>
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="packageservice" HelpText="Specify If The Package Service Is Enabled For Installing Modules, Themes, And Translations" ResourceKey="PackageService">Enable Package Service? </Label>
<div class="col-sm-9">
<select id="packageservice" class="form-select" @bind="@_packageservice">
<option value="true">@SharedLocalizer["True"]</option>
<option value="false">@SharedLocalizer["False"]</option>
</select>
</div>
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveConfig">@SharedLocalizer["Save"]</button>&nbsp;
<a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Access.ApiFramework"]</a>&nbsp;
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
</TabPanel>
</TabStrip>
<br /><br />
@code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
private string _version = string.Empty;
private string _runtime = string.Empty;
private string _clrversion = string.Empty;
private string _osversion = string.Empty;
private string _serverpath = string.Empty;
private string _servertime = string.Empty;
private string _version = string.Empty;
private string _clrversion = string.Empty;
private string _osversion = string.Empty;
private string _machinename = string.Empty;
private string _ipaddress = string.Empty;
private string _environment = string.Empty;
private string _contentrootpath = string.Empty;
private string _webrootpath = string.Empty;
private string _servertime = string.Empty;
private string _tickcount = string.Empty;
private string _workingset = string.Empty;
private string _installationid = string.Empty;
protected override async Task OnInitializedAsync()
private string _detailederrors = string.Empty;
private string _logginglevel = string.Empty;
private string _notificationlevel = string.Empty;
private string _swagger = string.Empty;
private string _packageservice = string.Empty;
protected override async Task OnInitializedAsync()
{
_version = Constants.Version;
Dictionary<string, object> systeminfo = await SystemService.GetSystemInfoAsync("environment");
if (systeminfo != null)
{
_clrversion = systeminfo["CLRVersion"].ToString();
_osversion = systeminfo["OSVersion"].ToString();
_machinename = systeminfo["MachineName"].ToString();
_ipaddress = systeminfo["IPAddress"].ToString();
_environment = systeminfo["Environment"].ToString();
_contentrootpath = systeminfo["ContentRootPath"].ToString();
_webrootpath = systeminfo["WebRootPath"].ToString();
_servertime = systeminfo["ServerTime"].ToString() + " UTC";
_tickcount = TimeSpan.FromMilliseconds(Convert.ToInt64(systeminfo["TickCount"].ToString())).ToString();
_workingset = (Convert.ToInt64(systeminfo["WorkingSet"].ToString()) / 1000000).ToString() + " MB";
}
systeminfo = await SystemService.GetSystemInfoAsync();
if (systeminfo != null)
{
_installationid = systeminfo["InstallationId"].ToString();
_detailederrors = systeminfo["DetailedErrors"].ToString();
_logginglevel = systeminfo["Logging:LogLevel:Default"].ToString();
_notificationlevel = systeminfo["Logging:LogLevel:Notify"].ToString();
_swagger = systeminfo["UseSwagger"].ToString();
_packageservice = systeminfo["PackageService"].ToString();
}
}
private async Task SaveConfig()
{
_version = Constants.Version;
_runtime = PageState.Runtime.ToString();
Dictionary<string, string> systeminfo = await SystemService.GetSystemInfoAsync();
if (systeminfo != null)
try
{
_clrversion = systeminfo["clrversion"];
_osversion = systeminfo["osversion"];
_serverpath = systeminfo["serverpath"];
_servertime = systeminfo["servertime"];
var settings = new Dictionary<string, object>();
settings.Add("DetailedErrors", _detailederrors);
settings.Add("Logging:LogLevel:Default", _logginglevel);
settings.Add("Logging:LogLevel:Notify", _notificationlevel);
settings.Add("UseSwagger", _swagger);
settings.Add("PackageService", _packageservice);
await SystemService.UpdateSystemInfoAsync(settings);
AddModuleMessage(Localizer["Success.UpdateConfig.Restart"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Configuration");
AddModuleMessage(Localizer["Error.UpdateConfig"], MessageType.Error);
}
}
}
private async Task RestartApplication()
{
try
{
ShowProgressIndicator();
var interop = new Interop(JSRuntime);
await interop.RedirectBrowser(NavigateUrl(""), 20);
await InstallationService.RestartAsync();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Restarting Application");
}
}
}

View File

@ -1,85 +0,0 @@
@namespace Oqtane.Modules.Admin.Tenants
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject ITenantService TenantService
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="The name of the tenant">Name: </Label>
</td>
<td>
@if (name == Constants.MasterTenant)
{
<input id="name" class="form-control" @bind="@name" readonly />
}
else
{
<input id="name" class="form-control" @bind="@name" />
}
</td>
</tr>
<tr>
<td>
<Label For="connectionstring" HelpText="The database connection string">Connection String: </Label>
</td>
<td>
<textarea id="connectionstring" class="form-control" @bind="@connectionstring" rows="3" readonly></textarea>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="SaveTenant">Save</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
@code {
private int tenantid;
private string name = string.Empty;
private string connectionstring = string.Empty;
private string schema = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
tenantid = Int32.Parse(PageState.QueryString["id"]);
var tenant = await TenantService.GetTenantAsync(tenantid);
if (tenant != null)
{
name = tenant.Name;
connectionstring = tenant.DBConnectionString;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Tenant {TenantId} {Error}", tenantid, ex.Message);
AddModuleMessage("Error Loading Tenant", MessageType.Error);
}
}
private async Task SaveTenant()
{
try
{
connectionstring = connectionstring.Replace("\\\\", "\\");
var tenant = await TenantService.GetTenantAsync(tenantid);
if (tenant != null)
{
tenant.Name = name;
tenant.DBConnectionString = connectionstring;
await TenantService.UpdateTenantAsync(tenant);
await logger.LogInformation("Tenant Saved {TenantId}", tenantid);
NavigationManager.NavigateTo(NavigateUrl());
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Tenant {TenantId} {Error}", tenantid, ex.Message);
AddModuleMessage("Error Saving Tenant", MessageType.Error);
}
}
}

View File

@ -1,67 +0,0 @@
@namespace Oqtane.Modules.Admin.Tenants
@inherits ModuleBase
@inject ITenantService TenantService
@inject IAliasService AliasService
@if (tenants == null)
{
<p><em>Loading...</em></p>
}
else
{
<Pager Items="@tenants">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Name</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.TenantId.ToString())" /></td>
<td><ActionDialog Header="Delete Tenant" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Tenant?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTenant(context))" Disabled="@(context.Name == Constants.MasterTenant)" /></td>
<td>@context.Name</td>
</Row>
</Pager>
}
@code {
private List<Tenant> tenants;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnParametersSetAsync()
{
tenants = await TenantService.GetTenantsAsync();
}
private async Task DeleteTenant(Tenant Tenant)
{
try
{
string message = string.Empty;
var aliases = await AliasService.GetAliasesAsync();
foreach (var alias in aliases)
{
if (alias.TenantId == Tenant.TenantId)
{
message += ", " + alias.Name;
}
}
if (string.IsNullOrEmpty(message))
{
await TenantService.DeleteTenantAsync(Tenant.TenantId);
await logger.LogInformation("Tenant Deleted {Tenant}", Tenant);
StateHasChanged();
}
else
{
AddModuleMessage("Tenant Cannot Be Deleted Until The Following Sites Are Deleted: " + message.Substring(2), MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Tenant {Tenant} {Error}", Tenant, ex.Message);
AddModuleMessage("Error Deleting Tenant", MessageType.Error);
}
}
}

View File

@ -1,53 +1,131 @@
@namespace Oqtane.Modules.Admin.Themes
@namespace Oqtane.Modules.Admin.Themes
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IFileService FileService
@inject IThemeService ThemeService
@inject IPackageService PackageService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_packages != null)
{
<TabStrip>
@if (_packages.Count > 0)
{
<TabPanel Name="Download">
<ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage>
<Pager Items="@_packages">
<Header>
<th>Name</th>
<th>Version</th>
<th></th>
</Header>
<Row>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
<button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadTheme(context.PackageId, context.Version))>Download</button>
</td>
</Row>
</Pager>
<TabPanel Name="Download" ResourceKey="Download">
<div class="row justify-content-center mb-3">
<div class="col-sm-6">
<div class="input-group">
<select id="price" class="form-select custom-select" @onchange="(e => PriceChanged(e))">
<option value="free">@SharedLocalizer["Free"]</option>
<option value="paid">@SharedLocalizer["Paid"]</option>
</select>
<input id="search" class="form-control" placeholder="@SharedLocalizer["Search.Hint"]" @bind="@_search" />
<button type="button" class="btn btn-primary" @onclick="Search">@SharedLocalizer["Search"]</button>
<button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Reset"]</button>
</div>
</div>
</div>
@if (_packages != null)
{
if (_packages.Count > 0)
{
<Pager Items="@_packages">
<Row>
<td>
<h3 style="display: inline;"><a href="@context.ProductUrl" target="_new">@context.Name</a></h3>&nbsp;&nbsp;@SharedLocalizer["Search.By"]:&nbsp;&nbsp;<strong><a href="@context.OwnerUrl" target="new">@context.Owner</a></strong><br />
@(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)<br />
<strong>@(String.Format("{0:n0}", context.Downloads))</strong> @SharedLocalizer["Search.Downloads"]&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Released"]: <strong>@context.ReleaseDate.ToString("MMM dd, yyyy")</strong>&nbsp;&nbsp;|&nbsp;&nbsp;
@SharedLocalizer["Search.Version"]: <strong>@context.Version</strong>
@((MarkupString)(!string.IsNullOrEmpty(context.PackageUrl) ? "&nbsp;&nbsp;|&nbsp;&nbsp;" + SharedLocalizer["Search.Source"] + ": <strong>" + new Uri(context.PackageUrl).Host + "</strong>" : ""))
@((MarkupString)(context.TrialPeriod > 0 ? "&nbsp;&nbsp;|&nbsp;&nbsp;<strong>" + context.TrialPeriod + " " + @SharedLocalizer["Trial"] + "</strong>" : ""))
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PackageUrl))
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
<td style="width: 1px; vertical-align: middle;">
@if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl))
{
<a class="btn btn-primary" style="text-decoration: none !important" href="@context.PaymentUrl" target="_new">@context.Price.Value.ToString("$#,##0.00")</a>
}
else
{
<button type="button" class="btn btn-primary" @onclick=@(async () => await GetPackage(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button>
}
</td>
</Row>
</Pager>
}
else
{
<br />
<div class="mx-auto text-center">
@Localizer["Search.NoResults"]
</div>
}
}
</TabPanel>
}
<TabPanel Name="Upload">
<table class="table table-borderless">
<tr>
<td>
<Label HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation.">Theme: </Label>
</td>
<td>
<FileManager Filter="nupkg" ShowFiles="false" Folder="Themes" UploadMultiple="True" />
</td>
</tr>
</table>
<TabPanel Name="Upload" ResourceKey="Upload">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation." ResourceKey="Theme">Theme: </Label>
<div class="col-sm-9">
<FileManager Folder="@Constants.PackagesFolder" UploadMultiple="true" />
</div>
</div>
</div>
</TabPanel>
</TabStrip>
<button type="button" class="btn btn-success" @onclick="InstallThemes">Install</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
@if (_productname != "")
{
<div class="app-actiondialog">
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@SharedLocalizer["Review License Terms"]</h5>
<button type="button" class="btn-close" aria-label="Close" @onclick="HideModal"></button>
</div>
<div class="modal-body">
<p style="height: 200px; overflow-y: scroll;">
<h3>@_productname</h3>
@if (!string.IsNullOrEmpty(_license))
{
@((MarkupString)_license)
}
else
{
@SharedLocalizer["License Not Specified"]
}
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" @onclick="DownloadPackage">@SharedLocalizer["Accept"]</button>
<button type="button" class="btn btn-secondary" @onclick="HideModal">@SharedLocalizer["Cancel"]</button>
</div>
</div>
</div>
</div>
</div>
}
<button type="button" class="btn btn-success" @onclick="InstallThemes">@SharedLocalizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
<ModuleMessage Type="MessageType.Info" Message="@SharedLocalizer["Oqtane.Marketplace"]" />
@code {
private List<Package> _packages;
private string _price = "free";
private string _search = "";
private string _productname = "";
private string _license = "";
private string _packageid = "";
private string _version = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
@ -55,21 +133,118 @@
{
try
{
var themes = await ThemeService.GetThemesAsync();
_packages = await PackageService.GetPackagesAsync("theme");
await LoadThemes();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Packages {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Package.Load"], MessageType.Error);
}
}
private async Task LoadThemes()
{
var themes = await ThemeService.GetThemesAsync();
_packages = await PackageService.GetPackagesAsync("theme", _search, _price, "");
if (_packages != null)
{
foreach (Package package in _packages.ToArray())
{
if (themes.Exists(item => Utilities.GetTypeName(item.ThemeName) == package.PackageId))
if (themes.Exists(item => item.PackageName == package.PackageId))
{
_packages.Remove(package);
}
}
}
}
private async void PriceChanged(ChangeEventArgs e)
{
try
{
_price = (string)e.Value;
_search = "";
await LoadThemes();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Packages {Error}", ex.Message);
AddModuleMessage("Error Loading Packages", MessageType.Error);
await logger.LogError(ex, "Error On PriceChanged");
}
}
private async Task Search()
{
try
{
await LoadThemes();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Search");
}
}
private async Task Reset()
{
try
{
_search = "";
await LoadThemes();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On Reset");
}
}
private void HideModal()
{
_productname = "";
_license = "";
StateHasChanged();
}
private async Task GetPackage(string packageid, string version)
{
try
{
var package = await PackageService.GetPackageAsync(packageid, version);
if (package != null)
{
_productname = package.Name;
if (!string.IsNullOrEmpty(package.License))
{
_license = package.License.Replace("\n", "<br />");
}
_packageid = package.PackageId;
_version = package.Version;
}
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Getting Package {PackageId} {Version}", packageid, version);
AddModuleMessage(Localizer["Error.Theme.Download"], MessageType.Error);
}
}
private async Task DownloadPackage()
{
try
{
await PackageService.DownloadPackageAsync(_packageid, _version, Constants.PackagesFolder);
await logger.LogInformation("Package {PackageId} {Version} Downloaded Successfully", _packageid, _version);
AddModuleMessage(Localizer["Success.Theme.Download"], MessageType.Success);
_productname = "";
_license = "";
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Package {PackageId} {Version}", _packageid, _version);
AddModuleMessage(Localizer["Error.Theme.Download"], MessageType.Error);
}
}
@ -78,27 +253,11 @@
try
{
await ThemeService.InstallThemesAsync();
NavigationManager.NavigateTo(NavigateUrl());
AddModuleMessage(string.Format(Localizer["Success.Theme.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Installating Theme");
await logger.LogError(ex, "Error Installing Theme");
}
}
private async Task DownloadTheme(string packageid, string version)
{
try
{
await PackageService.DownloadPackageAsync(packageid, version, "Themes");
await logger.LogInformation("Theme {ThemeName} {Version} Downloaded Successfully", packageid, version);
AddModuleMessage("Themes Downloaded Successfully. Click Install To Complete Installation.", MessageType.Success);
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Module {ThemeName} {Version}", packageid, version);
AddModuleMessage("Error Downloading Theme", MessageType.Error);
}
}
}
}

View File

@ -0,0 +1,150 @@
@namespace Oqtane.Modules.Admin.Themes
@inherits ModuleBase
@using System.Text.RegularExpressions
@inject NavigationManager NavigationManager
@inject IThemeService ThemeService
@inject IModuleService ModuleService
@inject IPageModuleService PageModuleService
@inject ISettingService SettingService
@inject IStringLocalizer<Create> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_templates != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="owner" HelpText="Enter the name of the organization who is developing this theme. It should not contain spaces or punctuation." ResourceKey="OwnerName">Owner Name: </Label>
<div class="col-sm-9">
<input id="owner" class="form-control" @bind="@_owner" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="module" HelpText="Enter a name for this theme. It should not contain spaces or punctuation." ResourceKey="ThemeName">Theme Name: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_theme" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="template" HelpText="Select a theme template. Templates are located in the wwwroot/Themes/Templates folder on the server." ResourceKey="Template">Template: </Label>
<div class="col-sm-9">
<select id="template" class="form-select" @onchange="(e => TemplateChanged(e))">
<option value="-">&lt;@Localizer["Template.Select"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Title</option>
}
</select>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="reference" HelpText="Select a framework reference version" ResourceKey="FrameworkReference">Framework Reference: </Label>
<div class="col-sm-9">
<select id="reference" class="form-select" @bind="@_reference">
@foreach (string version in _versions)
{
if (Version.Parse(version).CompareTo(Version.Parse(_minversion)) >= 0)
{
<option value="@(version)">@(version)</option>
}
}
<option value="local">@SharedLocalizer["LocalVersion"]</option>
</select>
</div>
</div>
@if (!string.IsNullOrEmpty(_location))
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="location" HelpText="Location where the theme will be created" ResourceKey="Location">Location: </Label>
<div class="col-sm-9">
<input id="module" class="form-control" @bind="@_location" readonly />
</div>
</div>
}
</div>
<br />
<button type="button" class="btn btn-success" @onclick="CreateTheme">@Localizer["Theme.Create"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
}
@code {
private string _owner = string.Empty;
private string _theme = string.Empty;
private List<Template> _templates;
private string _template = "-";
private string[] _versions;
private string _reference = "local";
private string _minversion = "2.0.0";
private string _location = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override void OnInitialized()
{
AddModuleMessage(Localizer["Info.Theme.CreatorIntent"], MessageType.Info);
}
protected override async Task OnParametersSetAsync()
{
try
{
_templates = await ThemeService.GetThemeTemplatesAsync();
_versions = Constants.ReleaseVersions.Split(',').Where(item => Version.Parse(item).CompareTo(Version.Parse("2.0.0")) >= 0).ToArray();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Theme Creator");
}
}
private async Task CreateTheme()
{
try
{
if (IsValid(_owner) && IsValid(_theme) && _owner != _theme && _template != "-")
{
var theme = new Theme { Owner = _owner, Name = _theme, Template = _template, Version = _reference };
theme = await ThemeService.CreateThemeAsync(theme);
GetLocation();
AddModuleMessage(string.Format(Localizer["Success.Theme.Create"], NavigateUrl("admin/system")), MessageType.Success);
}
else
{
AddModuleMessage(Localizer["Message.Required.ValidName"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Creating Theme");
}
}
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && name.ToLower() != "theme" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)
{
_template = (string)e.Value;
_minversion = "2.0.0";
if (_template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_minversion = template.Version;
}
GetLocation();
}
private void GetLocation()
{
_location = string.Empty;
if (_owner != "" && _theme != "" && _template != "-")
{
var template = _templates.FirstOrDefault(item => item.Name == _template);
_location = template.Location + _owner + "." + _theme;
}
StateHasChanged();
}
}

View File

@ -1,79 +1,143 @@
@namespace Oqtane.Modules.Admin.Themes
@namespace Oqtane.Modules.Admin.Themes
@using System.Net
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IThemeService ThemeService
@inject IPackageService PackageService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (themes == null)
@if (_themes == null)
{
<p><em>Loading...</em></p>
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<ActionLink Action="Add" Text="Install Theme" />
@((MarkupString)"&nbsp;")
<ActionLink Action="Create" Text="Create Theme" ResourceKey="CreateTheme" Class="btn btn-secondary" />
<Pager Items="@themes">
<Pager Items="@_themes">
<Header>
<th>&nbsp;</th>
<th>Name</th>
<th>Version</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th>
<th>@SharedLocalizer["Version"]</th>
<th>@SharedLocalizer["Expires"]</th>
<th>&nbsp;</th>
</Header>
<Row>
<td><ActionLink Action="View" Parameters="@($"name=" + WebUtility.UrlEncode(context.ThemeName))" ResourceKey="ViewTheme" /></td>
<td>
@if (context.AssemblyName != "Oqtane.Client")
{
<ActionDialog Header="Delete Theme" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Theme?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" />
}
@if (context.AssemblyName != Constants.ClientId)
{
<ActionDialog Header="Delete Theme" Message="@string.Format(Localizer["Confirm.Theme.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" ResourceKey="DeleteTheme" />
}
</td>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
@if (UpgradeAvailable(context.ThemeName, context.Version))
@((MarkupString)PurchaseLink(context.PackageName))
</td>
<td>
@{
var version = UpgradeAvailable(context.PackageName, context.Version);
}
@if (version != context.Version)
{
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadTheme(context.ThemeName, context.Version))>Upgrade</button>
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadTheme(context.PackageName, version))>@SharedLocalizer["Upgrade"]</button>
}
</td>
<td></td>
</Row>
</Pager>
}
@code {
private List<Theme> themes;
private List<Package> packages;
private List<Theme> _themes;
private List<Package> _packages;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
protected override async Task OnParametersSetAsync()
{
themes = await ThemeService.GetThemesAsync();
packages = await PackageService.GetPackagesAsync("module");
}
private bool UpgradeAvailable(string themename, string version)
{
var upgradeavailable = false;
var package = packages.Where(item => item.PackageId == Utilities.GetTypeName(themename)).FirstOrDefault();
if (package != null)
try
{
upgradeavailable = (Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0);
_themes = await ThemeService.GetThemesAsync();
_packages = await PackageService.GetPackagesAsync("theme");
}
catch (Exception ex)
{
if (_themes == null)
{
await logger.LogError(ex, "Error Loading Themes {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Theme.Load"], MessageType.Error);
}
}
return upgradeavailable;
}
private async Task DownloadTheme(string themename, string version)
private string PurchaseLink(string packagename)
{
await PackageService.DownloadPackageAsync(themename, version, "Themes");
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
await ThemeService.InstallThemesAsync();
NavigationManager.NavigateTo(NavigateUrl());
string link = "";
if (!string.IsNullOrEmpty(packagename) && _packages != null)
{
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
if (package != null)
{
if (package.ExpiryDate != null && package.ExpiryDate.Value.Date != DateTime.MaxValue.Date)
{
link += "<span>" + package.ExpiryDate.Value.Date.ToString("MMM dd, yyyy") + "</span>";
if (!string.IsNullOrEmpty(package.PaymentUrl))
{
link += "&nbsp;&nbsp;<a class=\"btn btn-primary\" style=\"text-decoration: none !important\" href=\"" + package.PaymentUrl + "\" target=\"_new\">" + SharedLocalizer["Extend"] + "</a>";
}
}
}
}
return link;
}
private string UpgradeAvailable(string packagename, string version)
{
if (!string.IsNullOrEmpty(packagename) && _packages != null)
{
var package = _packages.Where(item => item.PackageId == packagename).FirstOrDefault();
if (package != null && Version.Parse(package.Version).CompareTo(Version.Parse(version)) > 0)
{
return package.Version;
}
}
return version;
}
private async Task DownloadTheme(string packagename, string version)
{
try
{
await PackageService.DownloadPackageAsync(packagename, version, Constants.PackagesFolder);
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", packagename, version);
await ThemeService.InstallThemesAsync();
AddModuleMessage(string.Format(Localizer["Success.Theme.Install"], NavigateUrl("admin/system")), MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Theme {ThemeName} {Version} {Error}", packagename, version, ex.Message);
AddModuleMessage(Localizer["Error.Theme.Download"], MessageType.Error);
}
}
private async Task DeleteTheme(Theme Theme)
{
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
await logger.LogInformation("Theme Deleted {Theme}", Theme);
NavigationManager.NavigateTo(NavigateUrl());
try
{
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
AddModuleMessage(Localizer["Success.Theme.Delete"], MessageType.Success);
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, true));
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Theme {Theme} {Error}", Theme, ex.Message);
AddModuleMessage(Localizer["Error.Theme.Delete"], MessageType.Error);
}
}
}

View File

@ -0,0 +1,97 @@
@namespace Oqtane.Modules.Admin.Themes
@using System.Net
@inherits ModuleBase
@inject IThemeService ThemeService
@inject NavigationManager NavigationManager
@inject IStringLocalizer<View> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="name" HelpText="The name of the theme" ResourceKey="Name">Name: </Label>
<div class="col-sm-9">
<input id="name" class="form-control" @bind="@_name" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="themename" HelpText="The internal name of the module" ResourceKey="InternalName">Internal Name: </Label>
<div class="col-sm-9">
<input id="themename" class="form-control" @bind="@_themeName" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="version" HelpText="The version of the theme" ResourceKey="Version">Version: </Label>
<div class="col-sm-9">
<input id="version" class="form-control" @bind="@_version" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="packagename" HelpText="The unique name of the package from which this module was installed" ResourceKey="PackageName">Package Name: </Label>
<div class="col-sm-9">
<input id="packagename" class="form-control" @bind="@_packagename" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="owner" HelpText="The owner or creator of the theme" ResourceKey="Owner">Owner: </Label>
<div class="col-sm-9">
<input id="owner" class="form-control" @bind="@_owner" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="The reference url of the theme" ResourceKey="ReferenceUrl">Reference Url: </Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="contact" HelpText="The contact for the theme" ResourceKey="Contact">Contact: </Label>
<div class="col-sm-9">
<input id="contact" class="form-control" @bind="@_contact" disabled />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="license" HelpText="The license of the theme" ResourceKey="License">License: </Label>
<div class="col-sm-9">
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
</div>
</div>
</div>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
@code {
private string _themeName = "";
private string _name;
private string _version;
private string _packagename;
private string _owner = "";
private string _url = "";
private string _contact = "";
private string _license = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
protected override async Task OnInitializedAsync()
{
try
{
_themeName = WebUtility.UrlDecode(PageState.QueryString["name"]);
var themes = await ThemeService.GetThemesAsync();
var theme = themes.FirstOrDefault(item => item.ThemeName == _themeName);
if (theme != null)
{
_name = theme.Name;
_version = theme.Version;
_packagename = theme.PackageName;
_owner = theme.Owner;
_url = theme.Url;
_contact = theme.Contact;
_license = theme.License;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Theme {ThemeName} {Error}", _themeName, ex.Message);
AddModuleMessage(Localizer["Error.Theme.Loading"], MessageType.Error);
}
}
}

View File

@ -1,39 +1,38 @@
@namespace Oqtane.Modules.Admin.Upgrade
@namespace Oqtane.Modules.Admin.Upgrade
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IFileService FileService
@inject IPackageService PackageService
@inject IInstallationService InstallationService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_package != null)
{
<TabStrip>
<TabPanel Name="Download">
@if (_upgradeavailable)
<TabPanel Name="Download" ResourceKey="Download">
@if (_package != null && _upgradeavailable)
{
<ModuleMessage Type="MessageType.Info" Message="Select The Upgrade Button To Install a New Framework Version"></ModuleMessage>
@("Framework") @_package.Version <button type="button" class="btn btn-success" @onclick=@(async () => await Download(Constants.PackageId, Constants.Version))>Upgrade</button>
<ModuleMessage Type="MessageType.Info" Message="Select The Download Button To Download The Framework Upgrade Package And Then Select Upgrade"></ModuleMessage>
<button type="button" class="btn btn-primary" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>@SharedLocalizer["Download"] @_package.Version</button>
<button type="button" class="btn btn-success" @onclick="Upgrade">@SharedLocalizer["Upgrade"]</button>
}
else
{
<ModuleMessage Type="MessageType.Info" Message="Framework Is Already Up To Date"></ModuleMessage>
}
</TabPanel>
<TabPanel Name="Upload">
<table class="table table-borderless">
<tr>
<td>
<Label HelpText="Upload a framework package and select Install to complete the installation">Framework: </Label>
</td>
<td>
<FileManager Filter="nupkg" ShowFiles="false" Folder="Framework" />
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Upgrade">Install</button>
<TabPanel Name="Upload" ResourceKey="Upload">
<ModuleMessage Type="MessageType.Info" Message="Upload A Framework Package (Oqtane.Framework.version.nupkg) And Then Select Upgrade"></ModuleMessage>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" HelpText="Upload A Framework Package And Then Select Upgrade" ResourceKey="Framework">Framework: </Label>
<div class="col-sm-9">
<FileManager Folder="@Constants.PackagesFolder" />
</div>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="Upgrade">@SharedLocalizer["Upgrade"]</button>
</TabPanel>
</TabStrip>
}
@code {
private Package _package;
@ -43,28 +42,57 @@
protected override async Task OnInitializedAsync()
{
List<Package> packages = await PackageService.GetPackagesAsync("framework");
_package = packages.FirstOrDefault();
if (_package != null)
try
{
_upgradeavailable = (Version.Parse(_package.Version).CompareTo(Version.Parse(Constants.Version)) > 0);
List<Package> packages = await PackageService.GetPackagesAsync("framework", "", "", "");
if (packages != null)
{
_package = packages.Where(item => item.PackageId.StartsWith(Constants.PackageId)).FirstOrDefault();
if (_package != null)
{
_upgradeavailable = (Version.Parse(_package.Version).CompareTo(Version.Parse(Constants.Version)) > 0);
}
else
{
_package = new Package { Name = Constants.PackageId, Version = Constants.Version };
}
}
}
else
catch
{
_package = new Package { Name = Constants.PackageId, Version = Constants.Version };
// can be caused by no network connection
}
}
private async Task Upgrade()
{
await InstallationService.Upgrade();
NavigationManager.NavigateTo(NavigateUrl());
try
{
AddModuleMessage(Localizer["Info.Upgrade.Wait"], MessageType.Info);
ShowProgressIndicator();
var interop = new Interop(JSRuntime);
await interop.RedirectBrowser(NavigateUrl(), 10);
await InstallationService.Upgrade();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Executing Upgrade {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Upgrade.Execute"], MessageType.Error);
}
}
private async Task Download(string packageid, string version)
{
await PackageService.DownloadPackageAsync(packageid, version, "Framework");
await InstallationService.Upgrade();
NavigationManager.NavigateTo(NavigateUrl());
try
{
await PackageService.DownloadPackageAsync(packageid, version, Constants.PackagesFolder);
await PackageService.DownloadPackageAsync(Constants.UpdaterPackageId, version, Constants.PackagesFolder);
AddModuleMessage(Localizer["Success.Framework.Download"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Downloading Framework Package {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Framework.Download"], MessageType.Error);
}
}
}

View File

@ -0,0 +1,89 @@
@namespace Oqtane.Modules.Admin.UrlMappings
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUrlMappingService UrlMappingService
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="The fully qualified Url for this site" ResourceKey="Url">Url:</Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" maxlength="500" required />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="mappedurl" HelpText="A fully qualified Url where the user will be redirected" ResourceKey="MappedUrl">Redirect To:</Label>
<div class="col-sm-9">
<input id="mappedurl" class="form-control" @bind="@_mappedurl" maxlength="500" required />
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveUrlMapping">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</div>
</form>
@code {
private ElementReference form;
private bool validated = false;
private string _url = string.Empty;
private string _mappedurl = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
private async Task SaveUrlMapping()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (_url != _mappedurl)
{
var url = PageState.Uri.Scheme + "://" + PageState.Uri.Authority + "/";
url = url + (!string.IsNullOrEmpty(PageState.Alias.Path) ? PageState.Alias.Path + "/" : "");
_url = (_url.StartsWith("/")) ? _url.Substring(1) : _url;
_url = (!_url.StartsWith("http")) ? url + _url : _url;
if (_url.StartsWith(url))
{
var urlmapping = new UrlMapping();
urlmapping.SiteId = PageState.Site.SiteId;
var route = new Route(_url, PageState.Alias.Path);
urlmapping.Url = route.PagePath;
urlmapping.MappedUrl = _mappedurl.Replace(url, "");
urlmapping.Requests = 0;
urlmapping.CreatedOn = DateTime.UtcNow;
urlmapping.RequestedOn = DateTime.UtcNow;
try
{
urlmapping = await UrlMappingService.AddUrlMappingAsync(urlmapping);
await logger.LogInformation("UrlMapping Saved {UrlMapping}", urlmapping);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving UrlMapping {UrlMapping} {Error}", urlmapping, ex.Message);
AddModuleMessage(Localizer["Error.SaveUrlMapping"], MessageType.Error);
}
}
else
{
AddModuleMessage(Localizer["Message.SaveUrlMapping"], MessageType.Warning);
}
}
else
{
AddModuleMessage(Localizer["Message.DuplicateUrlMapping"], MessageType.Warning);
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -0,0 +1,92 @@
@namespace Oqtane.Modules.Admin.UrlMappings
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUrlMappingService UrlMappingService
@inject IStringLocalizer<Edit> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<form @ref="form" class="@(validated ? "was-validated" : "needs-validation")" novalidate>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="url" HelpText="A fully qualified Url for this site" ResourceKey="Url">Url:</Label>
<div class="col-sm-9">
<input id="url" class="form-control" @bind="@_url" maxlength="500" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="mappedurl" HelpText="A fully qualified Url where the user will be redirected" ResourceKey="MappedUrl">Redirect To:</Label>
<div class="col-sm-9">
<input id="mappedurl" class="form-control" @bind="@_mappedurl" maxlength="500" required />
</div>
</div>
<br /><br />
<button type="button" class="btn btn-success" @onclick="SaveUrlMapping">@SharedLocalizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
</div>
</form>
@code {
private ElementReference form;
private bool validated = false;
private int _urlmappingid;
private string _url = string.Empty;
private string _mappedurl = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override async Task OnInitializedAsync()
{
try
{
_urlmappingid = Int32.Parse(PageState.QueryString["id"]);
var urlmapping = await UrlMappingService.GetUrlMappingAsync(_urlmappingid);
if (urlmapping != null)
{
_url = urlmapping.Url;
_mappedurl = urlmapping.MappedUrl;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading UrlMapping {UrlMappingId} {Error}", _urlmappingid, ex.Message);
AddModuleMessage(Localizer["Error.LoadUrlMapping"], MessageType.Error);
}
}
private async Task SaveUrlMapping()
{
validated = true;
var interop = new Interop(JSRuntime);
if (await interop.FormValid(form))
{
if (_url != _mappedurl)
{
try
{
var url = PageState.Uri.Scheme + "://" + PageState.Uri.Authority + "/";
url = url + (!string.IsNullOrEmpty(PageState.Alias.Path) ? PageState.Alias.Path + "/" : "");
var urlmapping = await UrlMappingService.GetUrlMappingAsync(_urlmappingid);
urlmapping.MappedUrl = _mappedurl.Replace(url, "");
urlmapping = await UrlMappingService.UpdateUrlMappingAsync(urlmapping);
await logger.LogInformation("UrlMapping Saved {UrlMapping}", urlmapping);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving UrlMapping {UrlMappingId} {Error}", _urlmappingid, ex.Message);
AddModuleMessage(Localizer["Error.SaveUrlMapping"], MessageType.Error);
}
}
else
{
AddModuleMessage(Localizer["Message.DuplicateUrlMapping"], MessageType.Warning);
}
}
else
{
AddModuleMessage(SharedLocalizer["Message.InfoRequired"], MessageType.Warning);
}
}
}

View File

@ -0,0 +1,135 @@
@namespace Oqtane.Modules.Admin.UrlMappings
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUrlMappingService UrlMappingService
@inject ISiteService SiteService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (_urlMappings == null)
{
<p><em>@SharedLocalizer["Loading"]</em></p>
}
else
{
<TabStrip>
<TabPanel Name="Urls" Heading="Urls" ResourceKey="Urls">
<div class="container">
<div class="row mb-1 align-items-center">
<div class="col-sm-6">
<ActionLink Action="Add" Text="Add Url Mapping" ResourceKey="AddUrlMapping" />
</div>
<div class="col-sm-6">
<select id="type" class="form-select custom-select" @onchange="(e => MappedChanged(e))">
<option value="true">@Localizer["Mapped"]</option>
<option value="false">@Localizer["Broken"]</option>
</select>
</div>
</div>
</div>
<br/>
<Pager Items="@_urlMappings">
<Header>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@Localizer["Url"]</th>
<th>@Localizer["Requests"]</th>
<th>@Localizer["Requested"]</th>
</Header>
<Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.UrlMappingId.ToString())" ResourceKey="Edit" /></td>
<td><ActionDialog Header="Delete Url Mapping" Message="@string.Format(Localizer["Confirm.DeleteUrlMapping"], context.Url)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUrlMapping(context))" ResourceKey="DeleteUrlMapping" /></td>
<td>
<a href="@Utilities.TenantUrl(PageState.Alias, context.Url)">@context.Url</a>
@if (_mapped)
{
@((MarkupString)"<br />&gt;&gt;&nbsp;")<a href="@((context.MappedUrl.StartsWith("http") ? context.MappedUrl : Utilities.TenantUrl(PageState.Alias, context.MappedUrl)))">@context.MappedUrl</a>
}
</td>
<td>@context.Requests</td>
<td>@context.RequestedOn</td>
</Row>
</Pager>
</TabPanel>
<TabPanel Name="Settings" Heading="Settings" ResourceKey="Settings">
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="capturebrokenurls" HelpText="Specify if broken Urls should be captured automatically and saved in Url Mappings" ResourceKey="CaptureBrokenUrls">Capture Broken Urls? </Label>
<div class="col-sm-9">
<select id="capturebrokenurls" class="form-select" @bind="@_capturebrokenurls" >
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
</div>
<br />
<button type="button" class="btn btn-success" @onclick="SaveSiteSettings">@SharedLocalizer["Save"]</button>
</TabPanel>
</TabStrip>
}
@code {
private bool _mapped = true;
private List<UrlMapping> _urlMappings;
private string _capturebrokenurls;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;
protected override async Task OnParametersSetAsync()
{
await GetUrlMappings();
_capturebrokenurls = PageState.Site.CaptureBrokenUrls.ToString();
}
private async void MappedChanged(ChangeEventArgs e)
{
try
{
_mapped = bool.Parse(e.Value.ToString());
await GetUrlMappings();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error On TypeChanged");
}
}
private async Task DeleteUrlMapping(UrlMapping urlMapping)
{
try
{
await UrlMappingService.DeleteUrlMappingAsync(urlMapping.UrlMappingId);
await logger.LogInformation("UrlMapping Deleted {UrlMapping}", urlMapping);
await GetUrlMappings();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting UrlMapping {UrlMapping} {Error}", urlMapping, ex.Message);
AddModuleMessage(Localizer["Error.DeleteUrlMapping"], MessageType.Error);
}
}
private async Task GetUrlMappings()
{
_urlMappings = await UrlMappingService.GetUrlMappingsAsync(PageState.Site.SiteId, _mapped);
}
private async Task SaveSiteSettings()
{
try
{
var site = PageState.Site;
site.CaptureBrokenUrls = bool.Parse(_capturebrokenurls);
await SiteService.UpdateSiteAsync(site);
AddModuleMessage(Localizer["Success.SaveSiteSettings"], MessageType.Success);
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving Site Settings {Error}", ex.Message);
AddModuleMessage(Localizer["Error.SaveSiteSettings"], MessageType.Error);
}
}
}

View File

@ -1,101 +1,69 @@
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserRoleService UserRoleService
@inject INotificationService NotificationService
@if (PageState.User != null)
{
<table class="table table-borderless">
<tr>
<td>
<Label For="to" HelpText="Select the user it is going to">To: </Label>
</td>
<td>
<select id="to" class="form-control" @bind="@userid">
<option value="-1">&lt;Select User&gt;</option>
@if (userroles != null)
{
foreach (UserRole userrole in userroles)
{
<option value="@userrole.UserId">@userrole.User.DisplayName</option>
}
}
</select>
</td>
</tr>
<tr>
<td>
<Label For="subject" HelpText="Enter the subject of the message">Subject: </Label>
</td>
<td>
<input id="subject" class="form-control" @bind="@subject" />
</td>
</tr>
<tr>
<td>
<Label For="message" HelpText="Enter the message">Message: </Label>
</td>
<td>
<textarea id="message" class="form-control" @bind="@body" rows="5" />
</td>
</tr>
</table>
<button type="button" class="btn btn-primary" @onclick="Send">Send</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
}
@code {
private List<UserRole> userroles;
private string userid = "-1";
private string subject = "";
private string body = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
public override string Title => "Send Notification";
protected override async Task OnInitializedAsync()
{
try
{
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
userroles = userroles.Where(item => item.Role.Name == Constants.RegisteredRole || item.Role.Name == Constants.HostRole)
.OrderBy(item => item.User.DisplayName).ToList();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Users {Error}", ex.Message);
AddModuleMessage("Error Loading Users", MessageType.Error);
}
}
private async Task Send()
{
var notification = new Notification();
try
{
notification.SiteId = PageState.Site.SiteId;
notification.FromUserId = PageState.User.UserId;
notification.ToUserId = int.Parse(userid);
notification.ToEmail = "";
notification.Subject = subject;
notification.Body = body;
notification.ParentId = null;
notification.CreatedOn = DateTime.UtcNow;
notification.IsDelivered = false;
notification.DeliveredOn = null;
notification = await NotificationService.AddNotificationAsync(notification);
await logger.LogInformation("Notification Created {Notification}", notification);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Notification {Notification} {Error}", notification, ex.Message);
AddModuleMessage("Error Adding Notification", MessageType.Error);
}
}
}
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject INotificationService NotificationService
@inject IStringLocalizer<Add> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (PageState.User != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="to" HelpText="Enter the username you wish to send a message to" ResourceKey="To">To: </Label>
<div class="col-sm-9">
<input id="to" class="form-control" @bind="@username" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="subject" HelpText="Enter the subject of the message" ResourceKey="Subject">Subject: </Label>
<div class="col-sm-9">
<input id="subject" class="form-control" @bind="@subject" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="message" HelpText="Enter the message" ResourceKey="Message">Message: </Label>
<div class="col-sm-9">
<textarea id="message" class="form-control" @bind="@body" rows="5" />
</div>
</div>
</div>
<br/>
<button type="button" class="btn btn-primary" @onclick="Send">@SharedLocalizer["Send"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
}
@code {
private string username = "";
private string subject = "";
private string body = "";
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
public override string Title => "Send Notification";
private async Task Send()
{
try
{
var user = await UserService.GetUserAsync(username, PageState.Site.SiteId);
if (user != null)
{
var notification = new Notification(PageState.Site.SiteId, PageState.User, user, subject, body);
notification = await NotificationService.AddNotificationAsync(notification);
await logger.LogInformation("Notification Created {NotificationId}", notification.NotificationId);
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage(Localizer["Message.User.Invalid"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Notification {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Notification.Add"], MessageType.Error);
}
}
}

View File

@ -1,132 +1,180 @@
@namespace Oqtane.Modules.Admin.UserProfile
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject IProfileService ProfileService
@inject ISettingService SettingService
@inject INotificationService NotificationService
@inject IFileService FileService
@inject IFolderService FolderService
@inject IStringLocalizer<Index> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (PageState.User != null && photofileid != -1)
@if (PageState.User != null && photo != null)
{
<img src="@(ContentUrl(photofileid))" alt="@displayname" style="max-width: 400px" class="rounded-circle mx-auto d-block">
<img src="@ImageUrl(photofileid, 400, 400)" alt="@displayname" style="max-width: 400px" class="rounded-circle mx-auto d-block">
}
else
{
<br />
}
<TabStrip>
<TabPanel Name="Identity">
@if (PageState.User != null)
<TabPanel Name="Identity" ResourceKey="Identity">
@if (profiles != null && settings != null)
{
<table class="table table-borderless">
<tr>
<td>
<label for="Name" class="control-label">Username: </label>
</td>
<td>
<input class="form-control" @bind="@username" readonly />
</td>
</tr>
<tr>
<td>
<label for="Name" class="control-label">Password: </label>
</td>
<td>
<input type="password" class="form-control" @bind="@password" />
</td>
</tr>
<tr>
<td>
<label for="Name" class="control-label">Confirm Password: </label>
</td>
<td>
<input type="password" class="form-control" @bind="@confirm" />
</td>
</tr>
<tr>
<td>
<label for="Name" class="control-label">Email: </label>
</td>
<td>
<input class="form-control" @bind="@email" />
</td>
</tr>
<tr>
<td>
<label for="Name" class="control-label">Full Name: </label>
</td>
<td>
<input class="form-control" @bind="@displayname" />
</td>
</tr>
<tr>
<td>
<label for="Name" class="control-label">Photo: </label>
</td>
<td>
<FileManager FileId="@photofileid.ToString()" @ref="filemanager" />
</td>
</tr>
</table>
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="username" HelpText="Your username. Note that this field can not be modified." ResourceKey="Username"></Label>
<div class="col-sm-9">
<input id="username" class="form-control" @bind="@username" readonly />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="password" HelpText="If you wish to change your password you can enter it here. Please choose a sufficiently secure password." ResourceKey="Password"></Label>
<div class="col-sm-9">
<div class="input-group">
<input id="password" type="@_passwordtype" class="form-control" @bind="@_password" autocomplete="new-password" />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="confirm" HelpText="If you are changing your password you must enter it again to confirm it matches" ResourceKey="Confirm"></Label>
<div class="col-sm-9">
<div class="input-group">
<input id="confirm" type="@_passwordtype" class="form-control" @bind="@confirm" autocomplete="new-password" />
<button type="button" class="btn btn-secondary" @onclick="@TogglePassword">@_togglepassword</button>
</div>
</div>
</div>
@if (allowtwofactor)
{
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="twofactor" HelpText="Indicates if you are using two factor authentication. Two factor authentication requires you to enter a verification code sent via email after you sign in." ResourceKey="TwoFactor"></Label>
<div class="col-sm-9">
<select id="twofactor" class="form-select" @bind="@twofactor" required>
<option value="True">@SharedLocalizer["Yes"]</option>
<option value="False">@SharedLocalizer["No"]</option>
</select>
</div>
</div>
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="email" HelpText="Your email address where you wish to receive notifications" ResourceKey="Email"></Label>
<div class="col-sm-9">
<input id="email" class="form-control" @bind="@email" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="displayname" HelpText="Your full name" ResourceKey="DisplayName"></Label>
<div class="col-sm-9">
<input id="displayname" class="form-control" @bind="@displayname" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="@photofileid.ToString()" HelpText="A photo of yourself" ResourceKey="Photo"></Label>
<div class="col-sm-9">
<FileManager FileId="@photofileid" Filter="@Constants.ImageFiles" ShowFolders="false" ShowFiles="true" UploadMultiple="false" FolderId="@folderid" @ref="filemanager" />
</div>
</div>
</div>
<br />
<button type="button" class="btn btn-success" @onclick="Save">@SharedLocalizer["Save"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
}
</TabPanel>
<TabPanel Name="Profile">
@if (profiles != null)
<TabPanel Name="Profile" ResourceKey="Profile">
@if (profiles != null && settings != null)
{
<table class="table table-borderless">
@foreach (Profile profile in profiles)
{
var p = profile;
if (p.Category != category)
<div class="container">
<div class="row mb-1 align-items-center">
@foreach (Profile profile in profiles)
{
<tr>
<th colspan="2" style="text-align: center;">
@p.Category
</th>
</tr>
category = p.Category;
var p = profile;
if (!p.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
if (p.Category != category)
{
<div class="col text-center pb-2">
@p.Category
</div>
category = p.Category;
}
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="@p.Name" HelpText="@p.Description">@p.Title</Label>
<div class="col-sm-9">
@if (!string.IsNullOrEmpty(p.Options))
{
<select id="@p.Name" class="form-select" @onchange="@(e => ProfileChanged(e, p.Name))">
@foreach (var option in p.Options.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
@if (GetProfileValue(p.Name, "") == option || (GetProfileValue(p.Name, "") == "" && p.DefaultValue == option))
{
<option value="@option" selected>@option</option>
}
else
{
<option value="@option">@option</option>
}
}
</select>
}
else
{
@if (p.IsRequired)
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
}
else
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
}
}
</div>
</div>
}
}
<tr>
<td>
<label for="@p.Name" class="control-label">@p.Title: </label>
</td>
<td>
<input class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" placeholder="@p.Description" @onchange="@(e => ProfileChanged(e, p.Name))" />
</td>
</tr>
}
</table>
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
</div>
</div>
<button type="button" class="btn btn-success" @onclick="Save">@SharedLocalizer["Save"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
}
</TabPanel>
<TabPanel Name="Notifications">
<TabPanel Name="Notifications" ResourceKey="Notifications">
@if (notifications != null)
{
<ActionLink Action="Add" Text="Send Notification" Security="SecurityAccessLevel.View" EditMode="false" />
<ActionLink Action="Add" Text="Send Notification" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="SendNotification" />
<br /><br />
@if (filter == "to")
{
<Pager Items="@notifications">
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>From</th>
<th>Subject</th>
<th>Received</th>
<th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th>
<th>@Localizer["From"]</th>
<th>@Localizer["Subject"]</th>
<th>@Localizer["Received"]</th>
</Header>
<Row>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" /></td>
<td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" /></td>
<td>@(context.FromUser == null ? "System" : context.FromUser.DisplayName)</td>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="ViewNotification" /></td>
<td><ActionDialog Header="Delete Notification" Message="Are You Sure You Wish To Delete This Notification?" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" ResourceKey="DeleteNotification" /></td>
<td>@context.FromDisplayName</td>
<td>@context.Subject</td>
<td>@context.CreatedOn</td>
<td>@string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn)</td>
</Row>
<Detail>
<td colspan="2"></td>
<td colspan="3">@(context.Body.Length > 100 ? context.Body.Substring(0, 100) : context.Body)</td>
<td colspan="3">
@{
string input = "___";
if (context.Body.Contains(input))
{
context.Body = context.Body.Split(input)[0];
context.Body = context.Body.Replace("\n", "");
context.Body = context.Body.Replace("\r", "");
} }
@(context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body)
</td>
</Detail>
</Pager>
}
@ -136,40 +184,59 @@ else
<Header>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>To</th>
<th>Subject</th>
<th>Sent</th>
<th>@Localizer["To"]</th>
<th>@Localizer["Subject"]</th>
<th>@Localizer["Sent"]</th>
</Header>
<Row>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" /></td>
<td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" /></td>
<td>@(context.ToUser == null ? context.ToEmail : context.ToUser.DisplayName)</td>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="ViewNotification" /></td>
<td><ActionDialog Header="Delete Notification" Message="Are You Sure You Wish To Delete This Notification?" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" ResourceKey="DeleteNotification" /></td>
<td>@context.ToDisplayName</td>
<td>@context.Subject</td>
<td>@context.CreatedOn</td>
<td>@string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn)</td>
</Row>
<Detail>
<td colspan="2"></td>
<td colspan="3">@(context.Body.Length > 100 ? context.Body.Substring(0, 100) : context.Body)</td>
<td colspan="3">
@{
string input = "___";
if (context.Body.Contains(input))
{
context.Body = context.Body.Split(input)[0];
context.Body = context.Body.Replace("\n", "");
context.Body = context.Body.Replace("\r", "");
} }
@(context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body)
</td>
</Detail>
</Pager>
}
<br />
<ActionDialog Header="Clear Notifications" Message="Are You Sure You Wish To Permanently Delete All Notifications ?" Action="Delete All Notifications" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteAllNotifications())" ResourceKey="DeleteAllNotifications" />
<br /><hr />
<select class="form-control" @onchange="(e => FilterChanged(e))">
<option value="to">Inbox</option>
<option value="from">Sent Items</option>
<select class="form-select" @onchange="(e => FilterChanged(e))">
<option value="to">@Localizer["Inbox"]</option>
<option value="from">@Localizer["Items.Sent"]</option>
</select>
}
</TabPanel>
</TabStrip>
<br /><br />
@code {
private string username = string.Empty;
private string password = string.Empty;
private string _password = string.Empty;
private string _passwordtype = "password";
private string _togglepassword = string.Empty;
private string confirm = string.Empty;
private bool allowtwofactor = false;
private string twofactor = "False";
private string email = string.Empty;
private string displayname = string.Empty;
private FileManager filemanager;
private int folderid = -1;
private int photofileid = -1;
private File photo = null;
private List<Profile> profiles;
private Dictionary<string, string> settings;
private string category = string.Empty;
@ -178,19 +245,40 @@ else
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
protected override async Task OnInitializedAsync()
protected override async Task OnParametersSetAsync()
{
try
{
_togglepassword = SharedLocalizer["ShowPassword"];
if (PageState.Site.Settings.ContainsKey("LoginOptions:TwoFactor") && !string.IsNullOrEmpty(PageState.Site.Settings["LoginOptions:TwoFactor"]))
{
allowtwofactor = (PageState.Site.Settings["LoginOptions:TwoFactor"] == "true");
}
if (PageState.User != null)
{
username = PageState.User.Username;
twofactor = PageState.User.TwoFactorRequired.ToString();
email = PageState.User.Email;
displayname = PageState.User.DisplayName;
// get user folder
var folder = await FolderService.GetFolderAsync(ModuleState.SiteId, PageState.User.FolderPath);
if (folder != null)
{
folderid = folder.FolderId;
}
if (PageState.User.PhotoFileId != null)
{
photofileid = PageState.User.PhotoFileId.Value;
photo = await FileService.GetFileAsync(photofileid);
}
else
{
photofileid = -1;
photo = null;
}
profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId);
@ -200,13 +288,13 @@ else
}
else
{
AddModuleMessage("Current User Is Not Logged In", MessageType.Warning);
AddModuleMessage(Localizer["Message.User.NoLogIn"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading User Profile {Error}", ex.Message);
AddModuleMessage("Error Loading User Profile", MessageType.Error);
AddModuleMessage(Localizer["Error.Profile.Load"], MessageType.Error);
}
}
@ -223,44 +311,76 @@ else
{
try
{
if (username != string.Empty && email != string.Empty)
if (username != string.Empty && email != string.Empty && ValidateProfiles())
{
if (password == confirm)
if (_password == confirm)
{
var user = PageState.User;
user.Username = username;
user.Password = password;
user.Password = _password;
user.TwoFactorRequired = bool.Parse(twofactor);
user.Email = email;
user.DisplayName = (displayname == string.Empty ? username : displayname);
user.PhotoFileId = null;
photofileid = filemanager.GetFileId();
if (photofileid != -1)
user.PhotoFileId = filemanager.GetFileId();
if (user.PhotoFileId == -1)
{
user.PhotoFileId = photofileid;
user.PhotoFileId = null;
}
if (user.PhotoFileId != null)
{
photofileid = user.PhotoFileId.Value;
photo = await FileService.GetFileAsync(photofileid);
}
else
{
photofileid = -1;
photo = null;
}
await UserService.UpdateUserAsync(user);
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
await logger.LogInformation("User Profile Saved");
AddModuleMessage(Localizer["Success.Profile.Update"], MessageType.Success);
StateHasChanged();
}
else
{
AddModuleMessage("Passwords Entered Do Not Match", MessageType.Warning);
AddModuleMessage(Localizer["Message.Password.Invalid"], MessageType.Warning);
}
}
else
{
AddModuleMessage("You Must Provide A Username and Email Address", MessageType.Warning);
AddModuleMessage(Localizer["Message.Required.ProfileInfo"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Saving User Profile {Error}", ex.Message);
AddModuleMessage("Error Saving User Profile", MessageType.Error);
AddModuleMessage(Localizer["Error.Profile.Save"], MessageType.Error);
}
}
private bool ValidateProfiles()
{
bool valid = true;
foreach (Profile profile in profiles)
{
if (string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)) && !string.IsNullOrEmpty(profile.DefaultValue))
{
settings = SettingService.SetSetting(settings, profile.Name, profile.DefaultValue);
}
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
{
if (profile.IsRequired && string.IsNullOrEmpty(SettingService.GetSetting(settings, profile.Name, string.Empty)))
{
valid = false;
}
}
}
return valid;
}
private void Cancel()
{
NavigationManager.NavigateTo(NavigateUrl(string.Empty));
@ -305,4 +425,51 @@ else
StateHasChanged();
}
private async Task DeleteAllNotifications()
{
try
{
ModuleInstance.ShowProgressIndicator();
foreach(var Notification in notifications)
{
if (!Notification.IsDeleted)
{
Notification.IsDeleted = true;
await NotificationService.UpdateNotificationAsync(Notification);
}
else
{
await NotificationService.DeleteNotificationAsync(Notification.NotificationId);
}
await logger.LogInformation("Notification Deleted {Notification}", Notification);
}
await logger.LogInformation("Notifications Permanently Deleted");
await LoadNotificationsAsync();
ModuleInstance.HideProgressIndicator();
StateHasChanged();
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Deleting Notifications {Error}", ex.Message);
AddModuleMessage(ex.Message, MessageType.Error);
ModuleInstance.HideProgressIndicator();
}
}
private void TogglePassword()
{
if (_passwordtype == "password")
{
_passwordtype = "text";
_togglepassword = SharedLocalizer["HidePassword"];
}
else
{
_passwordtype = "password";
_togglepassword = SharedLocalizer["ShowPassword"];
}
}
}

View File

@ -1,162 +1,198 @@
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserRoleService UserRoleService
@inject INotificationService NotificationService
@if (PageState.User != null)
{
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">@title: </label>
</td>
<td>
<select class="form-control" readonly @bind="userid">
<option value="-1">&lt;System&gt;</option>
@if (userroles != null)
{
foreach (UserRole userrole in userroles)
{
<option value="@userrole.UserId">@userrole.User.DisplayName</option>
}
}
</select>
</td>
</tr>
<tr>
<td>
<label class="control-label">Subject: </label>
</td>
<td>
<input class="form-control" @bind="@subject" />
</td>
</tr>
@if (title == "From")
{
<tr>
<td>
<label class="control-label">Date: </label>
</td>
<td>
<input class="form-control" @bind="@createdon" />
</td>
</tr>
}
<tr>
<td>
<label class="control-label">Message: </label>
</td>
<td>
<textarea class="form-control" @bind="@body" rows="5" />
</td>
</tr>
</table>
@if (reply != string.Empty)
{
<button type="button" class="btn btn-primary" @onclick="Send">Send</button>
}
else
{
if (title == "From")
{
<button type="button" class="btn btn-primary" @onclick="Reply">Reply</button>
}
}
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br />
<br />
<p>@reply</p>
}
@code {
private int notificationid;
private string title = string.Empty;
private List<UserRole> userroles;
private string userid = "-1";
private string subject = string.Empty;
private string createdon = string.Empty;
private string body = string.Empty;
private string reply = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
public override string Title => "View Notification";
protected override async Task OnInitializedAsync()
{
try
{
userroles = await UserRoleService.GetUserRolesAsync(PageState.Site.SiteId);
userroles = userroles.Where(item => item.Role.Name == Constants.RegisteredRole || item.Role.Name == Constants.HostRole)
.OrderBy(item => item.User.DisplayName).ToList();
notificationid = Int32.Parse(PageState.QueryString["id"]);
Notification notification = await NotificationService.GetNotificationAsync(notificationid);
if (notification != null)
{
if (notification.ToUserId == PageState.User.UserId)
{
title = "From";
if (notification.FromUserId != null)
{
userid = notification.FromUserId.ToString();
}
}
else
{
title = "To";
if (notification.ToUserId != null)
{
userid = notification.ToUserId.ToString();
}
}
subject = notification.Subject;
createdon = notification.CreatedOn.ToString();
body = notification.Body;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Users {Error}", ex.Message);
AddModuleMessage("Error Loading Users", MessageType.Error);
}
}
private void Reply()
{
title = "To";
subject = "RE: " + subject;
reply = body;
StateHasChanged();
}
private async Task Send()
{
var notification = new Notification();
notification.SiteId = PageState.Site.SiteId;
notification.FromUserId = PageState.User.UserId;
notification.ToUserId = int.Parse(userid);
notification.ToEmail = string.Empty;
notification.Subject = subject;
notification.Body = body;
notification.ParentId = notificationid;
notification.CreatedOn = DateTime.UtcNow;
notification.IsDelivered = false;
notification.DeliveredOn = null;
try
{
notification = await NotificationService.AddNotificationAsync(notification);
await logger.LogInformation("Notification Created {Notification}", notification);
NavigationManager.NavigateTo(NavigateUrl());
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Notification {Notification} {Error}", notification, ex.Message);
AddModuleMessage("Error Adding Notification", MessageType.Error);
}
}
}
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject INotificationService NotificationService
@inject IStringLocalizer<View> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
@if (PageState.User != null)
{
<div class="container">
<div class="row mb-1 align-items-center">
<label Class="col-sm-3">@Localizer["Title"] </label>
@if (title == "From")
{
<div class="col-sm-3">
<input class="form-control" @bind="@username" readonly />
</div>
}
@if (title == "To")
{
<div class="col-sm-3">
<input class="form-control" @bind="@username" />
</div>
}
</div>
<div class="row mb-1 align-items-center">
<label Class="col-sm-3">@Localizer["Subject"] </label>
@if (title == "From")
{
<div class="col-sm-3">
<input class="form-control" @bind="@subject" readonly />
</div>
}
@if (title == "To")
{
<div class="col-sm-3">
<input class="form-control" @bind="@subject" />
</div>
}
</div>
</div>
<div class="container">
@if (title == "From")
{
<div class="row mb-1 align-items-center">
<label class="col-sm-3">@Localizer["Date"] </label>
<div class="col-sm-9">
<input class="form-control" @bind="@createdon" readonly />
</div>
</div>
}
@if (title == "From")
{
<div class="row mb-1 align-items-center">
<label class="col-sm-3">@Localizer["Message"] </label>
<div class="col-sm-9">
<textarea class="form-control" @bind="@body" rows="5" readonly />
</div>
</div>
}
@if (title == "To")
{
<div class="row mb-1 align-items-center">
<label class="col-sm-3">@Localizer["Message"] </label>
<div class="col-sm-9">
<textarea class="form-control" @bind="@body" rows="5" readonly />
</div>
</div>
}
</div>
@if (reply != string.Empty)
{
<button type="button" class="btn btn-primary" @onclick="Send">@SharedLocalizer["Send"]</button>
}
else
{
if (title == "From")
{
<button type="button" class="btn btn-primary" @onclick="Reply">@Localizer["Reply"]</button>
}
}
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink>
<br />
<br />
@if (title == "To")
{
<div class="control-group">
<label class="control-label">@Localizer["OriginalMessage"] </label>
<textarea class="form-control" @bind="@reply" rows="5" readonly />
</div>
}
}
@code {
private int notificationid;
private string title = string.Empty;
private string username = "";
private string subject = string.Empty;
private string createdon = string.Empty;
private string body = string.Empty;
private string reply = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View;
public override string Title => "View Notification";
protected override async Task OnInitializedAsync()
{
try
{
notificationid = Int32.Parse(PageState.QueryString["id"]);
Notification notification = await NotificationService.GetNotificationAsync(notificationid);
if (notification != null)
{
int userid = -1;
if (notification.ToUserId == PageState.User.UserId)
{
title = "From";
if (notification.FromUserId != null)
{
userid = notification.FromUserId.Value;
}
}
else
{
title = "To";
if (notification.ToUserId != null)
{
userid = notification.ToUserId.Value;
}
}
if (userid != -1)
{
var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId);
if (user != null)
{
username = user.Username;
}
}
if (username == "")
{
username = "System";
}
subject = notification.Subject;
createdon = notification.CreatedOn.ToString();
body = notification.Body;
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Loading Users {Error}", ex.Message);
AddModuleMessage(Localizer["Error.User.Load"], MessageType.Error);
}
}
private void Reply()
{
title = "To";
if (!subject.Contains("RE:"))
{
subject = "RE: " + subject;
}
reply = body;
body = "\n\n____________________________________________\nSent: " + createdon + "\nSubject: " + subject + "\n\n" + body;
StateHasChanged();
}
private async Task Send()
{
try
{
var user = await UserService.GetUserAsync(username, PageState.Site.SiteId);
if (user != null)
{
var notification = new Notification(PageState.Site.SiteId, PageState.User, user, subject, body, notificationid);
notification = await NotificationService.AddNotificationAsync(notification);
await logger.LogInformation("Notification Created {NotificationId}", notification.NotificationId);
NavigationManager.NavigateTo(NavigateUrl());
}
else
{
AddModuleMessage(Localizer["Message.User.Invalid"], MessageType.Warning);
}
}
catch (Exception ex)
{
await logger.LogError(ex, "Error Adding Notification {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Notification.Add"], MessageType.Error);
}
}
}

Some files were not shown because too many files have changed in this diff Show More