diff options
Diffstat (limited to 'src-vue')
-rw-r--r-- | src-vue/src/views/DeveloperView.vue | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 52117b8d..bca473fb 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -5,6 +5,38 @@ This page is designed for developers. Some of the buttons here can break your Northstar install if you do not know what you're doing! </el-alert> + <el-button type="primary" @click="getTags"> + Get tags + </el-button> + + <el-select v-model="firstTag" class="m-2" placeholder="First tag"> + <el-option + v-for="item in ns_release_tags" + :key="item.value" + :label="item.label" + :value="item" + /> + </el-select> + <el-select v-model="secondTag" class="m-2" placeholder="Second tag"> + <el-option + v-for="item in ns_release_tags" + :key="item.value" + :label="item.label" + :value="item" + /> + </el-select> + + <el-button type="primary" @click="compareTags"> + Compare Tags + </el-button> + + <el-input + v-model="release_notes_text" + type="textarea" + :rows="5" + placeholder="Output" + /> + <h3>Basic:</h3> <el-button type="primary" @click="disableDevMode"> @@ -53,6 +85,7 @@ import { defineComponent } from "vue"; import { invoke } from "@tauri-apps/api"; import { ElNotification } from "element-plus"; import { GameInstall } from "../utils/GameInstall"; +import { TagWrapper } from "../../../src-tauri/bindings/TagWrapper"; import PullRequestsSelector from "../components/PullRequestsSelector.vue"; export default defineComponent({ @@ -63,8 +96,30 @@ export default defineComponent({ data() { return { mod_to_install_field_string : "", + release_notes_text : "", + first_tag: { label: '', value: {name: ''} }, + second_tag: { label: '', value: {name: ''} }, + ns_release_tags: [] as TagWrapper[], } }, + computed: { + firstTag: { + get(): TagWrapper { + return this.first_tag; + }, + set(value: TagWrapper) { + this.first_tag = value; + } + }, + secondTag: { + get(): TagWrapper { + return this.second_tag; + }, + set(value: TagWrapper) { + this.second_tag = value; + } + }, + }, methods: { disableDevMode() { this.$store.commit('toggleDeveloperMode'); @@ -152,6 +207,46 @@ export default defineComponent({ }); }); }, + async getTags() { + await invoke<TagWrapper[]>("get_list_of_tags") + .then((message) => { + this.ns_release_tags = message; + ElNotification({ + title: "Done", + message: "Fetched tags", + type: 'success', + position: 'bottom-right' + }); + }) + .catch((error) => { + ElNotification({ + title: 'Error', + message: error, + type: 'error', + position: 'bottom-right' + }); + }); + }, + async compareTags() { + await invoke<string>("compare_tags", {firstTag: this.firstTag.value, secondTag: this.secondTag.value}) + .then((message) => { + this.release_notes_text = message; + ElNotification({ + title: "Done", + message: "Generated release notes", + type: 'success', + position: 'bottom-right' + }); + }) + .catch((error) => { + ElNotification({ + title: 'Error', + message: error, + type: 'error', + position: 'bottom-right' + }); + }); + }, } }); </script> |