From b7cb172d895bf79ced0143eda5495855351cdbdb Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 18 Feb 2020 21:12:05 +0900 Subject: [PATCH] Implement object storage settings --- locales/ja-JP.yml | 2 + src/client/pages/instance/settings.vue | 61 +++++++++++++++++++++++++- src/client/style.scss | 26 +++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index e8bf1ca28..001ff407a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -417,6 +417,8 @@ promote: "プロモート" numberOfDays: "日数" hideThisNote: "このノートを非表示" showFeaturedNotesInTimeline: "タイムラインにおすすめのノートを表示する" +objectStorage: "オブジェクトストレージ" +useObjectStorage: "オブジェクトストレージを使用" _ago: unknown: "謎" diff --git a/src/client/pages/instance/settings.vue b/src/client/pages/instance/settings.vue index 93b9f665e..757210871 100644 --- a/src/client/pages/instance/settings.vue +++ b/src/client/pages/instance/settings.vue @@ -61,10 +61,10 @@
{{ $t('enableServiceworker') }}
+
+
{{ $t('objectStorage') }}
+
+ {{ $t('useObjectStorage') }} + +
+ +
+
{{ $t('proxyAccount') }}
@@ -213,6 +240,16 @@ export default Vue.extend({ enableServiceWorker: false, swPublicKey: null, swPrivateKey: null, + useObjectStorage: false, + objectStorageBaseUrl: null, + objectStorageBucket: null, + objectStoragePrefix: null, + objectStorageEndpoint: null, + objectStorageRegion: null, + objectStoragePort: null, + objectStorageAccessKey: null, + objectStorageSecretKey: null, + objectStorageUseSSL: false, enableTwitterIntegration: false, twitterConsumerKey: null, twitterConsumerSecret: null, @@ -257,6 +294,16 @@ export default Vue.extend({ this.enableServiceWorker = this.meta.enableServiceWorker; this.swPublicKey = this.meta.swPublickey; this.swPrivateKey = this.meta.swPrivateKey; + this.useObjectStorage = this.meta.useObjectStorage; + this.objectStorageBaseUrl = this.meta.objectStorageBaseUrl; + this.objectStorageBucket = this.meta.objectStorageBucket; + this.objectStoragePrefix = this.meta.objectStoragePrefix; + this.objectStorageEndpoint = this.meta.objectStorageEndpoint; + this.objectStorageRegion = this.meta.objectStorageRegion; + this.objectStoragePort = this.meta.objectStoragePort; + this.objectStorageAccessKey = this.meta.objectStorageAccessKey; + this.objectStorageSecretKey = this.meta.objectStorageSecretKey; + this.objectStorageUseSSL = this.meta.objectStorageUseSSL; this.enableTwitterIntegration = this.meta.enableTwitterIntegration; this.twitterConsumerKey = this.meta.twitterConsumerKey; this.twitterConsumerSecret = this.meta.twitterConsumerSecret; @@ -341,6 +388,16 @@ export default Vue.extend({ enableServiceWorker: this.enableServiceWorker, swPublicKey: this.swPublicKey, swPrivateKey: this.swPrivateKey, + useObjectStorage: this.useObjectStorage, + objectStorageBaseUrl: this.objectStorageBaseUrl ? this.objectStorageBaseUrl : null, + objectStorageBucket: this.objectStorageBucket ? this.objectStorageBucket : null, + objectStoragePrefix: this.objectStoragePrefix ? this.objectStoragePrefix : null, + objectStorageEndpoint: this.objectStorageEndpoint ? this.objectStorageEndpoint : null, + objectStorageRegion: this.objectStorageRegion ? this.objectStorageRegion : null, + objectStoragePort: this.objectStoragePort ? this.objectStoragePort : null, + objectStorageAccessKey: this.objectStorageAccessKey ? this.objectStorageAccessKey : null, + objectStorageSecretKey: this.objectStorageSecretKey ? this.objectStorageSecretKey : null, + objectStorageUseSSL: this.objectStorageUseSSL, enableTwitterIntegration: this.enableTwitterIntegration, twitterConsumerKey: this.twitterConsumerKey, twitterConsumerSecret: this.twitterConsumerSecret, diff --git a/src/client/style.scss b/src/client/style.scss index a9868a949..bdbd9a143 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -248,6 +248,32 @@ hr { } } +._inputs { + display: flex; + margin: 32px 0; + + &:first-child { + margin-top: 8px; + } + + &:last-child { + margin-bottom: 8px; + } + + > * { + flex: 1; + margin: 0 !important; + + &:not(:first-child) { + margin-left: 8px !important; + } + + &:not(:last-child) { + margin-right: 8px !important; + } + } +} + ._shadow { box-shadow: 0 8px 32px var(--shadow);