Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangcheng870518 committed Dec 2, 2024
2 parents eec9043 + aae58c6 commit 2473580
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gui/src/layout/AppRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const loaddata = (reload) => {
store.commit('account/setSelectedMesh', res[0]);
selectedMesh.value = res[0];
}
if(!merged.value && playing.value && (res.length == 0 || true)){
if(!merged.value && playing.value && (res.length == 0)){
merged.value = true;
ztmService.mergePrivateKey(()=>{})
}
Expand Down
13 changes: 8 additions & 5 deletions gui/src/service/ZtmService.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ const VITE_APP_PUB_HUB_US = import.meta.env.VITE_APP_PUB_HUB_US;
export default class ZtmService {
getPubHub() {
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (timeZone === "Asia/Shanghai" || timeZone === "Asia/Chongqing" || timeZone === "Asia/Hong_Kong") {
if (timeZone === "Asia/Shanghai" || timeZone === "Asia/Chongqing") {
const pm = platform();
if(pm == 'ios'){
return '';
} else {
return VITE_APP_PUB_HUB_CN;
}
} else if (timeZone === "Asia/Hong_Kong") {
return VITE_APP_PUB_HUB_CN;
} else if (timeZone === "Asia/Macau") {
return VITE_APP_PUB_HUB_US;
} else if (timeZone.startsWith("Asia")) {
return VITE_APP_PUB_HUB_US;
} else {
return VITE_APP_PUB_HUB_US;
}
Expand Down
11 changes: 9 additions & 2 deletions gui/src/views/mesh/Meshes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const openEditor = () => {
const emptyMsg = computed(()=>{
return `You haven't joined a mesh yet.`
});
const hasPubHub = computed(()=>{
return !!ztmService.getPubHub()
});
const selectedMesh = computed(() => {
return store.getters["account/selectedMesh"]
});
Expand Down Expand Up @@ -169,7 +174,7 @@ onMounted(() => {
</template>
<template #end>
<Button icon="pi pi-refresh" text @click="loaddata" :loading="loader"/>
<Button v-if="!!meshes && meshes.length>0 && !meshes.find((m)=>m.name == 'Sample')" :loading="tryLoading" v-tooltip="'Live Sample'" icon="pi pi-sparkles" text @click="openTryMesh" />
<Button v-if="hasPubHub && !!meshes && meshes.length>0 && !meshes.find((m)=>m.name == 'Sample')" :loading="tryLoading" v-tooltip="'Live Sample'" icon="pi pi-sparkles" text @click="openTryMesh" />
<Button v-if="!!meshes && meshes.length>0" icon="pi pi-plus" v-tooltip="'Join'" @click="() => visibleEditor = true"/>
</template>
</AppHeader>
Expand Down Expand Up @@ -197,7 +202,9 @@ onMounted(() => {
</div>
</div>
</ScrollPanel>
<Empty v-else :title="emptyMsg" cancelButton="Live Sample" @cancel="openTryMesh" button="Join Mesh" @primary="() => visibleEditor = true"/>
<Empty v-else-if="hasPubHub" :title="emptyMsg" cancelButton="Live Sample" @cancel="openTryMesh" button="Join Mesh" @primary="() => visibleEditor = true"/>
<Empty v-else :title="emptyMsg" button="Join Mesh" @primary="() => visibleEditor = true"/>
</div>
<div class="flex-item h-full" v-if="!!visibleEditor">
<div class="shadow mobile-fixed h-full">
Expand Down

0 comments on commit 2473580

Please sign in to comment.