From 5f869e5d8735f3c058554b59e2c33f40ae7ef959 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Aug 2021 17:55:16 +0900 Subject: [PATCH] Improve client --- locales/ja-JP.yml | 1 + src/client/components/ui/button.vue | 4 +- src/client/pages/_error_.vue | 26 +++++--- src/client/pages/my-antennas/create.vue | 51 ++++++++++++++++ src/client/pages/my-antennas/edit.vue | 56 ++++++++++++++++++ .../{index.antenna.vue => editor.vue} | 28 +++++---- src/client/pages/my-antennas/index.vue | 59 ++++++++----------- src/client/style.scss | 1 + src/client/themes/_light.json5 | 2 +- src/client/themes/l-vivid.json5 | 2 +- 10 files changed, 171 insertions(+), 59 deletions(-) create mode 100644 src/client/pages/my-antennas/create.vue create mode 100644 src/client/pages/my-antennas/edit.vue rename src/client/pages/my-antennas/{index.antenna.vue => editor.vue} (92%) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ef6a094fd..3a00c28dd 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -769,6 +769,7 @@ sent: "送信" received: "受信" searchResult: "検索結果" hashtags: "ハッシュタグ" +troubleshooting: "トラブルシューティング" _docs: continueReading: "続きを読む" diff --git a/src/client/components/ui/button.vue b/src/client/components/ui/button.vue index c92f30db9..8a8394382 100644 --- a/src/client/components/ui/button.vue +++ b/src/client/components/ui/button.vue @@ -1,6 +1,6 @@ @@ -19,6 +19,11 @@ export default defineComponent({ components: { MkButton, }, + props: { + error: { + required: false, + } + }, data() { return { [symbols.PAGE_INFO]: { @@ -32,10 +37,11 @@ export default defineComponent({ diff --git a/src/client/pages/my-antennas/create.vue b/src/client/pages/my-antennas/create.vue new file mode 100644 index 000000000..d4762411e --- /dev/null +++ b/src/client/pages/my-antennas/create.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/client/pages/my-antennas/edit.vue b/src/client/pages/my-antennas/edit.vue new file mode 100644 index 000000000..9deafb423 --- /dev/null +++ b/src/client/pages/my-antennas/edit.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/client/pages/my-antennas/index.antenna.vue b/src/client/pages/my-antennas/editor.vue similarity index 92% rename from src/client/pages/my-antennas/index.antenna.vue rename to src/client/pages/my-antennas/editor.vue index 3a74a9d7f..882d48e64 100644 --- a/src/client/pages/my-antennas/index.antenna.vue +++ b/src/client/pages/my-antennas/editor.vue @@ -1,8 +1,7 @@ @@ -117,7 +116,7 @@ export default defineComponent({ methods: { async saveAntenna() { if (this.antenna.id == null) { - await os.api('antennas/create', { + await os.apiWithDialog('antennas/create', { name: this.name, src: this.src, userListId: this.userListId, @@ -132,7 +131,7 @@ export default defineComponent({ }); this.$emit('created'); } else { - await os.api('antennas/update', { + await os.apiWithDialog('antennas/update', { antennaId: this.antenna.id, name: this.name, src: this.src, @@ -146,9 +145,8 @@ export default defineComponent({ keywords: this.keywords.trim().split('\n').map(x => x.trim().split(' ')), excludeKeywords: this.excludeKeywords.trim().split('\n').map(x => x.trim().split(' ')), }); + this.$emit('updated'); } - - os.success(); }, async deleteAntenna() { @@ -180,9 +178,13 @@ export default defineComponent({ diff --git a/src/client/pages/my-antennas/index.vue b/src/client/pages/my-antennas/index.vue index 57c55cefd..c27bb2c15 100644 --- a/src/client/pages/my-antennas/index.vue +++ b/src/client/pages/my-antennas/index.vue @@ -1,12 +1,12 @@