aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-03-02 23:58:08 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-03-02 23:58:08 +0100
commitc800dd31355064be8d3de8a74326b1c2b974c78e (patch)
treec22d9c1a83fafe009f16483bc88a96bbdd49dba0 /src-vue/src/views
parentc60b7b606dd0b4bc7108f9a768a4545f0781730c (diff)
parent441b81ef0f46062713f618a57e0d297c8a7a70d3 (diff)
downloadFlightCore-c800dd31355064be8d3de8a74326b1c2b974c78e.tar.gz
FlightCore-c800dd31355064be8d3de8a74326b1c2b974c78e.zip
Merge branch 'main' into feat/basic-log-parsingfeat/basic-log-parsing
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/DeveloperView.vue54
-rw-r--r--src-vue/src/views/PlayView.vue17
-rw-r--r--src-vue/src/views/mods/ThunderstoreModsView.vue4
3 files changed, 72 insertions, 3 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 23410c23..c73aef6a 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -40,6 +40,10 @@
Disable all but core mods
</el-button>
+ <el-button type="primary" @click="forceInstallNorthstar">
+ Force reinstall Northstar
+ </el-button>
+
<el-button type="primary" @click="getInstalledMods">
Get installed mods
</el-button>
@@ -51,7 +55,6 @@
<el-button type="primary" @click="clearFlightCorePersistentStore">
Delete FlightCore persistent store
</el-button>
-
<h3>Tech support</h3>
<el-button type="primary" @click="parseGivenLogTextForMods">
@@ -88,6 +91,9 @@
</el-table-column>
</el-table>
</div>
+
+ <h3>Testing</h3>
+ <pull-requests-selector />
</el-scrollbar>
</div>
</template>
@@ -98,12 +104,17 @@ import { invoke } from "@tauri-apps/api";
import { ElNotification } from "element-plus";
import { GameInstall } from "../utils/GameInstall";
import { Store } from 'tauri-plugin-store-api';
+import { ReleaseCanal } from "../utils/ReleaseCanal";
+import PullRequestsSelector from "../components/PullRequestsSelector.vue";
import { ParsedLogResults } from "../../../src-tauri/bindings/ParsedLogResults";
import { ParsedModFromLog } from "../../../src-tauri/bindings/ParsedModFromLog";
const persistentStore = new Store('flight-core-settings.json');
export default defineComponent({
name: "DeveloperView",
+ components: {
+ PullRequestsSelector
+ },
data() {
return {
mod_to_install_field_string : "",
@@ -249,6 +260,47 @@ export default defineComponent({
// ...and save
await persistentStore.save();
},
+ async forceInstallNorthstar() {
+ let game_install = {
+ game_path: this.$store.state.game_path,
+ install_type: this.$store.state.install_type
+ } as GameInstall;
+
+ // Send notification telling the user to wait for the process to finish
+ const notification = ElNotification({
+ title: 'Force reinstalling Northstar',
+ message: 'Please wait',
+ duration: 0,
+ type: 'info',
+ position: 'bottom-right'
+ });
+
+ let install_northstar_result = invoke("install_northstar_caller", { gamePath: game_install.game_path, northstarPackageName: ReleaseCanal.RELEASE });
+ await install_northstar_result
+ .then((message) => {
+ // Send notification
+ ElNotification({
+ title: `Done`,
+ message: `Successfully reinstalled Northstar`,
+ type: 'success',
+ position: 'bottom-right'
+ });
+ this.$store.commit('checkNorthstarUpdates');
+ })
+ .catch((error) => {
+ ElNotification({
+ title: 'Error',
+ message: error,
+ type: 'error',
+ position: 'bottom-right'
+ });
+ console.error(error);
+ })
+ .finally(() => {
+ // Clear old notification
+ notification.close();
+ });
+ },
async parseGivenLogTextForMods() {
let current_log_content = this.log_content;
await invoke<[ParsedLogResults]>("parse_given_log_text", { logText: current_log_content })
diff --git a/src-vue/src/views/PlayView.vue b/src-vue/src/views/PlayView.vue
index 670d8395..beca6724 100644
--- a/src-vue/src/views/PlayView.vue
+++ b/src-vue/src/views/PlayView.vue
@@ -15,6 +15,12 @@ export default defineComponent({
northstarVersion(): string {
return this.$store.state.installed_northstar_version;
},
+ playerCount(): number {
+ return this.$store.state.player_count;
+ },
+ serverCount(): number {
+ return this.$store.state.server_count;
+ },
},
methods: {
showChangelogPage() {
@@ -32,6 +38,13 @@ export default defineComponent({
<div v-if="northstarVersion !== ''" class="fc_changelog__link" @click="showChangelogPage">
(see patch notes)
</div>
+ <div v-if="playerCount >= 0" class="fc-stats__container">
+ {{ playerCount }} players,
+ {{ serverCount }} servers
+ </div>
+ <div v-else="playerCount >= 0" class="fc-stats__container">
+ Unable to load playercount
+ </div>
</div>
<div>
<PlayButton />
@@ -69,6 +82,10 @@ export default defineComponent({
color: rgb(168, 168, 168);
}
+.fc-stats__container {
+ margin-top: 3px;
+}
+
.fc_northstar__version, .fc_changelog__link {
display: inline-block;
}
diff --git a/src-vue/src/views/mods/ThunderstoreModsView.vue b/src-vue/src/views/mods/ThunderstoreModsView.vue
index aaf15220..19809f3e 100644
--- a/src-vue/src/views/mods/ThunderstoreModsView.vue
+++ b/src-vue/src/views/mods/ThunderstoreModsView.vue
@@ -46,11 +46,11 @@
<script lang="ts">
import { defineComponent, ref } from 'vue';
-import { ThunderstoreMod } from "../../utils/thunderstore/ThunderstoreMod";
+import { ThunderstoreMod } from "../../../../src-tauri/bindings/ThunderstoreMod";
import ThunderstoreModCard from "../../components/ThunderstoreModCard.vue";
import { ElScrollbar, ScrollbarInstance } from "element-plus";
import { SortOptions } from "../../utils/SortOptions.d";
-import { ThunderstoreModVersion } from '../../utils/thunderstore/ThunderstoreModVersion';
+import { ThunderstoreModVersion } from "../../../../src-tauri/bindings/ThunderstoreModVersion";
export default defineComponent({
name: "ThunderstoreModsView",