From dbc421cb571f69a4c71691c00b094925006b95fe Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 28 Feb 2018 00:11:28 +0900 Subject: [PATCH] :v: --- src/web/app/auth/script.ts | 25 +++ src/web/app/auth/views/index.vue | 8 +- src/web/app/dev/script.ts | 18 +- src/web/app/dev/tags/index.ts | 5 - src/web/app/dev/tags/new-app-form.tag | 252 ------------------------- src/web/app/dev/tags/pages/app.tag | 32 ---- src/web/app/dev/tags/pages/apps.tag | 33 ---- src/web/app/dev/tags/pages/index.tag | 6 - src/web/app/dev/tags/pages/new-app.tag | 42 ----- src/web/app/dev/views/app.vue | 43 +++++ src/web/app/dev/views/apps.vue | 24 +++ src/web/app/dev/views/index.vue | 10 + src/web/app/dev/views/new-app.vue | 145 ++++++++++++++ src/web/app/init.ts | 2 +- webpack/webpack.config.ts | 4 +- 15 files changed, 272 insertions(+), 377 deletions(-) create mode 100644 src/web/app/auth/script.ts delete mode 100644 src/web/app/dev/tags/index.ts delete mode 100644 src/web/app/dev/tags/new-app-form.tag delete mode 100644 src/web/app/dev/tags/pages/app.tag delete mode 100644 src/web/app/dev/tags/pages/apps.tag delete mode 100644 src/web/app/dev/tags/pages/index.tag delete mode 100644 src/web/app/dev/tags/pages/new-app.tag create mode 100644 src/web/app/dev/views/app.vue create mode 100644 src/web/app/dev/views/apps.vue create mode 100644 src/web/app/dev/views/index.vue create mode 100644 src/web/app/dev/views/new-app.vue diff --git a/src/web/app/auth/script.ts b/src/web/app/auth/script.ts new file mode 100644 index 000000000..31c758ebc --- /dev/null +++ b/src/web/app/auth/script.ts @@ -0,0 +1,25 @@ +/** + * Authorize Form + */ + +// Style +import './style.styl'; + +import init from '../init'; + +import Index from './views/index.vue'; + +/** + * init + */ +init(async (launch) => { + document.title = 'Misskey | アプリの連携'; + + // Launch the app + const [app] = launch(); + + // Routing + app.$router.addRoutes([ + { path: '/:token', component: Index }, + ]); +}); diff --git a/src/web/app/auth/views/index.vue b/src/web/app/auth/views/index.vue index 1e372c0bd..17e5cc610 100644 --- a/src/web/app/auth/views/index.vue +++ b/src/web/app/auth/views/index.vue @@ -42,10 +42,14 @@ export default Vue.extend({ return { state: null, session: null, - fetching: true, - token: window.location.href.split('/').pop() + fetching: true }; }, + computed: { + token(): string { + return this.$route.params.token; + } + }, mounted() { if (!this.$root.$data.os.isSignedIn) return; diff --git a/src/web/app/dev/script.ts b/src/web/app/dev/script.ts index bb4341119..757bfca49 100644 --- a/src/web/app/dev/script.ts +++ b/src/web/app/dev/script.ts @@ -5,11 +5,25 @@ // Style import './style.styl'; -require('./tags'); import init from '../init'; +import Index from './views/index.vue'; +import Apps from './views/apps.vue'; +import AppNew from './views/new-app.vue'; +import App from './views/app.vue'; + /** * init */ -init(() => { +init(launch => { + // Launch the app + const [app] = launch(); + + // Routing + app.$router.addRoutes([ + { path: '/', component: Index }, + { path: '/app', component: Apps }, + { path: '/app/new', component: AppNew }, + { path: '/app/:id', component: App }, + ]); }); diff --git a/src/web/app/dev/tags/index.ts b/src/web/app/dev/tags/index.ts deleted file mode 100644 index 1e0c73697..000000000 --- a/src/web/app/dev/tags/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -require('./pages/index.tag'); -require('./pages/apps.tag'); -require('./pages/app.tag'); -require('./pages/new-app.tag'); -require('./new-app-form.tag'); diff --git a/src/web/app/dev/tags/new-app-form.tag b/src/web/app/dev/tags/new-app-form.tag deleted file mode 100644 index cf3c44007..000000000 --- a/src/web/app/dev/tags/new-app-form.tag +++ /dev/null @@ -1,252 +0,0 @@ - -
-
- -
-
- -
-
- -
-
- -
-
-

