This commit is contained in:
syuilo 2018-09-15 21:48:10 +09:00
parent 8e1f3c391f
commit ec372080ff
13 changed files with 22 additions and 303 deletions

View file

@ -101,7 +101,6 @@
"dompurify": "1.0.5", "dompurify": "1.0.5",
"double-ended-queue": "2.1.0-0", "double-ended-queue": "2.1.0-0",
"elasticsearch": "15.1.1", "elasticsearch": "15.1.1",
"element-ui": "2.4.6",
"emojilib": "2.3.0", "emojilib": "2.3.0",
"escape-regexp": "0.0.1", "escape-regexp": "0.0.1",
"eslint": "5.0.1", "eslint": "5.0.1",
@ -132,7 +131,6 @@
"insert-text-at-cursor": "0.1.1", "insert-text-at-cursor": "0.1.1",
"is-root": "2.0.0", "is-root": "2.0.0",
"is-url": "1.2.4", "is-url": "1.2.4",
"jquery": "3.3.1",
"js-yaml": "3.12.0", "js-yaml": "3.12.0",
"jsdom": "11.12.0", "jsdom": "11.12.0",
"koa": "2.5.1", "koa": "2.5.1",
@ -160,8 +158,6 @@
"ms": "2.1.1", "ms": "2.1.1",
"nan": "2.11.0", "nan": "2.11.0",
"nested-property": "0.0.7", "nested-property": "0.0.7",
"node-sass": "4.9.3",
"node-sass-json-importer": "4.0.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"object-assign-deep": "0.4.0", "object-assign-deep": "0.4.0",
"on-build-webpack": "0.1.0", "on-build-webpack": "0.1.0",

View file

@ -50,15 +50,15 @@
</div> </div>
<div class="player" v-if="game.isEnded"> <div class="player" v-if="game.isEnded">
<el-button-group> <div>
<el-button type="primary" @click="logPos = 0" :disabled="logPos == 0">%fa:angle-double-left%</el-button> <button @click="logPos = 0" :disabled="logPos == 0">%fa:angle-double-left%</button>
<el-button type="primary" @click="logPos--" :disabled="logPos == 0">%fa:angle-left%</el-button> <button @click="logPos--" :disabled="logPos == 0">%fa:angle-left%</button>
</el-button-group> </div>
<span>{{ logPos }} / {{ logs.length }}</span> <span>{{ logPos }} / {{ logs.length }}</span>
<el-button-group> <div>
<el-button type="primary" @click="logPos++" :disabled="logPos == logs.length">%fa:angle-right%</el-button> <button @click="logPos++" :disabled="logPos == logs.length">%fa:angle-right%</button>
<el-button type="primary" @click="logPos = logs.length" :disabled="logPos == logs.length">%fa:angle-double-right%</el-button> <button @click="logPos = logs.length" :disabled="logPos == logs.length">%fa:angle-double-right%</button>
</el-button-group> </div>
</div> </div>
<div class="info"> <div class="info">

View file

@ -3,7 +3,6 @@
<h1>%i18n:@title%</h1> <h1>%i18n:@title%</h1>
<p>%i18n:@sub-title%</p> <p>%i18n:@sub-title%</p>
<div class="play"> <div class="play">
<!--<el-button round>フリーマッチ(準備中)</el-button>-->
<form-button primary round @click="match">%i18n:@invite%</form-button> <form-button primary round @click="match">%i18n:@invite%</form-button>
<details> <details>
<summary>%i18n:@rule%</summary> <summary>%i18n:@rule%</summary>

View file

@ -59,11 +59,6 @@
</header> </header>
<div> <div>
<el-alert v-for="message in messages"
:title="message.text"
:type="message.type"
:key="message.id"/>
<template v-for="item in form"> <template v-for="item in form">
<mk-switch v-if="item.type == 'switch'" v-model="item.value" :key="item.id" :text="item.label" @change="onChangeForm(item)">{{ item.desc || '' }}</mk-switch> <mk-switch v-if="item.type == 'switch'" v-model="item.value" :key="item.id" :text="item.label" @change="onChangeForm(item)">{{ item.desc || '' }}</mk-switch>
@ -93,7 +88,7 @@
</header> </header>
<div> <div>
<el-input v-model="item.value" @change="onChangeForm(item)"/> <input v-model="item.value" @change="onChangeForm(item)"/>
</div> </div>
</div> </div>
</template> </template>

