diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 5daf7e7e3..c5325d2fa 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -460,6 +460,8 @@ common/views/components/connect-failed.troubleshooter.vue:
flush: "キャッシュの削除"
set-version: "バージョン指定"
+
+
common/views/components/media-banner.vue:
sensitive: "閲覧注意"
click-to-show: "クリックして表示"
@@ -637,6 +639,17 @@ common/views/components/emoji-picker.vue:
symbols: "記号"
flags: "旗"
+common/views/components/settings/client-mode.vue:
+ title: "クライアント"
+ select-app-type: "利用するクライアントのモード"
+ choices:
+ auto: "自動で選択"
+ desktop: "デスクトップ版に固定"
+ mobile: "モバイル版に固定"
+ desktop: "デスクトップ"
+ mobile: "モバイル"
+ info: "変更はページの再度読み込み後に反映されます。"
+
common/views/components/signin.vue:
username: "ユーザー名"
password: "パスワード"
diff --git a/src/client/app/boot.js b/src/client/app/boot.js
index 01104bf71..56eb59e21 100644
--- a/src/client/app/boot.js
+++ b/src/client/app/boot.js
@@ -35,12 +35,12 @@
const url = new URL(location.href);
//#region Detect app name
- let app = null;
+ var appType = null;
- if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs';
- if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev';
- if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth';
- if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin';
+ if (`${url.pathname}/`.startsWith('/docs/')) appType = 'docs';
+ if (`${url.pathname}/`.startsWith('/dev/')) appType = 'dev';
+ if (`${url.pathname}/`.startsWith('/auth/')) appType = 'auth';
+ if (`${url.pathname}/`.startsWith('/admin/')) appType = 'admin';
//#endregion
// Script version
@@ -103,15 +103,15 @@
}
// Switch desktop or mobile version
- if (app == null) {
- app = isMobile ? 'mobile' : 'desktop';
+ if (appType == null) {
+ appType = isMobile ? 'mobile' : 'desktop';
}
// Load an app script
// Note: 'async' make it possible to load the script asyncly.
// 'defer' make it possible to run the script when the dom loaded.
const script = document.createElement('script');
- script.setAttribute('src', `/assets/${app}.${ver}.js`);
+ script.setAttribute('src', `/assets/${appType}.${ver}.js`);
script.setAttribute('async', 'true');
script.setAttribute('defer', 'true');
head.appendChild(script);
diff --git a/src/client/app/common/views/components/settings/app-type.vue b/src/client/app/common/views/components/settings/app-type.vue
new file mode 100644
index 000000000..533fd5151
--- /dev/null
+++ b/src/client/app/common/views/components/settings/app-type.vue
@@ -0,0 +1,40 @@
+
+
+ {{ $t('title') }}
+
+
+
+
+
+ Current: {{ $t(currentAppType) }}
+ {{ $t('info') }}
+
+
+
+
+
diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue
index 1254eb5e5..5f370c8be 100644
--- a/src/client/app/common/views/components/settings/settings.vue
+++ b/src/client/app/common/views/components/settings/settings.vue
@@ -163,6 +163,7 @@
+
@@ -271,6 +272,7 @@ import XPassword from './password.vue';
import XProfile from './profile.vue';
import XApi from './api.vue';
import XLanguage from './language.vue';
+import XAppType from './app-type.vue';
import XNotification from './notification.vue';
import { url, version } from '../../../../config';
@@ -291,6 +293,7 @@ export default Vue.extend({
XProfile,
XApi,
XLanguage,
+ XAppType,
XNotification,
},
props: {
diff --git a/src/client/app/store.ts b/src/client/app/store.ts
index 852d2c393..cca7a5c2c 100644
--- a/src/client/app/store.ts
+++ b/src/client/app/store.ts
@@ -60,6 +60,7 @@ const defaultDeviceSettings = {
soundVolume: 0.5,
mediaVolume: 0.5,
lang: null,
+ appTypeForce: 'auto',
debug: false,
lightmode: false,
loadRawImages: false,