Skip to content

Commit

Permalink
Merge pull request #139 from ConchbrainClub/main
Browse files Browse the repository at this point in the history
change default proxy server
  • Loading branch information
lixinyang123 authored Apr 3, 2024
2 parents d7936f0 + d6a236b commit 7c8d88d
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 29 deletions.
5 changes: 5 additions & 0 deletions MixApp.Web/Components/RequestPermission.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<FluentDialogBody>
<p>@(new MarkupString(LM.Scripts["c.request_permission.recommended_to_enable"]))</p>
<p>@(new MarkupString(LM.Scripts["c.request_permission.allow_notification"]))</p>
<p>
<FluentCheckbox @bind-Value=EnableProxy >
@(new MarkupString(LM.Scripts["c.request_permission.enable_proxy_server"]))
</FluentCheckbox>
</p>
</FluentDialogBody>

<div class="dialogFooter">
Expand Down
21 changes: 21 additions & 0 deletions MixApp.Web/Components/RequestPermission.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ public bool ShowDialog
}
}

private bool enableProxy;

public bool EnableProxy
{
get => enableProxy;
set
{
if (value)
{
LocalStorage.RemoveItemAsync("disable_proxy").AsTask();
}
else
{
LocalStorage.SetItemAsStringAsync("disable_proxy", "true").AsTask();
}
enableProxy = value;
}
}

protected async override Task OnInitializedAsync()
{
if (string.IsNullOrEmpty(await LocalStorage.GetItemAsStringAsync("NotificationPermissionDialog")))
Expand All @@ -33,6 +52,8 @@ protected async override Task OnInitializedAsync()
if (!string.IsNullOrEmpty(await LocalStorage.GetItemAsStringAsync("NotificationPermission"))) return;
ShowDialog = true;
}

enableProxy = string.IsNullOrEmpty(await LocalStorage.GetItemAsStringAsync("disable_proxy").AsTask());
}

public async void NoLongerShowDialog()
Expand Down
52 changes: 26 additions & 26 deletions MixApp.Web/MixApp.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishTrimmed>true</PublishTrimmed>
<RunAOTCompilation>true</RunAOTCompilation>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Append.Blazor.Notifications" Version="1.1.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="8.0.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.4.1" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.4.0" />
</ItemGroup>

<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishTrimmed>true</PublishTrimmed>
<RunAOTCompilation>true</RunAOTCompilation>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Append.Blazor.Notifications" Version="1.1.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="8.0.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.6.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion MixApp.Web/wwwroot/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"BaseAddress": "https://mixapi-staging.conchbrain.club",
"BaseAddress": "http://localhost:8080",
"AssetsAddress": "https://mixstore.conchbrain.club",
"DownloadProxy": "https://cors.conchbrain.club/?"
}
4 changes: 2 additions & 2 deletions MixApp.Web/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"BaseAddress": "https://mixapi.conchbrain.club",
"BaseAddress": "https://mixapi.conchbrain.club",
"AssetsAddress": "https://mixstore.conchbrain.club",
"DownloadProxy": "https://proxy2.conchbrain.club/?"
"DownloadProxy": "https://cors.conchbrain.club/?"
}
1 change: 1 addition & 0 deletions MixApp.Web/wwwroot/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"c.request_permission.better_experience": "Get a better user experience",
"c.request_permission.recommended_to_enable": "<i>MixStore recommends that you enable the following permissions</i>",
"c.request_permission.allow_notification": "Allow <u><strong>notifications</strong></u> permissions to remind you of the download status of the software",
"c.request_permission.enable_proxy_server": "<i><strong>Enable download proxy</i></strong> <br/> After closing, the <u><strong>local network</u></strong> will be used for downloading. You can modify it again in the <u><strong>setting</u></strong>.",
"c.request_permission.allow": "Allow",
"c.request_permission.close": "Don't remind me again",

Expand Down
1 change: 1 addition & 0 deletions MixApp.Web/wwwroot/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"c.request_permission.better_experience": "获得更好的使用体验",
"c.request_permission.recommended_to_enable": "<i>MixStore 推荐您开启以下权限</i>",
"c.request_permission.allow_notification": "允许 <u><strong>通知</strong></u> 权限来提醒您软件的下载状态",
"c.request_permission.enable_proxy_server": "<i><strong>启用下载代理</i></strong> <br/>关闭后将使用 <u><strong>本地网络</strong></u> 进行下载,您可以在 <u><strong>设置</strong></u> 中重新修改",
"c.request_permission.allow": "允许",
"c.request_permission.close": "不再提醒",

Expand Down

0 comments on commit 7c8d88d

Please sign in to comment.