View file

@ -6,7 +6,6 @@ import VueRouter from 'vue-router';
// Style // Style
import './style.styl'; import './style.styl';
import '../../element.scss';
import init from '../init'; import init from '../init';
import fuckAdBlock from '../common/scripts/fuck-ad-block'; import fuckAdBlock from '../common/scripts/fuck-ad-block';

View file

@ -1,7 +1,6 @@
<template> <template>
<div class="root"> <div class="root">
<template v-if="!fetching"> <template v-if="!fetching">
<el-progress :text-inside="true" :stroke-width="18" :percentage="Math.floor((usage / capacity) * 100)"/>
<p><b>{{ capacity | bytes }}</b>%i18n:max%<b>{{ usage | bytes }}</b>%i18n:in-use%</p> <p><b>{{ capacity | bytes }}</b>%i18n:max%<b>{{ usage | bytes }}</b>%i18n:in-use%</p>
</template> </template>
</div> </div>

View file

@ -19,7 +19,7 @@
</label> </label>
<label class="ui from group"> <label class="ui from group">
<p>%i18n:@birthday%</p> <p>%i18n:@birthday%</p>
<el-date-picker v-model="birthday" type="date" value-format="yyyy-MM-dd"/> <input type="date" v-model="birthday"/>
</label> </label>
<button class="ui primary" @click="save">%i18n:@save%</button> <button class="ui primary" @click="save">%i18n:@save%</button>
<section> <section>

View file

