chore: gitea actions
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { ElConfigProvider } from 'element-plus'
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
|
||||
const locale = zhCn
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElConfigProvider :locale="locale">
|
||||
<ElConfigProvider :locale="zhCn">
|
||||
<router-view />
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
|
||||
3
packages/core/src/layout/online-layout.vue
Normal file
3
packages/core/src/layout/online-layout.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>在线版</div>
|
||||
</template>
|
||||
0
packages/core/src/layout/stand-alone.vue
Normal file
0
packages/core/src/layout/stand-alone.vue
Normal file
@@ -5,14 +5,14 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: () => import('../views/Home.vue'),
|
||||
component: () => import('../views/index.vue'),
|
||||
meta: { title: '首页' },
|
||||
},
|
||||
// 可以添加更多路由
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(), // 使用 Hash 模式兼容 Electron
|
||||
history: createWebHashHistory('/dcs-web'), // 使用 Hash 模式兼容 Electron
|
||||
routes,
|
||||
})
|
||||
|
||||
|
||||
95
packages/core/src/views/index.vue
Normal file
95
packages/core/src/views/index.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<script setup lang="ts">
|
||||
import type { IPlatformBridge } from '@cslab-dcs/bridge'
|
||||
import { bridge as defaultBridge } from '@cslab-dcs/bridge'
|
||||
import { inject, onMounted, ref } from 'vue'
|
||||
|
||||
const platformInfo = ref<any>(null)
|
||||
const appVersion = ref('')
|
||||
|
||||
const bridge = inject<IPlatformBridge>('bridge', defaultBridge)
|
||||
|
||||
onMounted(async () => {
|
||||
platformInfo.value = await bridge.system.getPlatformInfo()
|
||||
appVersion.value = await bridge.system.getAppVersion()
|
||||
})
|
||||
|
||||
async function handleOpenFile() {
|
||||
const result = await bridge.file.openDialog({
|
||||
title: '打开配置',
|
||||
filters: [{ name: 'JSON', extensions: ['json'] }],
|
||||
})
|
||||
if (result) {
|
||||
await bridge.dialog.message({
|
||||
title: '选择文件',
|
||||
message: `你选择了: ${Array.isArray(result) ? result.join(', ') : result}`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleGreet() {
|
||||
bridge.dialog.message({
|
||||
title: 'Hello',
|
||||
message: `Welcome to DCS Editor on ${platformInfo.value?.name}`,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="home-container">
|
||||
<div class="content">
|
||||
<h1>DCS Editor ({{ platformInfo?.name || 'Loading...' }})</h1>
|
||||
<p>Version: {{ appVersion }}</p>
|
||||
|
||||
<div class="card">
|
||||
<el-button type="primary" @click="handleGreet">
|
||||
打招呼
|
||||
</el-button>
|
||||
<el-button type="success" @click="handleOpenFile">
|
||||
打开文件
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="debug-info">
|
||||
<h3>Platform Info:</h3>
|
||||
<pre>{{ JSON.stringify(platformInfo, null, 2) }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.home-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
|
||||
.card {
|
||||
margin: 20px 0;
|
||||
gap: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.debug-info {
|
||||
margin-top: 20px;
|
||||
text-align: left;
|
||||
background: #f8f9fa;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
|
||||
pre {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
3
packages/core/src/views/online/index.vue
Normal file
3
packages/core/src/views/online/index.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>在线版</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user