+ Welcome to SilverLabs
+Your Innovation Gateway
+ + +diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba39fdc --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# .NET Build artifacts +BlazorApp/bin/ +BlazorApp/obj/ +BlazorApp/.vs/ + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio cache/options directory +.vs/ + +# Rider +.idea/ + +# Backup folder +old-static-site/ + +# OS Files +.DS_Store +Thumbs.db diff --git a/BlazorApp/Components/App.razor b/BlazorApp/Components/App.razor new file mode 100644 index 0000000..fddf7ed --- /dev/null +++ b/BlazorApp/Components/App.razor @@ -0,0 +1,20 @@ + + + +
+ + +Current count: @currentCount
+ + + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/BlazorApp/Components/Pages/Error.razor b/BlazorApp/Components/Pages/Error.razor new file mode 100644 index 0000000..7a84043 --- /dev/null +++ b/BlazorApp/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +
+ Request ID: @RequestId
+
+ Swapping to Development environment will display more detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/BlazorApp/Components/Pages/Home.razor b/BlazorApp/Components/Pages/Home.razor new file mode 100644 index 0000000..49c5025 --- /dev/null +++ b/BlazorApp/Components/Pages/Home.razor @@ -0,0 +1,66 @@ +@page "/" + +
+ Your Innovation Gateway
+ + +
+ Build modular Blazor WebAssembly applications with ease
+Get started with SilverSHELL in just a few minutes. Follow these simple steps:
+ +dotnet new install ./path/to/SilverSHELL.Starter.Template
+dotnet new install ./path/to/SilverSHELL.AppModule.Templatedotnet new silvershell-starter -n MyApp --pwa true --module-repository true
+cd MyApp
+dotnet runhttps://localhost:5001
+ Download the SilverSHELL project templates to get started:
+ +Create a new SilverSHELL application with minimal configuration
+Size: 6.7 KB
+Includes: Blazor WebAssembly setup, module loading, PWA support
+ + Download Starter Template + +Create reusable SilverSHELL modules with best practices
+Size: 17 KB
+Includes: Module structure, configuration, CI/CD templates
+ + Download Module Template + +# Create a new application
+dotnet new silvershell-starter -n MyAwesomeApp
+
+# With PWA support
+dotnet new silvershell-starter -n MyAwesomeApp --pwa true
+
+# With Module Repository integration
+dotnet new silvershell-starter -n MyAwesomeApp --module-repository trueSilverSHELL supports multiple ways to add modules to your application:
+ +Edit wwwroot/appsettings.json:
{
+ "AMS": {
+ "Deployment": {
+ "PreloadModules": [
+ "SilverLabs.SilverSHELL.Auth.Login",
+ "SilverSHELL.Modules.ModuleBrowser"
+ ]
+ }
+ }
+}/modules/browse in your application# Copy module DLLs to the modules directory
+cp SomeModule.dll wwwroot/modules/
+dotnet run
+# Module is automatically discovered and loaded!# Create a basic module
+dotnet new silvershell-module -n MyModule
+
+# Create a module with widgets
+dotnet new silvershell-module -n MyModule --includeWidgets true
+
+# Create a module with search provider
+dotnet new silvershell-module -n MyModule --includeSearchProvider true
+
+# Create a module with everything
+dotnet new silvershell-module -n MyModule \
+ --includeWidgets true \
+ --includeSearchProvider true \
+ --includeTests trueThe template creates an organized structure:
+MyModule/
+├── Configuration/
+│ ├── ModuleMetadata.cs # Module identity and version
+│ ├── EndpointConfiguration.cs # Navigation routes
+│ └── WidgetConfiguration.cs # Dashboard widgets
+├── Pages/
+│ └── Index.razor # Razor pages
+├── Components/
+│ └── ... # Razor components
+├── .gitlab-ci.yml # GitLab CI/CD
+├── .github/workflows/
+│ └── publish.yml # GitHub Actions
+└── MyModuleMain.cs # Module entry pointThe templates include CI/CD pipelines for automatic publishing:
+ +# In GitLab: Settings > CI/CD > Variables
+# In GitHub: Settings > Secrets > Actions
+
+# Add variable:
+MODULE_REPO_TOKEN: [your token from library.silverlabs.uk]git add .
+git commit -m "feat: Initial module implementation"
+git pushgit tag v1.0.0
+git push --tags# Build and package
+dotnet pack --configuration Release -o dist/
+
+# Upload to repository
+curl -X POST "https://library.silverlabs.uk/api/modules/publish" \
+ -F "id=MyModule" \
+ -F "name=My Awesome Module" \
+ -F "version=1.0.0" \
+ -F "description=A great module" \
+ -F "author=Your Name" \
+ -F "package=@@dist/MyModule.1.0.0.nupkg"Browse and install modules from the SilverSHELL module repository:
+ +# List all available modules via API
+curl https://library.silverlabs.uk/api/modules
+
+# Search for specific modules
+curl https://library.silverlabs.uk/api/modules/search?q=authNeed help? We're here for you:
+This component demonstrates showing data.
+ +@if (forecasts == null) +{ +Loading...
+} +else +{ +| Date | +Temp. (C) | +Temp. (F) | +Summary | +
|---|---|---|---|
| @forecast.Date.ToShortDateString() | +@forecast.TemperatureC | +@forecast.TemperatureF | +@forecast.Summary | +
`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\n\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n\n// Abbreviations\n//\n// 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.\n// 2. Add explicit cursor to indicate changed behavior.\n// 3. Prevent the text-decoration to be skipped.\n\nabbr[title] {\n text-decoration: underline dotted; // 1\n cursor: help; // 2\n text-decoration-skip-ink: none; // 3\n}\n\n\n// Address\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\n\n// Lists\n\nol,\nul {\n padding-left: 2rem;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\n// 1. Undo browser default\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // 1\n}\n\n\n// Blockquote\n\nblockquote {\n margin: 0 0 1rem;\n}\n\n\n// Strong\n//\n// Add the correct font weight in Chrome, Edge, and Safari\n\nb,\nstrong {\n font-weight: $font-weight-bolder;\n}\n\n\n// Small\n//\n// Add the correct font size in all browsers\n\nsmall {\n @include font-size($small-font-size);\n}\n\n\n// Mark\n\nmark {\n padding: $mark-padding;\n color: var(--#{$prefix}highlight-color);\n background-color: var(--#{$prefix}highlight-bg);\n}\n\n\n// Sub and Sup\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n\nsub,\nsup {\n position: relative;\n @include font-size($sub-sup-font-size);\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n// Links\n\na {\n color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));\n text-decoration: $link-decoration;\n\n &:hover {\n --#{$prefix}link-color-rgb: var(--#{$prefix}link-hover-color-rgb);\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([class]) {\n &,\n &:hover {\n color: inherit;\n text-decoration: none;\n }\n}\n\n\n// Code\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-code;\n @include font-size(1em); // Correct the odd `em` font sizing in all browsers.\n}\n\n// 1. Remove browser default top margin\n// 2. Reset browser default of `1em` to use `rem`s\n// 3. Don't allow content to break outside\n\npre {\n display: block;\n margin-top: 0; // 1\n margin-bottom: 1rem; // 2\n overflow: auto; // 3\n @include font-size($code-font-size);\n color: $pre-color;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n @include font-size(inherit);\n color: inherit;\n word-break: normal;\n }\n}\n\ncode {\n @include font-size($code-font-size);\n color: var(--#{$prefix}code-color);\n word-wrap: break-word;\n\n // Streamline the style when inside anchors to avoid broken underline and more\n a > & {\n color: inherit;\n }\n}\n\nkbd {\n padding: $kbd-padding-y $kbd-padding-x;\n @include font-size($kbd-font-size);\n color: $kbd-color;\n background-color: $kbd-bg;\n @include border-radius($border-radius-sm);\n\n kbd {\n padding: 0;\n @include font-size(1em);\n font-weight: $nested-kbd-font-weight;\n }\n}\n\n\n// Figures\n//\n// Apply a consistent margin strategy (matches our type styles).\n\nfigure {\n margin: 0 0 1rem;\n}\n\n\n// Images and content\n\nimg,\nsvg {\n vertical-align: middle;\n}\n\n\n// Tables\n//\n// Prevent double borders\n\ntable {\n caption-side: bottom;\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: $table-cell-padding-y;\n padding-bottom: $table-cell-padding-y;\n color: $table-caption-color;\n text-align: left;\n}\n\n// 1. Removes font-weight bold by inheriting\n// 2. Matches default `