@ -87,13 +87,11 @@
<span>%i18n:@enable-sounds-desc%</span> <span>%i18n:@enable-sounds-desc%</span>
</mk-switch> </mk-switch>
<label>%i18n:@volume%</label> <label>%i18n:@volume%</label>
<el-slider <input type="range"
v-model="soundVolume" v-model="soundVolume"
:show-input="true"
:format-tooltip="v => `${v * 100}%`"
:disabled="!enableSounds" :disabled="!enableSounds"
:max="1" max="1"
:step="0.1" step="0.1"
/> />
<button class="ui button" @click="soundTest">%fa:volume-up% %i18n:@test%</button> <button class="ui button" @click="soundTest">%fa:volume-up% %i18n:@test%</button>
</section> </section>
@ -105,14 +103,15 @@
<section class="web" v-show="page == 'web'"> <section class="web" v-show="page == 'web'">
<h1>%i18n:@language%</h1> <h1>%i18n:@language%</h1>
<el-select v-model="lang" placeholder="%i18n:@pick-language%"> <select v-model="lang" placeholder="%i18n:@pick-language%">
<el-option-group label="%i18n:@recommended%"> <optgroup label="%i18n:@recommended%">
<el-option label="%i18n:@auto%" :value="null"/> <option value="">%i18n:@auto%</option>
</el-option-group> </optgroup>
<el-option-group label="%i18n:@specify-language%">
<el-option v-for="x in langs" :label="x[1]" :value="x[0]" :key="x[0]"/> <optgroup label="%i18n:@specify-language%">
</el-option-group> <option v-for="x in langs" :value="x[0]" :key="x[0]">{{ x[1] }}</option>
</el-select> </optgroup>
</select>
<div class="none ui info"> <div class="none ui info">
<p>%fa:info-circle%%i18n:@language-desc%</p> <p>%fa:info-circle%%i18n:@language-desc%</p>
</div> </div>
@ -207,10 +206,6 @@
<mk-switch v-model="enableExperimentalFeatures" text="%i18n:@experimental%"> <mk-switch v-model="enableExperimentalFeatures" text="%i18n:@experimental%">
<span>%i18n:@experimental-desc%</span> <span>%i18n:@experimental-desc%</span>
</mk-switch> </mk-switch>
<details v-if="debug">
<summary>%i18n:@tools%</summary>
<button class="ui button block" @click="taskmngr">%i18n:@task-manager%</button>
</details>
</section> </section>
</div> </div>
</div> </div>
@ -228,7 +223,6 @@ import XSignins from './settings.signins.vue';
import XDrive from './settings.drive.vue'; import XDrive from './settings.drive.vue';
import { url, langs, version } from '../../../config'; import { url, langs, version } from '../../../config';
import checkForUpdate from '../../../common/scripts/check-for-update'; import checkForUpdate from '../../../common/scripts/check-for-update';
import MkTaskManager from './taskmanager.vue';
export default Vue.extend({ export default Vue.extend({
components: { components: {
@ -408,9 +402,6 @@ export default Vue.extend({
}); });
}, },
methods: { methods: {
taskmngr() {
(this as any).os.new(MkTaskManager);
},
customizeHome() { customizeHome() {
this.$router.push('/i/customize-home'); this.$router.push('/i/customize-home');
this.$emit('done'); this.$emit('done');

View file

@ -1,219 +0,0 @@
<template>
<mk-window ref="window" width="750px" height="500px" @closed="$destroy" name="TaskManager">
<span slot="header" :class="$style.header">%fa:stethoscope%%i18n:@title%</span>
<el-tabs :class="$style.content">
<el-tab-pane label="Requests">
<el-table
:data="os.requests"
style="width: 100%"
:default-sort="{prop: 'date', order: 'descending'}"
>
<el-table-column type="expand">
<template slot-scope="props">
<pre>{{ props.row.data }}</pre>
<pre>{{ props.row.res }}</pre>
</template>
</el-table-column>
<el-table-column
label="Requested at"
prop="date"
sortable
>
<template slot-scope="scope">
<b style="margin-right: 8px">{{ scope.row.date.getTime() }}</b>
<span>(<mk-time :time="scope.row.date"/>)</span>
</template>
</el-table-column>
<el-table-column
label="Name"
>
<template slot-scope="scope">
<b>{{ scope.row.name }}</b>
</template>
</el-table-column>
<el-table-column
label="Status"
>
<template slot-scope="scope">
<span>{{ scope.row.status || '(pending)' }}</span>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="Streams">
<el-table
:data="os.connections"
style="width: 100%"
>
<el-table-column
label="Uptime"
>
<template slot-scope="scope">
<mk-timer v-if="scope.row.connectedAt" :time="scope.row.connectedAt"/>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column
label="Name"
>
<template slot-scope="scope">
<b>{{ scope.row.name == '' ? '[Home]' : scope.row.name }}</b>
</template>
</el-table-column>
<el-table-column
label="User"
>
<template slot-scope="scope">
<span>{{ scope.row.user || '(anonymous)' }}</span>
</template>
</el-table-column>
<el-table-column
prop="state"
label="State"
/>
<el-table-column
prop="in"
label="In"
/>
<el-table-column
prop="out"
label="Out"
/>
</el-table>
</el-tab-pane>
<el-tab-pane label="Streams (Inspect)">
<el-tabs type="card" style="height:50%">
<el-tab-pane v-for="c in os.connections" :label="c.name == '' ? '[Home]' : c.name" :key="c.id" :name="c.id" ref="connectionsTab">
<div style="padding: 12px 0 0 12px">
<el-button size="mini" @click="send(c)">Send</el-button>
<el-button size="mini" type="warning" @click="c.isSuspended = true" v-if="!c.isSuspended">Suspend</el-button>
<el-button size="mini" type="success" @click="c.isSuspended = false" v-else>Resume</el-button>
<el-button size="mini" type="danger" @click="c.close">Disconnect</el-button>
</div>
<el-table
:data="c.inout"
style="width: 100%"
:default-sort="{prop: 'at', order: 'descending'}"
>
<el-table-column type="expand">
<template slot-scope="props">
<pre>{{ props.row.data }}</pre>
</template>
</el-table-column>
<el-table-column
label="Date"
prop="at"
sortable
>
<template slot-scope="scope">
<b style="margin-right: 8px">{{ scope.row.at.getTime() }}</b>
<span>(<mk-time :time="scope.row.at"/>)</span>
</template>
</el-table-column>
<el-table-column
label="Type"
>
<template slot-scope="scope">
<span>{{ getMessageType(scope.row.data) }}</span>
</template>
</el-table-column>
<el-table-column
label="Incoming / Outgoing"
prop="type"
/>
</el-table>
</el-tab-pane>
</el-tabs>
</el-tab-pane>
<el-tab-pane label="Windows">
<el-table
:data="Array.from(os.windows.windows)"
style="width: 100%"
>
<el-table-column
label="Name"
>
<template slot-scope="scope">
<b>{{ scope.row.name || '(unknown)' }}</b>
</template>
</el-table-column>
<el-table-column
label="Operations"
>
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="scope.row.close">Close</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</mk-window>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
mounted() {
(this as any).os.windows.on('added', this.onWindowsChanged);
(this as any).os.windows.on('removed', this.onWindowsChanged);
},
beforeDestroy() {
(this as any).os.windows.off('added', this.onWindowsChanged);
(this as any).os.windows.off('removed', this.onWindowsChanged);
},
methods: {
getMessageType(data): string {
return data.type ? data.type : '-';
},
onWindowsChanged() {
this.$forceUpdate();
},
send(c) {
(this as any).apis.input({
title: 'Send a JSON message',
allowEmpty: false
}).then(json => {
c.send(JSON.parse(json));
});
}
}
});
</script>
<style lang="stylus" module>
.header
> [data-fa]
margin-right 4px
.content
height 100%
overflow auto
</style>
<style>
.el-tabs__header {
margin-bottom: 0 !important;
}
.el-tabs__item {
padding: 0 20px !important;
}
</style>

View file

@ -7,9 +7,6 @@ import Vuex from 'vuex';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import * as TreeView from 'vue-json-tree-view'; import * as TreeView from 'vue-json-tree-view';
import VAnimateCss from 'v-animate-css'; import VAnimateCss from 'v-animate-css';
import Element from 'element-ui';
import ElementLocaleEn from 'element-ui/lib/locale/lang/en';
import ElementLocaleJa from 'element-ui/lib/locale/lang/ja';
import VModal from 'vue-js-modal'; import VModal from 'vue-js-modal';
import App from './app.vue'; import App from './app.vue';
@ -17,18 +14,10 @@ import checkForUpdate from './common/scripts/check-for-update';
import MiOS, { API } from './mios'; import MiOS, { API } from './mios';
import { version, codename, lang } from './config'; import { version, codename, lang } from './config';
let elementLocale;
switch (lang) {
case 'ja-JP': elementLocale = ElementLocaleJa; break;
case 'en-US': elementLocale = ElementLocaleEn; break;
default: elementLocale = ElementLocaleEn; break;
}
Vue.use(Vuex); Vue.use(Vuex);
Vue.use(VueRouter); Vue.use(VueRouter);
Vue.use(TreeView); Vue.use(TreeView);
Vue.use(VAnimateCss); Vue.use(VAnimateCss);
Vue.use(Element, { locale: elementLocale });
Vue.use(VModal); Vue.use(VModal);
// Register global directives // Register global directives

View file

@ -6,7 +6,6 @@ import VueRouter from 'vue-router';
// Style // Style
import './style.styl'; import './style.styl';
import '../../element.scss';
import init from '../init'; import init from '../init';

View file

@ -1,12 +0,0 @@
/* Element variable definitons */
/* SEE: http://element.eleme.io/#/en-US/component/custom-theme */
@import '../const.json';
/* theme color */
$--color-primary: $themeColor;
/* icon font path, required */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";

View file

@ -7,7 +7,6 @@ import * as webpack from 'webpack';
import chalk from 'chalk'; import chalk from 'chalk';
import rndstr from 'rndstr'; import rndstr from 'rndstr';
const { VueLoaderPlugin } = require('vue-loader'); const { VueLoaderPlugin } = require('vue-loader');
const jsonImporter = require('node-sass-json-importer');
const minifyHtml = require('html-minifier').minify; const minifyHtml = require('html-minifier').minify;
const WebpackOnBuildPlugin = require('on-build-webpack'); const WebpackOnBuildPlugin = require('on-build-webpack');
//const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); //const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
@ -183,22 +182,6 @@ module.exports = {
loader: 'stylus-loader' loader: 'stylus-loader'
}] }]
}] }]
}, {
test: /\.scss$/,
exclude: /node_modules/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader',
options: {
minimize: true
}
}, {
loader: 'sass-loader',
options: {
importer: jsonImporter(),
}
}]
}, { }, {
test: /\.css$/, test: /\.css$/,
use: [{ use: [{