Misskeyのバージョンもクライアントの環境変数に突っ込むように

This commit is contained in:
syuilo 2018-11-03 17:04:33 +09:00
parent dcdc19e436
commit fc2f020eac
10 changed files with 99 additions and 261 deletions

321
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -16,6 +16,9 @@
<!-- <li @click="nav('drive')" :class="{ active: page == 'drive' }">%fa:cloud .fw%%i18n:common.drive%</li> -->
<!-- <li @click="nav('update')" :class="{ active: page == 'update' }">%i18n:@update%</li> -->
</ul>
<div class="version">
<small>Misskey {{ version }}</small>
</div>
</nav>
<main>
<div v-show="page == 'dashboard'"><x-dashboard/></div>
@ -32,6 +35,7 @@
<script lang="ts">
import Vue from "vue";
import { version } from '../../config';
import XDashboard from "./dashboard.vue";
import XInstance from "./instance.vue";
import XEmoji from "./emoji.vue";
@ -50,7 +54,8 @@ export default Vue.extend({
},
data() {
return {
page: 'dashboard'
page: 'dashboard',
version
};
},
methods: {
@ -98,6 +103,15 @@ export default Vue.extend({
white-space nowrap
font-size 15px
> .version
margin 16px
padding-top 16px
border-top solid 1px #555
text-align center
> small
opacity 0.7
> ul
margin 0
padding 0
@ -110,10 +124,14 @@ export default Vue.extend({
margin 0
cursor pointer
user-select none
color #eee
transition margin-left 0.2s ease
&:hover
color #fff
> [data-fa]
margin-right 4px
margin-right 6px
&.active
margin-left 8px

View file

@ -1,5 +1,5 @@
import MiOS from '../../mios';
import { version as current } from '../../config';
import { clientVersion as current } from '../../config';
export default async function(mios: MiOS, force = false, silent = false) {
const meta = await mios.getMeta(force);

View file

@ -3,7 +3,7 @@
</template>
<script lang="ts">
import { version, codename } from '../../../config';
import { clientVersion as version, codename } from '../../../config';
import define from '../../../common/define-widget';
export default define({
name: 'version'

View file

@ -3,6 +3,7 @@ declare const _LANGS_: string;
declare const _THEME_COLOR_: string;
declare const _COPYRIGHT_: string;
declare const _VERSION_: string;
declare const _CLIENT_VERSION_: string;
declare const _CODENAME_: string;
declare const _ENV_: string;
@ -18,5 +19,6 @@ export const langs = _LANGS_;
export const themeColor = _THEME_COLOR_;
export const copyright = _COPYRIGHT_;
export const version = _VERSION_;
export const clientVersion = _CLIENT_VERSION_;
export const codename = _CODENAME_;
export const env = _ENV_;

View file

@ -291,7 +291,7 @@ import X2fa from './settings.2fa.vue';
import XApps from './settings.apps.vue';
import XSignins from './settings.signins.vue';
import XTags from './settings.tags.vue';
import { url, langs, version } from '../../../config';
import { url, langs, clientVersion as version } from '../../../config';
import checkForUpdate from '../../../common/scripts/check-for-update';
export default Vue.extend({

View file

@ -14,7 +14,7 @@ import VueHotkey from './common/hotkey';
import App from './app.vue';
import checkForUpdate from './common/scripts/check-for-update';
import MiOS, { API } from './mios';
import { version, codename, lang } from './config';
import { clientVersion as version, codename, lang } from './config';
import { builtinThemes, lightTheme, applyTheme } from './theme';
if (localStorage.getItem('theme') == null) {

View file

@ -4,7 +4,7 @@ import { EventEmitter } from 'eventemitter3';
import * as uuid from 'uuid';
import initStore from './store';
import { apiUrl, version, lang } from './config';
import { apiUrl, clientVersion as version, lang } from './config';
import Progress from './common/scripts/loading';
import Err from './common/views/components/connect-failed.vue';

View file

@ -154,7 +154,7 @@
<script lang="ts">
import Vue from 'vue';
import { apiUrl, version, codename, langs } from '../../../config';
import { apiUrl, clientVersion as version, codename, langs } from '../../../config';
import checkForUpdate from '../../../common/scripts/check-for-update';
export default Vue.extend({

View file

@ -70,7 +70,8 @@ const output = {
const consts = {
_THEME_COLOR_: constants.themeColor,
_COPYRIGHT_: constants.copyright,
_VERSION_: version,
_VERSION_: meta.version,
_CLIENT_VERSION_: version,
_CODENAME_: codename,
_LANG_: '%lang%',
_LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]),