bugfix before release 11x (#130)

* use correct i18n hook

* fix peer rpc panic

make sure server use correct transact id

* fix dhcp

recreate tun device after ip changed

* use upx correctly

* compile arm & armv7

* prepare to release v1.1.0
This commit is contained in:
Sijie.Sun
2024-06-03 23:07:44 +08:00
committed by GitHub
parent c1b725e64e
commit df17a7bb68
13 changed files with 470 additions and 336 deletions

View File

@@ -3,6 +3,7 @@ import InputGroup from 'primevue/inputgroup'
import InputGroupAddon from 'primevue/inputgroupaddon'
import { getOsHostname } from '~/composables/network'
import { NetworkingMethod } from '~/types/network'
const { t } = useI18n()
const props = defineProps<{
configInvalid?: boolean
@@ -11,8 +12,6 @@ const props = defineProps<{
defineEmits(['runNetwork'])
const { t } = useI18n()
const networking_methods = ref([
{ value: NetworkingMethod.PublicServer, label: t('public_server') },
{ value: NetworkingMethod.Manual, label: t('manual') },
@@ -59,16 +58,16 @@ onMounted(async () => {
<div class="flex flex-column">
<div class="w-7/12 self-center ">
<Message severity="warn">
{{ $t('dhcp_experimental_warning') }}
{{ t('dhcp_experimental_warning') }}
</Message>
</div>
<div class="w-7/12 self-center ">
<Panel :header="$t('basic_settings')">
<Panel :header="t('basic_settings')">
<div class="flex flex-column gap-y-2">
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 basis-5/12 grow">
<div class="flex align-items-center" for="virtual_ip">
<label class="mr-2"> {{ $t('virtual_ipv4') }} </label>
<label class="mr-2"> {{ t('virtual_ipv4') }} </label>
<Checkbox v-model="curNetwork.dhcp" input-id="virtual_ip_auto" :binary="true" />
<label for="virtual_ip_auto" class="ml-2">
@@ -89,11 +88,11 @@ onMounted(async () => {
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 basis-5/12 grow">
<label for="network_name">{{ $t('network_name') }}</label>
<label for="network_name">{{ t('network_name') }}</label>
<InputText id="network_name" v-model="curNetwork.network_name" aria-describedby="network_name-help" />
</div>
<div class="flex flex-column gap-2 basis-5/12 grow">
<label for="network_secret">{{ $t('network_secret') }}</label>
<label for="network_secret">{{ t('network_secret') }}</label>
<InputText
id="network_secret" v-model="curNetwork.network_secret"
aria-describedby=" network_secret-help"
@@ -103,7 +102,7 @@ onMounted(async () => {
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 basis-5/12 grow">
<label for="nm">{{ $t('networking_method') }}</label>
<label for="nm">{{ t('networking_method') }}</label>
<div class="items-center flex flex-row p-fluid gap-x-1">
<Dropdown
v-model="curNetwork.networking_method" :options="networking_methods" option-label="label"
@@ -111,7 +110,7 @@ onMounted(async () => {
/>
<Chips
v-if="curNetwork.networking_method === NetworkingMethod.Manual" id="chips"
v-model="curNetwork.peer_urls" :placeholder="$t('chips_placeholder', ['tcp://8.8.8.8:11010'])"
v-model="curNetwork.peer_urls" :placeholder="t('chips_placeholder', ['tcp://8.8.8.8:11010'])"
separator=" " class="grow"
/>
@@ -128,24 +127,24 @@ onMounted(async () => {
<Divider />
<Panel :header="$t('advanced_settings')" toggleable collapsed>
<Panel :header="t('advanced_settings')" toggleable collapsed>
<div class="flex flex-column gap-y-2">
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 basis-5/12 grow">
<label for="hostname">{{ $t('hostname') }}</label>
<label for="hostname">{{ t('hostname') }}</label>
<InputText
id="hostname" v-model="curNetwork.hostname" aria-describedby="hostname-help" :format="true"
:placeholder="$t('hostname_placeholder', [osHostname])" @blur="validateHostname"
:placeholder="t('hostname_placeholder', [osHostname])" @blur="validateHostname"
/>
</div>
</div>
<div class="flex flex-row gap-x-9 flex-wrap w-full">
<div class="flex flex-column gap-2 grow p-fluid">
<label for="username">{{ $t('proxy_cidrs') }}</label>
<label for="username">{{ t('proxy_cidrs') }}</label>
<Chips
id="chips" v-model="curNetwork.proxy_cidrs"
:placeholder="$t('chips_placeholder', ['10.0.0.0/24'])" separator=" " class="w-full"
:placeholder="t('chips_placeholder', ['10.0.0.0/24'])" separator=" " class="w-full"
/>
</div>
</div>
@@ -156,13 +155,13 @@ onMounted(async () => {
<div class="items-center flex flex-row gap-x-4">
<ToggleButton
v-model="curNetwork.enable_vpn_portal" on-icon="pi pi-check" off-icon="pi pi-times"
:on-label="$t('off_text')" :off-label="$t('on_text')"
:on-label="t('off_text')" :off-label="t('on_text')"
/>
<div v-if="curNetwork.enable_vpn_portal" class="grow">
<InputGroup>
<InputText
v-model="curNetwork.vpn_portal_client_network_addr"
:placeholder="$t('vpn_portal_client_network')"
:placeholder="t('vpn_portal_client_network')"
/>
<InputGroupAddon>
<span>/{{ curNetwork.vpn_portal_client_network_len }}</span>
@@ -171,7 +170,7 @@ onMounted(async () => {
</div>
<InputNumber
v-if="curNetwork.enable_vpn_portal" v-model="curNetwork.vpn_portal_listen_port"
:placeholder="$t('vpn_portal_listen_port')" class="" :format="false" :min="0" :max="65535"
:placeholder="t('vpn_portal_listen_port')" class="" :format="false" :min="0" :max="65535"
/>
</div>
</div>
@@ -179,17 +178,17 @@ onMounted(async () => {
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 grow p-fluid">
<label for="listener_urls">{{ $t('listener_urls') }}</label>
<label for="listener_urls">{{ t('listener_urls') }}</label>
<Chips
id="listener_urls" v-model="curNetwork.listener_urls"
:placeholder="$t('chips_placeholder', ['tcp://1.1.1.1:11010'])" separator=" " class="w-full"
:placeholder="t('chips_placeholder', ['tcp://1.1.1.1:11010'])" separator=" " class="w-full"
/>
</div>
</div>
<div class="flex flex-row gap-x-9 flex-wrap">
<div class="flex flex-column gap-2 basis-5/12 grow">
<label for="rpc_port">{{ $t('rpc_port') }}</label>
<label for="rpc_port">{{ t('rpc_port') }}</label>
<InputNumber
id="rpc_port" v-model="curNetwork.rpc_port" aria-describedby="username-help"
:format="false" :min="0" :max="65535"
@@ -201,7 +200,7 @@ onMounted(async () => {
<div class="flex pt-4 justify-content-center">
<Button
:label="$t('run_network')" icon="pi pi-arrow-right" icon-pos="right" :disabled="configInvalid"
:label="t('run_network')" icon="pi pi-arrow-right" icon-pos="right" :disabled="configInvalid"
@click="$emit('runNetwork', curNetwork)"
/>
</div>

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { NodeInfo } from '~/types/network'
const { t } = useI18n()
const props = defineProps<{
instanceId?: string
@@ -272,7 +273,7 @@ function showEventLogs() {
<template>
<div>
<Dialog v-model:visible="dialogVisible" modal :header="$t(dialogHeader)" :style="{ width: '70%' }">
<Dialog v-model:visible="dialogVisible" modal :header="t(dialogHeader)" :style="{ width: '70%' }">
<Panel>
<ScrollPanel style="width: 100%; height: 400px">
<pre>{{ dialogContent }}</pre>
@@ -280,7 +281,7 @@ function showEventLogs() {
</Panel>
<Divider />
<div class="flex justify-content-end gap-2">
<Button type="button" :label="$t('close')" @click="dialogVisible = false" />
<Button type="button" :label="t('close')" @click="dialogVisible = false" />
</div>
</Dialog>
@@ -300,7 +301,7 @@ function showEventLogs() {
<template v-else>
<Card>
<template #title>
{{ $t('my_node_info') }}
{{ t('my_node_info') }}
</template>
<template #content>
<div class="flex w-full flex-column gap-y-5">
@@ -310,7 +311,7 @@ function showEventLogs() {
style="border: 1px solid green"
>
<div class="font-bold">
{{ $t('peer_count') }}
{{ t('peer_count') }}
</div>
<div class="text-5xl mt-1">
{{ peerCount }}
@@ -322,7 +323,7 @@ function showEventLogs() {
style="border: 1px solid purple"
>
<div class="font-bold">
{{ $t('upload') }}
{{ t('upload') }}
</div>
<div class="text-xl mt-2">
{{ txRate }}/s
@@ -334,7 +335,7 @@ function showEventLogs() {
style="border: 1px solid fuchsia"
>
<div class="font-bold">
{{ $t('download') }}
{{ t('download') }}
</div>
<div class="text-xl mt-2">
{{ rxRate }}/s
@@ -350,8 +351,8 @@ function showEventLogs() {
</div>
<div v-if="myNodeInfo" class="m-0 flex flex-row justify-center gap-x-5 text-sm">
<Button severity="info" :label="$t('show_vpn_portal_config')" @click="showVpnPortalConfig" />
<Button severity="info" :label="$t('show_event_log')" @click="showEventLogs" />
<Button severity="info" :label="t('show_vpn_portal_config')" @click="showVpnPortalConfig" />
<Button severity="info" :label="t('show_event_log')" @click="showEventLogs" />
</div>
</div>
</template>
@@ -361,17 +362,17 @@ function showEventLogs() {
<Card>
<template #title>
{{ $t('peer_info') }}
{{ t('peer_info') }}
</template>
<template #content>
<DataTable :value="peerRouteInfos" column-resize-mode="fit" table-style="width: 100%">
<Column field="route.ipv4_addr" style="width: 100px;" :header="$t('virtual_ipv4')" />
<Column field="route.hostname" style="max-width: 250px;" :header="$t('hostname')" />
<Column :field="routeCost" style="width: 100px;" :header="$t('route_cost')" />
<Column :field="latencyMs" style="width: 80px;" :header="$t('latency')" />
<Column :field="txBytes" style="width: 80px;" :header="$t('upload_bytes')" />
<Column :field="rxBytes" style="width: 80px;" :header="$t('download_bytes')" />
<Column :field="lossRate" style="width: 100px;" :header="$t('loss_rate')" />
<Column field="route.ipv4_addr" style="width: 100px;" :header="t('virtual_ipv4')" />
<Column field="route.hostname" style="max-width: 250px;" :header="t('hostname')" />
<Column :field="routeCost" style="width: 100px;" :header="t('route_cost')" />
<Column :field="latencyMs" style="width: 80px;" :header="t('latency')" />
<Column :field="txBytes" style="width: 80px;" :header="t('upload_bytes')" />
<Column :field="rxBytes" style="width: 80px;" :header="t('download_bytes')" />
<Column :field="lossRate" style="width: 100px;" :header="t('loss_rate')" />
</DataTable>
</template>
</Card>

View File

@@ -160,7 +160,7 @@ function isRunning(id: string) {
</Panel>
<Divider />
<div class="flex justify-content-end gap-2">
<Button type="button" :label="$t('close')" @click="visible = false" />
<Button type="button" :label="t('close')" @click="visible = false" />
</div>
</Dialog>
@@ -169,7 +169,7 @@ function isRunning(id: string) {
<template #start>
<div class="flex align-items-center gap-2">
<Button
icon="pi pi-plus" class="mr-2" severity="primary" :label="$t('add_new_network')"
icon="pi pi-plus" class="mr-2" severity="primary" :label="t('add_new_network')"
@click="addNewNetwork"
/>
</div>
@@ -179,7 +179,7 @@ function isRunning(id: string) {
<div class="min-w-80 mr-20">
<Dropdown
v-model="networkStore.curNetwork" :options="networkStore.networkList" :highlight-on-select="false"
:placeholder="$t('select_network')" class="w-full"
:placeholder="t('select_network')" class="w-full"
>
<template #value="slotProps">
<div class="flex items-start content-center">
@@ -195,7 +195,7 @@ function isRunning(id: string) {
</div>
<Tag
class="my-auto" :severity="isRunning(slotProps.value.instance_id) ? 'success' : 'info'"
:value="$t(isRunning(slotProps.value.instance_id) ? 'network_running' : 'network_stopped')"
:value="t(isRunning(slotProps.value.instance_id) ? 'network_running' : 'network_stopped')"
/>
</div>
</template>
@@ -203,11 +203,11 @@ function isRunning(id: string) {
<div class="flex flex-col items-start content-center">
<div class="flex">
<div class="mr-3">
{{ $t('network_name') }}: {{ slotProps.option.network_name }}
{{ t('network_name') }}: {{ slotProps.option.network_name }}
</div>
<Tag
class="my-auto" :severity="isRunning(slotProps.option.instance_id) ? 'success' : 'info'"
:value="$t(isRunning(slotProps.option.instance_id) ? 'network_running' : 'network_stopped')"
:value="t(isRunning(slotProps.option.instance_id) ? 'network_running' : 'network_stopped')"
/>
</div>
<div>{{ slotProps.option.public_server_url }}</div>
@@ -219,7 +219,7 @@ function isRunning(id: string) {
<template #end>
<Button
icon="pi pi-cog" class="mr-2" severity="secondary" aria-haspopup="true" :label="$t('settings')"
icon="pi pi-cog" class="mr-2" severity="secondary" aria-haspopup="true" :label="t('settings')"
aria-controls="overlay_setting_menu" @click="toggle_setting_menu"
/>
<Menu id="overlay_setting_menu" ref="setting_menu" :model="setting_menu_items" :popup="true" />
@@ -228,7 +228,7 @@ function isRunning(id: string) {
</div>
<Stepper class="h-full overflow-y-auto" :active-step="activeStep">
<StepperPanel :header="$t('config_network')">
<StepperPanel :header="t('config_network')">
<template #content="{ nextCallback }">
<Config
:instance-id="networkStore.curNetworkId" :config-invalid="messageBarSeverity !== Severity.None"
@@ -236,14 +236,14 @@ function isRunning(id: string) {
/>
</template>
</StepperPanel>
<StepperPanel :header="$t('running')">
<StepperPanel :header="t('running')">
<template #content="{ prevCallback }">
<div class="flex flex-column">
<Status :instance-id="networkStore.curNetworkId" />
</div>
<div class="flex pt-4 justify-content-center">
<Button
:label="$t('stop_network')" severity="danger" icon="pi pi-arrow-left"
:label="t('stop_network')" severity="danger" icon="pi pi-arrow-left"
@click="stopNetworkCb(networkStore.curNetwork, prevCallback)"
/>
</div>