This commit is contained in:
2026-10-18 04:32:58 +07:00
parent e85d899fd7
commit c36d3fd314
14 changed files with 446 additions and 50 deletions
+17 -5
View File
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { NAlert, NButton, NCard, NInput, NSelect, NSpace, useMessage } from 'naive-ui'
import { onMounted, onUnmounted, ref } from 'vue'
import type { OnlineIntent, OnlineState } from '../types/online'
import { DEFAULT_SERVER, type OnlineIntent, type OnlineState } from '../types/online'
defineProps<{ outputOpen: boolean; selectedKey: string | null; selectedName: string | null }>()
const bridge = window.screenBridge
const message = useMessage()
const isReady = ref(false)
const state = ref<OnlineState>({
server: '',
server: DEFAULT_SERVER,
authenticated: false,
remembered: false,
busy: false,
@@ -23,7 +23,7 @@ const state = ref<OnlineState>({
preparation: { active: false, completed: 0, total: 0, downloadedBytes: 0, error: '' },
packagesRevision: 0,
})
const server = ref('')
const server = ref(DEFAULT_SERVER)
const email = ref('')
const password = ref('')
const gameId = ref<number | null>(null)
@@ -90,7 +90,7 @@ onUnmounted(() => clearInterval(timer))
<template>
<n-card v-if="bridge && isReady" title="Игра и сервер">
<n-space vertical>
<div class="connection-content">
<template v-if="!state.authenticated">
<label for="server">Адрес сервера</label>
<n-input
@@ -248,6 +248,18 @@ onUnmounted(() => clearInterval(timer))
</p>
<n-button v-if="state.canCancel" @click="cancel">Отменить загрузку</n-button>
</template>
</n-space>
</div>
</n-card>
</template>
<style scoped>
.connection-content {
display: flex;
flex-direction: column;
gap: 12px;
}
.connection-content > button {
align-self: flex-start;
}
</style>
+2
View File
@@ -1,5 +1,7 @@
import type { ScreenStep } from './screen.js'
export const DEFAULT_SERVER = 'https://evening-detective.crabs-games.art'
export type OnlineIntent =
| { action: 'plan-save'; key: string; steps: ScreenStep[] }
| { action: 'plan-refresh' }