Proxy settings

This commit is contained in:
Natsumi
2024-07-17 10:31:18 +12:00
parent a4d03c7e00
commit e26aed5c6a
11 changed files with 114 additions and 26 deletions

View File

@@ -15659,6 +15659,10 @@ speechSynthesis.getVoices();
if (!(await VRCXStorage.Get('VRCX_DatabaseLocation'))) {
await VRCXStorage.Set('VRCX_DatabaseLocation', '');
}
if (!(await VRCXStorage.Get('VRCX_ProxyServer'))) {
await VRCXStorage.Set('VRCX_ProxyServer', '');
}
$app.data.proxyServer = await VRCXStorage.Get('VRCX_ProxyServer');
$app.data.disableWorldDatabase =
(await VRCXStorage.Get('VRCX_DisableWorldDatabase')) === 'true';
$app.methods.saveVRCXWindowOption = async function () {
@@ -32886,6 +32890,35 @@ speechSynthesis.getVoices();
// #endregion
// #region proxy settings
$app.methods.promptProxySettings = function () {
this.$prompt(
$t('prompt.proxy_settings.description'),
$t('prompt.proxy_settings.header'),
{
distinguishCancelAndClose: true,
confirmButtonText: $t('prompt.proxy_settings.restart'),
cancelButtonText: $t('prompt.proxy_settings.close'),
inputValue: this.proxyServer,
inputPlaceholder: $t('prompt.proxy_settings.placeholder'),
callback: async (action, instance) => {
this.proxyServer = instance.inputValue;
await VRCXStorage.Set('VRCX_ProxyServer', this.proxyServer);
await VRCXStorage.Flush();
await new Promise((resolve) => {
workerTimers.setTimeout(resolve, 100);
});
if (action === 'confirm') {
AppApi.RestartApplication();
}
}
}
);
};
// #endregion
$app = new Vue($app);
window.$app = $app;
})();

View File

@@ -20,6 +20,8 @@
"login": "Login",
"register": "Register",
"forgotPassword": "Forgot Password?",
"updater": "Updater",
"proxy_settings": "Proxy settings",
"field": {
"username": "Username or Email",
"password": "Password",
@@ -211,7 +213,8 @@
"header": "Application",
"startup": "Start at Windows startup",
"minimized": "Start as minimized state",
"tray": "Close to tray"
"tray": "Close to tray",
"proxy": "Proxy settings"
},
"favorites": {
"header": "VRCX Favorite Friends",
@@ -1600,6 +1603,13 @@
"cancel": "Cancel",
"save": "Save",
"input_error": "Valid number is required"
},
"proxy_settings": {
"header": "Proxy Settings",
"description": "Enter proxy server address and port",
"placeholder": "127.0.0.1:8080",
"close": "Close",
"restart": "Restart"
}
},
"table": {

View File

@@ -2,7 +2,10 @@ mixin loginPage()
.x-login-container(v-if="!API.isLoggedIn" v-loading="loginForm.loading")
.x-login
div(style="position:fixed; top: 0; left: 0; margin:5px")
el-button(type="default" @click="showVRCXUpdateDialog" size="mini" icon="el-icon-download" circle)
el-tooltip(placement="top" :content="$t('view.login.updater')" :disabled="hideTooltips")
el-button(type="default" @click="showVRCXUpdateDialog" size="mini" icon="el-icon-download" circle)
el-tooltip(placement="top" :content="$t('view.login.proxy_settings')" :disabled="hideTooltips")
el-button(type="default" @click="promptProxySettings" size="mini" icon="el-icon-connection" style="margin-left:5px" circle)
div.x-login-form-container
div

View File

@@ -84,6 +84,8 @@ mixin settingsTab()
+simpleSwitch("view.settings.general.application.startup", "isStartAtWindowsStartup", "saveVRCXWindowOption")
+simpleSwitch("view.settings.general.application.minimized", "isStartAsMinimizedState", "saveVRCXWindowOption")
+simpleSwitch("view.settings.general.application.tray", "isCloseToTray", "saveVRCXWindowOption")
div.options-container-item
el-button(size="small" icon="el-icon-connection" @click="promptProxySettings()") {{ $t("view.settings.general.application.proxy") }}
//- General | Favorite
+simpleSettingsCategory("view.settings.general.favorites.header")
br