diff options
Diffstat (limited to 'src/client/app')
34 files changed, 146 insertions, 198 deletions
diff --git a/src/client/app/auth/views/form.vue b/src/client/app/auth/views/form.vue index 2d1e6d3e82..d18a4f7eb4 100644 --- a/src/client/app/auth/views/form.vue +++ b/src/client/app/auth/views/form.vue @@ -7,7 +7,7 @@ <div class="app"> <section> <h2>{{ app.name }}</h2> - <p class="nid">{{ app.nameId }}</p> + <p class="id">{{ app.id }}</p> <p class="description">{{ app.description }}</p> </section> <section> diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue index 0c3cceb1b3..cf3e5c8ac1 100644 --- a/src/client/app/common/views/components/signin.vue +++ b/src/client/app/common/views/components/signin.vue @@ -12,13 +12,13 @@ </ui-input> <ui-input v-if="user && user.twoFactorEnabled" v-model="token" type="number" required/> <ui-button type="submit" :disabled="signing">{{ signing ? '%i18n:@signing-in%' : '%i18n:@signin%' }}</ui-button> - <p style="margin: 8px 0;" v-if="twitterIntegration">%i18n:@or% <a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p> + <p style="margin: 8px 0;">%i18n:@or% <a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p> </form> </template> <script lang="ts"> import Vue from 'vue'; -import { apiUrl, host, twitterIntegration } from '../../../config'; +import { apiUrl, host } from '../../../config'; export default Vue.extend({ props: { diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 1d33702159..810b850831 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -34,7 +34,7 @@ <p slot="text" v-if="passwordRetypeState == 'not-match'" style="color:#FF1161">%fa:exclamation-triangle .fw% %i18n:@password-not-matched%</p> </div> </ui-input> - <div v-if="recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div> + <div v-if="meta && meta.recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="meta.recaptchaSitekey" style="margin: 16px 0;"></div> <ui-button type="submit">%i18n:@create%</ui-button> </form> </template> @@ -42,7 +42,7 @@ <script lang="ts"> import Vue from 'vue'; const getPasswordStrength = require('syuilo-password-strength'); -import { host, url, recaptchaSitekey } from '../../../config'; +import { host, url } from '../../../config'; export default Vue.extend({ data() { @@ -53,7 +53,6 @@ export default Vue.extend({ retypedPassword: '', invitationCode: '', url, - recaptchaSitekey, usernameState: null, passwordStrength: '', passwordRetypeState: null, @@ -73,6 +72,12 @@ export default Vue.extend({ this.meta = meta; }); }, + mounted() { + const head = document.getElementsByTagName('head')[0]; + const script = document.createElement('script'); + script.setAttribute('src', 'https://www.google.com/recaptcha/api.js'); + head.appendChild(script); + }, methods: { onChangeUsername() { if (this.username == '') { @@ -123,7 +128,7 @@ export default Vue.extend({ username: this.username, password: this.password, invitationCode: this.invitationCode, - 'g-recaptcha-response': recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null + 'g-recaptcha-response': this.meta.recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null }).then(() => { (this as any).api('signin', { username: this.username, @@ -134,19 +139,11 @@ export default Vue.extend({ }).catch(() => { alert('%i18n:@some-error%'); - if (recaptchaSitekey != null) { + if (this.meta.recaptchaSitekey != null) { (window as any).grecaptcha.reset(); } }); } - }, - mounted() { - if (recaptchaSitekey != null) { - const head = document.getElementsByTagName('head')[0]; - const script = document.createElement('script'); - script.setAttribute('src', 'https://www.google.com/recaptcha/api.js'); - head.appendChild(script); - } } }); </script> diff --git a/src/client/app/common/views/widgets/server.cpu-memory.vue b/src/client/app/common/views/widgets/server.cpu-memory.vue index 2988993c94..b0421d6150 100644 --- a/src/client/app/common/views/widgets/server.cpu-memory.vue +++ b/src/client/app/common/views/widgets/server.cpu-memory.vue @@ -122,7 +122,7 @@ export default Vue.extend({ this.memP = (stats.mem.used / stats.mem.total * 100).toFixed(0); }, onStatsLog(statsLog) { - statsLog.forEach(stats => this.onStats(stats)); + statsLog.reverse().forEach(stats => this.onStats(stats)); } } }); diff --git a/src/client/app/config.ts b/src/client/app/config.ts index 04486ea230..76cd536a49 100644 --- a/src/client/app/config.ts +++ b/src/client/app/config.ts @@ -1,51 +1,22 @@ -declare const _HOST_: string; -declare const _HOSTNAME_: string; -declare const _URL_: string; -declare const _NAME_: string; -declare const _DESCRIPTION_: string; -declare const _API_URL_: string; -declare const _WS_URL_: string; -declare const _DOCS_URL_: string; -declare const _STATS_URL_: string; -declare const _STATUS_URL_: string; -declare const _DEV_URL_: string; -declare const _REPOSITORY_URL_: string; -declare const _FEEDBACK_URL_: string; declare const _LANG_: string; declare const _LANGS_: string; -declare const _RECAPTCHA_SITEKEY_: string; -declare const _SW_PUBLICKEY_: string; declare const _THEME_COLOR_: string; declare const _COPYRIGHT_: string; declare const _VERSION_: string; declare const _CODENAME_: string; declare const _LICENSE_: string; -declare const _GOOGLE_MAPS_API_KEY_: string; -declare const _WELCOME_BG_URL_: string; -declare const _TWITTER_INTEGRATION_: boolean; -export const host = _HOST_; -export const hostname = _HOSTNAME_; -export const url = _URL_; -export const name = _NAME_; -export const description = _DESCRIPTION_; -export const apiUrl = _API_URL_; -export const wsUrl = _WS_URL_; -export const docsUrl = _DOCS_URL_; -export const statsUrl = _STATS_URL_; -export const statusUrl = _STATUS_URL_; -export const devUrl = _DEV_URL_; -export const repositoryUrl = _REPOSITORY_URL_; -export const feedbackUrl = _FEEDBACK_URL_; +const address = new URL(location.href); + +export const host = address.host; +export const hostname = address.hostname; +export const url = address.origin; +export const apiUrl = url + '/api'; +export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://'); export const lang = _LANG_; export const langs = _LANGS_; -export const recaptchaSitekey = _RECAPTCHA_SITEKEY_; -export const swPublickey = _SW_PUBLICKEY_; export const themeColor = _THEME_COLOR_; export const copyright = _COPYRIGHT_; export const version = _VERSION_; export const codename = _CODENAME_; export const license = _LICENSE_; -export const googleMapsApiKey = _GOOGLE_MAPS_API_KEY_; -export const welcomeBgUrl = _WELCOME_BG_URL_; -export const twitterIntegration = _TWITTER_INTEGRATION_; diff --git a/src/client/app/desktop/views/components/drive.file.vue b/src/client/app/desktop/views/components/drive.file.vue index 3b5be19dcf..3ac8923c51 100644 --- a/src/client/app/desktop/views/components/drive.file.vue +++ b/src/client/app/desktop/views/components/drive.file.vue @@ -9,12 +9,18 @@ @contextmenu.prevent.stop="onContextmenu" :title="title" > - <div class="label" v-if="$store.state.i.avatarId == file.id"><img src="/assets/label.svg"/> + <div class="label" v-if="$store.state.i.avatarId == file.id"> + <img src="/assets/label.svg"/> <p>%i18n:@avatar%</p> </div> - <div class="label" v-if="$store.state.i.bannerId == file.id"><img src="/assets/label.svg"/> + <div class="label" v-if="$store.state.i.bannerId == file.id"> + <img src="/assets/label.svg"/> <p>%i18n:@banner%</p> </div> + <div class="label red" v-if="file.isSensitive"> + <img src="/assets/label-red.svg"/> + <p>%i18n:@nsfw%</p> + </div> <div class="thumbnail" ref="thumbnail" :style="`background-color: ${ background }`"> <img :src="file.thumbnailUrl" alt="" @load="onThumbnailLoaded"/> </div> @@ -212,6 +218,11 @@ root(isDark) &:after background #0b65a5 + &.red + &:before + &:after + background #c12113 + &:active background rgba(#000, 0.1) @@ -220,6 +231,11 @@ root(isDark) &:after background #0b588c + &.red + &:before + &:after + background #ce2212 + &[data-is-selected] background $theme-color @@ -256,26 +272,29 @@ root(isDark) pointer-events none &:before + &:after content "" display block position absolute z-index 1 + background #0c7ac9 + + &:before top 0 left 57px width 28px height 8px - background #0c7ac9 &:after - content "" - display block - position absolute - z-index 1 top 57px left 0 width 8px height 28px - background #0c7ac9 + + &.red + &:before + &:after + background #c12113 > img position absolute diff --git a/src/client/app/desktop/views/components/notes.vue b/src/client/app/desktop/views/components/notes.vue index efb9db70fa..a1c1207a7b 100644 --- a/src/client/app/desktop/views/components/notes.vue +++ b/src/client/app/desktop/views/components/notes.vue @@ -193,7 +193,7 @@ export default Vue.extend({ clearNotification() { this.unreadCount = 0; - document.title = config.name; + document.title = (this as any).os.instanceName; }, onVisibilitychange() { diff --git a/src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue b/src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue index 572974e248..d14ce12553 100644 --- a/src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue +++ b/src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue @@ -15,14 +15,14 @@ :points="cpuPolylinePoints" fill="none" stroke="#fff" - stroke-width="0.3"/> + stroke-width="1"/> </mask> </defs> <rect x="0" y="0" :width="viewBoxX" :height="viewBoxY" :style="`stroke: none; fill: url(#${ cpuGradientId }); mask: url(#${ cpuMaskId })`"/> - <text x="1" y="5">CPU <tspan>{{ cpuP }}%</tspan></text> + <text x="1" y="12">CPU <tspan>{{ cpuP }}%</tspan></text> </svg> <svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`"> <defs> @@ -39,14 +39,14 @@ :points="memPolylinePoints" fill="none" stroke="#fff" - stroke-width="0.3"/> + stroke-width="1"/> </mask> </defs> <rect x="0" y="0" :width="viewBoxX" :height="viewBoxY" :style="`stroke: none; fill: url(#${ memGradientId }); mask: url(#${ memMaskId })`"/> - <text x="1" y="5">MEM <tspan>{{ memP }}%</tspan></text> + <text x="1" y="12">MEM <tspan>{{ memP }}%</tspan></text> </svg> </div> </template> @@ -59,8 +59,8 @@ export default Vue.extend({ props: ['connection'], data() { return { - viewBoxX: 50, - viewBoxY: 20, + viewBoxX: 200, + viewBoxY: 70, stats: [], cpuGradientId: uuid(), cpuMaskId: uuid(), @@ -79,7 +79,8 @@ export default Vue.extend({ this.connection.on('statsLog', this.onStatsLog); this.connection.send({ type: 'requestLog', - id: Math.random().toString() + id: Math.random().toString(), + length: 200 }); }, beforeDestroy() { @@ -89,7 +90,7 @@ export default Vue.extend({ methods: { onStats(stats) { this.stats.push(stats); - if (this.stats.length > 50) this.stats.shift(); + if (this.stats.length > 200) this.stats.shift(); const cpuPolylinePoints = this.stats.map((s, i) => [this.viewBoxX - ((this.stats.length - 1) - i), (1 - s.cpu_usage) * this.viewBoxY]); const memPolylinePoints = this.stats.map((s, i) => [this.viewBoxX - ((this.stats.length - 1) - i), (1 - (s.mem.used / s.mem.total)) * this.viewBoxY]); @@ -103,7 +104,7 @@ export default Vue.extend({ this.memP = (stats.mem.used / stats.mem.total * 100).toFixed(0); }, onStatsLog(statsLog) { - statsLog.forEach(stats => this.onStats(stats)); + statsLog.reverse().forEach(stats => this.onStats(stats)); } } }); @@ -111,8 +112,6 @@ export default Vue.extend({ <style lang="stylus" scoped> root(isDark) - margin-bottom 16px - > svg display block width 50% @@ -125,7 +124,7 @@ root(isDark) padding-left 5px > text - font-size 2px + font-size 10px fill isDark ? rgba(#fff, 0.55) : rgba(#000, 0.55) > tspan diff --git a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue index e68d3a749e..3567585cb8 100644 --- a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue +++ b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue @@ -77,4 +77,10 @@ export default Vue.extend({ > *:last-child font-size 70% + > .cpu-memory + margin-bottom 16px + padding 16px + border solid 1px #eee + border-radius: 8px + </style> diff --git a/src/client/app/desktop/views/pages/home-customize.vue b/src/client/app/desktop/views/pages/home-customize.vue index 4318e89821..174fbf45ed 100644 --- a/src/client/app/desktop/views/pages/home-customize.vue +++ b/src/client/app/desktop/views/pages/home-customize.vue @@ -4,11 +4,10 @@ <script lang="ts"> import Vue from 'vue'; -import * as config from '../../../config'; export default Vue.extend({ mounted() { - document.title = `${config.name} - %i18n:@title%`; + document.title = `${(this as any).os.instanceName} - %i18n:@title%`; } }); </script> diff --git a/src/client/app/desktop/views/pages/home.vue b/src/client/app/desktop/views/pages/home.vue index 3d3c24bfa4..c7ff0904e0 100644 --- a/src/client/app/desktop/views/pages/home.vue +++ b/src/client/app/desktop/views/pages/home.vue @@ -7,7 +7,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import * as config from '../../../config'; export default Vue.extend({ props: { @@ -17,7 +16,7 @@ export default Vue.extend({ } }, mounted() { - document.title = config.name; + document.title = (this as any).os.instanceName; Progress.start(); }, diff --git a/src/client/app/desktop/views/pages/share.vue b/src/client/app/desktop/views/pages/share.vue index 4a7bdb14cd..4dd6080690 100644 --- a/src/client/app/desktop/views/pages/share.vue +++ b/src/client/app/desktop/views/pages/share.vue @@ -12,12 +12,11 @@ <script lang="ts"> import Vue from 'vue'; -import * as config from '../../../config'; export default Vue.extend({ data() { return { - name: config.name, + name: (this as any).os.instanceName, posted: false, text: new URLSearchParams(location.search).get('text') }; diff --git a/src/client/app/desktop/views/pages/welcome.vue b/src/client/app/desktop/views/pages/welcome.vue index 585a23de2d..ac2f921a21 100644 --- a/src/client/app/desktop/views/pages/welcome.vue +++ b/src/client/app/desktop/views/pages/welcome.vue @@ -5,7 +5,7 @@ <template v-if="$store.state.device.darkmode">%fa:moon%</template> <template v-else>%fa:R moon%</template> </button> - <div class="body" :style="{ backgroundImage: `url('${ welcomeBgUrl }')` }"> + <div class="body"> <div class="container"> <div class="info"> <span><b>{{ host }}</b></span> @@ -46,22 +46,26 @@ <script lang="ts"> import Vue from 'vue'; -import { host, name, description, copyright, welcomeBgUrl } from '../../../config'; +import { host, copyright } from '../../../config'; export default Vue.extend({ data() { return { stats: null, copyright, - welcomeBgUrl, host, - name, - description, + name: 'Misskey', + description: '', pointerInterval: null, tags: [] }; }, created() { + (this as any).os.getMeta().then(meta => { + this.name = meta.name; + this.description = meta.description; + }); + (this as any).api('stats').then(stats => { this.stats = stats; }); diff --git a/src/client/app/dev/views/new-app.vue b/src/client/app/dev/views/new-app.vue index 87b35db259..7321df00c0 100644 --- a/src/client/app/dev/views/new-app.vue +++ b/src/client/app/dev/views/new-app.vue @@ -5,16 +5,6 @@ <b-form-group label="アプリケーション名" description="あなたのアプリの名称。"> <b-form-input v-model="name" type="text" placeholder="ex) Misskey for iOS" autocomplete="off" required/> </b-form-group> - <b-form-group label="ID" description="あなたのアプリのID。"> - <b-input v-model="nid" type="text" pattern="^[a-zA-Z0-9_]{1,30}$" placeholder="ex) misskey-for-ios" autocomplete="off" required/> - <p class="info" v-if="nidState == 'wait'" style="color:#999">%fa:spinner .pulse .fw%確認しています...</p> - <p class="info" v-if="nidState == 'ok'" style="color:#3CB7B5">%fa:fw check%利用できます</p> - <p class="info" v-if="nidState == 'unavailable'" style="color:#FF1161">%fa:fw exclamation-triangle%既に利用されています</p> - <p class="info" v-if="nidState == 'error'" style="color:#FF1161">%fa:fw exclamation-triangle%通信エラー</p> - <p class="info" v-if="nidState == 'invalid-format'" style="color:#FF1161">%fa:fw exclamation-triangle%a~z、A~Z、0~9、_が使えます</p> - <p class="info" v-if="nidState == 'min-range'" style="color:#FF1161">%fa:fw exclamation-triangle%1文字以上でお願いします!</p> - <p class="info" v-if="nidState == 'max-range'" style="color:#FF1161">%fa:fw exclamation-triangle%30文字以内でお願いします</p> - </b-form-group> <b-form-group label="アプリの概要" description="あなたのアプリの簡単な説明や紹介。"> <b-textarea v-model="description" placeholder="ex) Misskey iOSクライアント。" autocomplete="off" required></b-textarea> </b-form-group> @@ -50,47 +40,16 @@ export default Vue.extend({ data() { return { name: '', - nid: '', description: '', cb: '', nidState: null, permission: [] }; }, - watch: { - nid() { - if (this.nid == null || this.nid == '') { - this.nidState = null; - return; - } - - const err = - !this.nid.match(/^[a-zA-Z0-9_]+$/) ? 'invalid-format' : - this.nid.length < 1 ? 'min-range' : - this.nid.length > 30 ? 'max-range' : - null; - - if (err) { - this.nidState = err; - return; - } - - this.nidState = 'wait'; - - (this as any).api('app/name_id/available', { - nameId: this.nid - }).then(result => { - this.nidState = result.available ? 'ok' : 'unavailable'; - }).catch(err => { - this.nidState = 'error'; - }); - } - }, methods: { onSubmit() { (this as any).api('app/create', { name: this.name, - nameId: this.nid, description: this.description, callbackUrl: this.cb, permission: this.permission diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index 565c8bf1f5..664848b5e7 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -70,6 +70,10 @@ export default class MiOS extends EventEmitter { chachedAt: Date; }; + public get instanceName() { + return this.meta ? this.meta.data.name : 'Misskey'; + } + private isMetaFetching = false; public app: Vue; diff --git a/src/client/app/mobile/views/components/drive.file-detail.vue b/src/client/app/mobile/views/components/drive.file-detail.vue index f6a22f95f0..deb9941be8 100644 --- a/src/client/app/mobile/views/components/drive.file-detail.vue +++ b/src/client/app/mobile/views/components/drive.file-detail.vue @@ -30,6 +30,10 @@ <span class="data-size">{{ file.datasize | bytes }}</span> <span class="separator"></span> <span class="created-at" @click="showCreatedAt">%fa:R clock%<mk-time :time="file.createdAt"/></span> + <template v-if="file.isSensitive"> + <span class="separator"></span> + <span class="nsfw">%fa:eye-slash% %i18n:@nsfw%</span> + </template> </div> </div> <div class="menu"> @@ -198,6 +202,9 @@ export default Vue.extend({ > [data-fa] margin-right 2px + > .nsfw + color #bf4633 + > .menu padding 14px border-top solid 1px #dfdfdf diff --git a/src/client/app/mobile/views/components/drive.file.vue b/src/client/app/mobile/views/components/drive.file.vue index c337629cb6..6dec4b9f4f 100644 --- a/src/client/app/mobile/views/components/drive.file.vue +++ b/src/client/app/mobile/views/components/drive.file.vue @@ -14,13 +14,17 @@ li.tag(style={background: tag.color, color: contrast(tag.color)})= tag.name --> <footer> - <p class="type"><mk-file-type-icon :type="file.type"/>{{ file.type }}</p> - <p class="separator"></p> - <p class="data-size">{{ file.datasize | bytes }}</p> - <p class="separator"></p> - <p class="created-at"> + <span class="type"><mk-file-type-icon :type="file.type"/>{{ file.type }}</span> + <span class="separator"></span> + <span class="data-size">{{ file.datasize | bytes }}</span> + <span class="separator"></span> + <span class="created-at"> %fa:R clock%<mk-time :time="file.createdAt"/> - </p> + </span> + <template v-if="file.isSensitive"> + <span class="separator"></span> + <span class="nsfw">%fa:eye-slash% %i18n:@nsfw%</span> + </template> </footer> </div> </div> @@ -133,35 +137,27 @@ export default Vue.extend({ font-size 0.7em > .separator - display inline - margin 0 padding 0 4px color #CDCDCD > .type - display inline - margin 0 - padding 0 color #9D9D9D > .mk-file-type-icon margin-right 4px > .data-size - display inline - margin 0 - padding 0 color #9D9D9D > .created-at - display inline - margin 0 - padding 0 color #BDBDBD > [data-fa] margin-right 2px + > .nsfw + color #bf4633 + &[data-is-selected] background $theme-color diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue index cce81d1b78..714e521c0f 100644 --- a/src/client/app/mobile/views/components/notes.vue +++ b/src/client/app/mobile/views/components/notes.vue @@ -38,7 +38,6 @@ <script lang="ts"> import Vue from 'vue'; import getNoteSummary from '../../../../../misc/get-note-summary'; -import * as config from '../../../config'; const displayLimit = 30; @@ -190,7 +189,7 @@ export default Vue.extend({ clearNotification() { this.unreadCount = 0; - document.title = config.name; + document.title = (this as any).os.instanceName; }, onVisibilitychange() { diff --git a/src/client/app/mobile/views/components/ui.header.vue b/src/client/app/mobile/views/components/ui.header.vue index b87c6f1eb7..a616586c56 100644 --- a/src/client/app/mobile/views/components/ui.header.vue +++ b/src/client/app/mobile/views/components/ui.header.vue @@ -8,7 +8,7 @@ <button class="nav" @click="$parent.isDrawerOpening = true">%fa:bars%</button> <template v-if="hasUnreadNotification || hasUnreadMessagingMessage || hasGameInvitation">%fa:circle%</template> <h1> - <slot>config.name</slot> + <slot>{{ os.instanceName }}</slot> </h1> <slot name="func"></slot> </div> @@ -20,13 +20,11 @@ <script lang="ts"> import Vue from 'vue'; import * as anime from 'animejs'; -import * as config from '../../../config'; export default Vue.extend({ props: ['func'], data() { return { - config, hasGameInvitation: false, connection: null, connectionId: null diff --git a/src/client/app/mobile/views/pages/drive.vue b/src/client/app/mobile/views/pages/drive.vue index 72427a4780..c7cbe0f72e 100644 --- a/src/client/app/mobile/views/pages/drive.vue +++ b/src/client/app/mobile/views/pages/drive.vue @@ -25,7 +25,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -44,7 +43,7 @@ export default Vue.extend({ window.addEventListener('popstate', this.onPopState); }, mounted() { - document.title = `${config.name} Drive`; + document.title = `${(this as any).os.instanceName} Drive`; document.documentElement.style.background = '#fff'; }, beforeDestroy() { @@ -64,7 +63,7 @@ export default Vue.extend({ (this.$refs as any).browser.openContextMenu(); }, onMoveRoot(silent) { - const title = `${config.name} Drive`; + const title = `${(this as any).os.instanceName} Drive`; if (!silent) { // Rewrite URL @@ -77,7 +76,7 @@ export default Vue.extend({ this.folder = null; }, onOpenFolder(folder, silent) { - const title = `${folder.name} | ${config.name} Drive`; + const title = `${folder.name} | ${(this as any).os.instanceName} Drive`; if (!silent) { // Rewrite URL @@ -90,7 +89,7 @@ export default Vue.extend({ this.folder = folder; }, onOpenFile(file, silent) { - const title = `${file.name} | ${config.name} Drive`; + const title = `${file.name} | ${(this as any).os.instanceName} Drive`; if (!silent) { // Rewrite URL diff --git a/src/client/app/mobile/views/pages/favorites.vue b/src/client/app/mobile/views/pages/favorites.vue index 491890bb0e..6b9aec6a0c 100644 --- a/src/client/app/mobile/views/pages/favorites.vue +++ b/src/client/app/mobile/views/pages/favorites.vue @@ -14,7 +14,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -29,7 +28,7 @@ export default Vue.extend({ this.fetch(); }, mounted() { - document.title = `${config.name} | %i18n:@notifications%`; + document.title = `${(this as any).os.instanceName} | %i18n:@notifications%`; }, methods: { fetch() { diff --git a/src/client/app/mobile/views/pages/followers.vue b/src/client/app/mobile/views/pages/followers.vue index 5bba534ba0..421c150856 100644 --- a/src/client/app/mobile/views/pages/followers.vue +++ b/src/client/app/mobile/views/pages/followers.vue @@ -21,7 +21,6 @@ import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; import parseAcct from '../../../../../misc/acct/parse'; import getUserName from '../../../../../misc/get-user-name'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -50,7 +49,7 @@ export default Vue.extend({ this.user = user; this.fetching = false; - document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + config.name; + document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + (this as any).os.instanceName; }); }, onLoaded() { diff --git a/src/client/app/mobile/views/pages/following.vue b/src/client/app/mobile/views/pages/following.vue index cdc009b768..ff201ff2bd 100644 --- a/src/client/app/mobile/views/pages/following.vue +++ b/src/client/app/mobile/views/pages/following.vue @@ -20,7 +20,6 @@ import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; import parseAcct from '../../../../../misc/acct/parse'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -49,7 +48,7 @@ export default Vue.extend({ this.user = user; this.fetching = false; - document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + config.name; + document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + (this as any).os.instanceName; }); }, onLoaded() { diff --git a/src/client/app/mobile/views/pages/games/reversi.vue b/src/client/app/mobile/views/pages/games/reversi.vue index 448c9b8d77..d6849a1c11 100644 --- a/src/client/app/mobile/views/pages/games/reversi.vue +++ b/src/client/app/mobile/views/pages/games/reversi.vue @@ -7,11 +7,10 @@ <script lang="ts"> import Vue from 'vue'; -import * as config from '../../../../config'; export default Vue.extend({ mounted() { - document.title = `${config.name} %i18n:@reversi%`; + document.title = `${(this as any).os.instanceName} %i18n:@reversi%`; document.documentElement.style.background = '#fff'; }, methods: { diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue index c1ed97ac13..706c9cd28b 100644 --- a/src/client/app/mobile/views/pages/home.vue +++ b/src/client/app/mobile/views/pages/home.vue @@ -49,7 +49,6 @@ import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; import XTl from './home.timeline.vue'; -import * as config from '../../../config'; export default Vue.extend({ components: { @@ -97,7 +96,7 @@ export default Vue.extend({ }, mounted() { - document.title = config.name; + document.title = (this as any).os.instanceName; Progress.start(); diff --git a/src/client/app/mobile/views/pages/messaging-room.vue b/src/client/app/mobile/views/pages/messaging-room.vue index e2016fc82a..401397d856 100644 --- a/src/client/app/mobile/views/pages/messaging-room.vue +++ b/src/client/app/mobile/views/pages/messaging-room.vue @@ -11,7 +11,6 @@ <script lang="ts"> import Vue from 'vue'; import parseAcct from '../../../../../misc/acct/parse'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -48,7 +47,7 @@ export default Vue.extend({ this.user = user; this.fetching = false; - document.title = `%i18n:@messaging%: ${Vue.filter('userName')(this.user)} | ${config.name}`; + document.title = `%i18n:@messaging%: ${Vue.filter('userName')(this.user)} | ${(this as any).os.instanceName}`; }); } } diff --git a/src/client/app/mobile/views/pages/messaging.vue b/src/client/app/mobile/views/pages/messaging.vue index 9f2beb860c..3883505281 100644 --- a/src/client/app/mobile/views/pages/messaging.vue +++ b/src/client/app/mobile/views/pages/messaging.vue @@ -8,11 +8,10 @@ <script lang="ts"> import Vue from 'vue'; import getAcct from '../../../../../misc/acct/render'; -import * as config from '../../../config'; export default Vue.extend({ mounted() { - document.title = `${config.name} %i18n:@messaging%`; + document.title = `${(this as any).os.instanceName} %i18n:@messaging%`; }, methods: { navigate(user) { diff --git a/src/client/app/mobile/views/pages/note.vue b/src/client/app/mobile/views/pages/note.vue index 8b1095c509..fee60b350e 100644 --- a/src/client/app/mobile/views/pages/note.vue +++ b/src/client/app/mobile/views/pages/note.vue @@ -16,7 +16,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import * as config from '../../../config'; export default Vue.extend({ data() { @@ -32,7 +31,7 @@ export default Vue.extend({ this.fetch(); }, mounted() { - document.title = config.name; + document.title = (this as any).os.instanceName; }, methods: { fetch() { diff --git a/src/client/app/mobile/views/pages/search.vue b/src/client/app/mobile/views/pages/search.vue index 0b37a3c7bd..6e8118ff94 100644 --- a/src/client/app/mobile/views/pages/search.vue +++ b/src/client/app/mobile/views/pages/search.vue @@ -12,7 +12,6 @@ <script lang="ts"> import Vue from 'vue'; import Progress from '../../../common/scripts/loading'; -import * as config from '../../../config'; const limit = 20; @@ -35,7 +34,7 @@ export default Vue.extend({ } }, mounted() { - document.title = `%i18n:@search%: ${this.q} | ${config.name}`; + document.title = `%i18n:@search%: ${this.q} | ${(this as any).os.instanceName}`; this.fetch(); }, diff --git a/src/client/app/mobile/views/pages/settings/settings.profile.vue b/src/client/app/mobile/views/pages/settings/settings.profile.vue index 78023ba501..3b797cdde1 100644 --- a/src/client/app/mobile/views/pages/settings/settings.profile.vue +++ b/src/client/app/mobile/views/pages/settings/settings.profile.vue @@ -91,15 +91,15 @@ export default Vue.extend({ method: 'POST', body: data }) - .then(response => response.json()) - .then(f => { - this.avatarId = f.id; - this.avatarUploading = false; - }) - .catch(e => { - this.avatarUploading = false; - alert('%18n:!@upload-failed%'); - }); + .then(response => response.json()) + .then(f => { + this.avatarId = f.id; + this.avatarUploading = false; + }) + .catch(e => { + this.avatarUploading = false; + alert('%18n:@upload-failed%'); + }); }, onBannerChange([file]) { @@ -113,15 +113,15 @@ export default Vue.extend({ method: 'POST', body: data }) - .then(response => response.json()) - .then(f => { - this.bannerId = f.id; - this.bannerUploading = false; - }) - .catch(e => { - this.bannerUploading = false; - alert('%18n:!@upload-failed%'); - }); + .then(response => response.json()) + .then(f => { + this.bannerId = f.id; + this.bannerUploading = false; + }) + .catch(e => { + this.bannerUploading = false; + alert('%18n:@upload-failed%'); + }); }, save() { diff --git a/src/client/app/mobile/views/pages/share.vue b/src/client/app/mobile/views/pages/share.vue index dcb55e6702..588b0941e6 100644 --- a/src/client/app/mobile/views/pages/share.vue +++ b/src/client/app/mobile/views/pages/share.vue @@ -12,12 +12,11 @@ <script lang="ts"> import Vue from 'vue'; -import * as config from '../../../config'; export default Vue.extend({ data() { return { - name: config.name, + name: (this as any).os.instanceName, posted: false, text: new URLSearchParams(location.search).get('text') }; diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue index 11ca1caebf..5ecd0b6950 100644 --- a/src/client/app/mobile/views/pages/user.vue +++ b/src/client/app/mobile/views/pages/user.vue @@ -67,7 +67,6 @@ import * as age from 's-age'; import parseAcct from '../../../../../misc/acct/parse'; import Progress from '../../../common/scripts/loading'; import XHome from './user/home.vue'; -import * as config from '../../../config'; export default Vue.extend({ components: { @@ -107,7 +106,7 @@ export default Vue.extend({ this.fetching = false; Progress.done(); - document.title = Vue.filter('userName')(this.user) + ' | ' + config.name; + document.title = Vue.filter('userName')(this.user) + ' | ' + (this as any).os.instanceName; }); } } diff --git a/src/client/app/mobile/views/pages/welcome.vue b/src/client/app/mobile/views/pages/welcome.vue index f8a7ff1c80..49227790ff 100644 --- a/src/client/app/mobile/views/pages/welcome.vue +++ b/src/client/app/mobile/views/pages/welcome.vue @@ -30,7 +30,7 @@ <script lang="ts"> import Vue from 'vue'; -import { apiUrl, copyright, host, name, description } from '../../../config'; +import { apiUrl, copyright, host } from '../../../config'; export default Vue.extend({ data() { @@ -39,12 +39,17 @@ export default Vue.extend({ copyright, stats: null, host, - name, - description, + name: 'Misskey', + description: '', tags: [] }; }, created() { + (this as any).os.getMeta().then(meta => { + this.name = meta.name; + this.description = meta.description; + }); + (this as any).api('stats').then(stats => { this.stats = stats; }); diff --git a/src/client/app/mobile/views/pages/widgets.vue b/src/client/app/mobile/views/pages/widgets.vue index b90d710c67..a83103632e 100644 --- a/src/client/app/mobile/views/pages/widgets.vue +++ b/src/client/app/mobile/views/pages/widgets.vue @@ -53,7 +53,6 @@ import Vue from 'vue'; import * as XDraggable from 'vuedraggable'; import * as uuid from 'uuid'; -import * as config from '../../../config'; export default Vue.extend({ components: { @@ -103,7 +102,7 @@ export default Vue.extend({ }, mounted() { - document.title = config.name; + document.title = (this as any).os.instanceName; }, methods: { |