up
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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' }
|
||||
|
||||
Reference in New Issue
Block a user