権限

-
- - - - - - - - - -
-

%fa:exclamation-triangle%アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。

-
- -
- - -
diff --git a/src/web/app/dev/tags/pages/app.tag b/src/web/app/dev/tags/pages/app.tag deleted file mode 100644 index 982549ed2..000000000 --- a/src/web/app/dev/tags/pages/app.tag +++ /dev/null @@ -1,32 +0,0 @@ - -

読み込み中

-
-
-

{ app.name }

-
-
-

App Secret

- -
-
- - -
diff --git a/src/web/app/dev/tags/pages/apps.tag b/src/web/app/dev/tags/pages/apps.tag deleted file mode 100644 index 6ae6031e6..000000000 --- a/src/web/app/dev/tags/pages/apps.tag +++ /dev/null @@ -1,33 +0,0 @@ - -

アプリを管理

アプリ作成 -
-

読み込み中

- -
- - -
diff --git a/src/web/app/dev/tags/pages/index.tag b/src/web/app/dev/tags/pages/index.tag deleted file mode 100644 index ca270b377..000000000 --- a/src/web/app/dev/tags/pages/index.tag +++ /dev/null @@ -1,6 +0,0 @@ -アプリ - - diff --git a/src/web/app/dev/tags/pages/new-app.tag b/src/web/app/dev/tags/pages/new-app.tag deleted file mode 100644 index 26185f278..000000000 --- a/src/web/app/dev/tags/pages/new-app.tag +++ /dev/null @@ -1,42 +0,0 @@ - -
-
-

新しいアプリを作成

-

MisskeyのAPIを利用したアプリケーションを作成できます。

-
- -
- -
diff --git a/src/web/app/dev/views/app.vue b/src/web/app/dev/views/app.vue new file mode 100644 index 000000000..9eddabbec --- /dev/null +++ b/src/web/app/dev/views/app.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/web/app/dev/views/apps.vue b/src/web/app/dev/views/apps.vue new file mode 100644 index 000000000..e8adbea2d --- /dev/null +++ b/src/web/app/dev/views/apps.vue @@ -0,0 +1,24 @@ + + + diff --git a/src/web/app/dev/views/index.vue b/src/web/app/dev/views/index.vue new file mode 100644 index 000000000..a8429a56d --- /dev/null +++ b/src/web/app/dev/views/index.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/web/app/dev/views/new-app.vue b/src/web/app/dev/views/new-app.vue new file mode 100644 index 000000000..f2e5659a4 --- /dev/null +++ b/src/web/app/dev/views/new-app.vue @@ -0,0 +1,145 @@ + + + diff --git a/src/web/app/init.ts b/src/web/app/init.ts index 5c0b4c2d3..2e90d62d7 100644 --- a/src/web/app/init.ts +++ b/src/web/app/init.ts @@ -77,7 +77,7 @@ if (localStorage.getItem('should-refresh') == 'true') { } // MiOSを初期化してコールバックする -export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => void, sw = false) => { +export default (callback: (launch: (api?: (os: MiOS) => API) => [Vue, MiOS]) => void, sw = false) => { const os = new MiOS(sw); os.init(() => { diff --git a/webpack/webpack.config.ts b/webpack/webpack.config.ts index 69e05dc8c..775ecbd34 100644 --- a/webpack/webpack.config.ts +++ b/webpack/webpack.config.ts @@ -38,8 +38,8 @@ module.exports = Object.keys(langs).map(lang => { //ch: './src/web/app/ch/script.ts', //stats: './src/web/app/stats/script.ts', //status: './src/web/app/status/script.ts', - //dev: './src/web/app/dev/script.ts', - //auth: './src/web/app/auth/script.ts', + dev: './src/web/app/dev/script.ts', + auth: './src/web/app/auth/script.ts', sw: './src/web/app/sw.js' };