yolo商店
This commit is contained in:
@@ -50,6 +50,14 @@
|
|||||||
<span class="material-icons-round text-xl">sports_esports</span>
|
<span class="material-icons-round text-xl">sports_esports</span>
|
||||||
<span class="text-xs font-medium truncate">PK 工作台</span>
|
<span class="text-xs font-medium truncate">PK 工作台</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!-- yolo商店 Tab -->
|
||||||
|
<button @click="currentView = 'shop'"
|
||||||
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200"
|
||||||
|
:class="currentView === 'shop' ? 'bg-blue-600 text-white shadow-lg shadow-blue-900/30' : 'text-slate-400 hover:bg-slate-800 hover:text-white'">
|
||||||
|
<span class="material-icons-round text-xl">admin_panel_settings</span>
|
||||||
|
<span class="text-xs font-medium truncate">YOLO商店</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-auto w-full px-2">
|
<div class="mt-auto w-full px-2">
|
||||||
@@ -129,6 +137,16 @@
|
|||||||
<div v-show="currentView === 'pk_mini'" class="absolute inset-0 z-20 h-full overflow-hidden">
|
<div v-show="currentView === 'pk_mini'" class="absolute inset-0 z-20 h-full overflow-hidden">
|
||||||
<PkMiniWorkbench />
|
<PkMiniWorkbench />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Tab 6: yolo商店 - iframe 嵌入 -->
|
||||||
|
<div v-show="currentView === 'shop'" class="absolute inset-0 z-20 h-full overflow-hidden">
|
||||||
|
<iframe
|
||||||
|
v-if="adminLoaded"
|
||||||
|
src="http://192.168.2.128:8085/"
|
||||||
|
class="w-full h-full border-0"
|
||||||
|
allow="clipboard-read; clipboard-write"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -154,6 +172,7 @@ const emit = defineEmits(['logout', 'go-back', 'stop-all'])
|
|||||||
|
|
||||||
const currentView = ref('tk') // Default Tab
|
const currentView = ref('tk') // Default Tab
|
||||||
const autoDmMode = ref('config') // Default Sub-state: 'config' or 'browser'
|
const autoDmMode = ref('config') // Default Sub-state: 'config' or 'browser'
|
||||||
|
const adminLoaded = ref(false) // 懒加载:首次切换到管理后台时才加载 iframe
|
||||||
|
|
||||||
const handleGoToBrowser = async () => {
|
const handleGoToBrowser = async () => {
|
||||||
autoDmMode.value = 'browser'
|
autoDmMode.value = 'browser'
|
||||||
@@ -175,6 +194,11 @@ const handleStopAll = () => {
|
|||||||
|
|
||||||
// Watch for view changes to manage native Electron BrowserViews
|
// Watch for view changes to manage native Electron BrowserViews
|
||||||
watch(currentView, async (newVal, oldVal) => {
|
watch(currentView, async (newVal, oldVal) => {
|
||||||
|
// 懒加载管理后台 iframe
|
||||||
|
if (newVal === 'shop' && !adminLoaded.value) {
|
||||||
|
adminLoaded.value = true
|
||||||
|
}
|
||||||
|
|
||||||
if (!isElectron()) return
|
if (!isElectron()) return
|
||||||
|
|
||||||
if (newVal === 'auto_dm' && autoDmMode.value === 'browser') {
|
if (newVal === 'auto_dm' && autoDmMode.value === 'browser') {
|
||||||
|
|||||||
Reference in New Issue
Block a user