Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed May 4, 2024
1 parent fdc8bb6 commit f89caa3
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 57 deletions.
94 changes: 47 additions & 47 deletions src/components/preferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,33 @@
<div class="offcanvas-body pt-0 m-2">
<div class="preferences-tip">{{ $t('nav.preferences.preferenceTips') }}</div>

<!-- 主题方案 -->

<div id="Pref_colorScheme">
<div class="form-label col-12 preferences-title"><i class="bi bi-palette-fill"></i> {{
$t('nav.preferences.colorScheme') }}</div>
<div class="btn-group col-auto" role="group" aria-label="Color Scheme">
<input type="radio" class="btn-check" name="darkModeAuto" id="darkModeAuto" autocomplete="off"
value="auto" v-model="userPreferences.theme" @change="prefTheme('auto')">
<label class="btn" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active fw-bold': userPreferences.theme === 'auto'
}" for="darkModeAuto">{{
$t('nav.preferences.colorAuto') }}</label>

<input type="radio" class="btn-check" name="darkModeOff" id="darkModeOff" autocomplete="off"
value="light" v-model="userPreferences.theme" @change="prefTheme('light')">
<label class="btn" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active fw-bold': userPreferences.theme === 'light'
}" for="darkModeOff">
<span><i class="bi bi-brightness-high "></i> {{ $t('nav.preferences.colorLight') }}</span>
</label>

<input type="radio" class="btn-check" name="darkModeOn" id="darkModeOn" autocomplete="off"
value="dark" v-model="userPreferences.theme" @change="prefTheme('dark')">
<label class="btn" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active fw-bold': userPreferences.theme === 'dark'
}" for="darkModeOn">
<span><i class="bi bi-moon-stars"></i> {{ $t('nav.preferences.colorDark') }}</span>
</label>
<template v-for="theme in ['auto', 'light', 'dark']">
<input type="radio" class="btn-check" :name="'darkMode' + theme" :id="'darkMode' + theme"
autocomplete="off" :value="theme" v-model="userPreferences.theme"
@change="prefTheme(theme)">
<label class="btn" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active text-bg-primary': userPreferences.theme === theme
}" :for="'darkMode' + theme">
<span v-if="theme === 'light'"><i class="bi bi-brightness-high"></i> {{
$t('nav.preferences.colorLight') }}</span>
<span v-else-if="theme === 'dark'"><i class="bi bi-moon-stars"></i> {{
$t('nav.preferences.colorDark') }}</span>
<span v-else>{{ $t('nav.preferences.colorAuto') }}</span>
</label>
</template>
</div>
</div>

<!-- IP 源 -->

<div id="Pref_ipCards">
<div class="form-label col-12 preferences-title">
<i class="bi bi-ui-checks-grid"></i> {{ $t('nav.preferences.ipSourcesToCheck') }}
Expand All @@ -58,14 +50,16 @@
<label class="btn jn-number" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active fw-bold': userPreferences.ipCardsToShow === num
'active text-bg-primary': userPreferences.ipCardsToShow === num
}" :for="'ipCards_' + num">{{ num
}}</label>
</template>
</div>
<div class="preferences-tip">{{ $t('nav.preferences.ipSourcesToCheckTips') }}</div>
</div>

<!-- IP 地理位置数据库 -->

<div id="Pref_ipGeoSource">
<div class="form-label col-12 preferences-title">
<i class="bi bi-ui-checks-grid"></i> {{ $t('nav.preferences.ipDB') }}
Expand All @@ -78,7 +72,7 @@
<label class="btn jn-number text-start" :class="{
'btn-outline-dark': !isDarkMode,
'btn-outline-light': isDarkMode,
'active fw-bold': userPreferences.ipGeoSource === ipdb.id,
'active text-bg-primary': userPreferences.ipGeoSource === ipdb.id,
'jn-disabled-button': !ipdb.enabled
}" :for="'ipGeoSource_' + ipdb.id" :aria-disabled="!ipdb.enabled" :aria-label="ipdb.text">
<span :class="[ipdb.enabled ? '' : 'jn-disabled-text']">{{ ipdb.text }}&nbsp;</span>
Expand All @@ -89,11 +83,14 @@
<div class="preferences-tip">{{ $t('nav.preferences.ipDBTips') }}</div>
</div>

<!-- 应用设置 -->

<div id="Pref_appSettings">
<div class="form-label col-12 preferences-title"><i class="bi bi-window-dock"></i> {{
$t('nav.preferences.appSettings') }}</div>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-start">
<li class="list-group-item d-flex justify-content-between align-items-start"
:class="[isDarkMode ? 'border-light' : 'border-dark']">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="autoStart">{{
$t('nav.preferences.autoRun')
Expand All @@ -107,7 +104,22 @@
</div>
</li>

<li class="list-group-item d-flex justify-content-between align-items-start" v-if="configs.bingMap">
<li class="list-group-item d-flex justify-content-between align-items-start"
:class="[isDarkMode ? 'border-light' : 'border-dark']" v-if="userPreferences.autoStart">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="ConnectivityRefresh">{{
$t('nav.preferences.connectivityAutoRefresh') }}</label></div>
<div class="preferences-tip">{{ $t('nav.preferences.connectivityAutoRefreshTips') }}</div>
</div>
<div class="form-check form-switch col-auto ">
<input class="form-check-input" type="checkbox" role="switch" id="ConnectivityRefresh"
:checked="userPreferences.connectivityAutoRefresh"
@change="prefConnectivityRefresh($event.target.checked)">
</div>
</li>

<li class="list-group-item d-flex justify-content-between align-items-start"
:class="[isDarkMode ? 'border-light' : 'border-dark']" v-if="configs.bingMap">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="showMap">{{
$t('nav.preferences.showMap')
Expand All @@ -121,7 +133,8 @@
</div>
</li>

<li class="list-group-item d-flex justify-content-between align-items-start" v-if="isMobile">
<li class="list-group-item d-flex justify-content-between align-items-start"
:class="[isDarkMode ? 'border-light' : 'border-dark']" v-if="isMobile">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="simpleMode">{{
$t('nav.preferences.simpleMode')
Expand All @@ -135,20 +148,7 @@
</li>

<li class="list-group-item d-flex justify-content-between align-items-start"
v-if="userPreferences.autoStart">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="ConnectivityRefresh">{{
$t('nav.preferences.connectivityAutoRefresh') }}</label></div>
<div class="preferences-tip">{{ $t('nav.preferences.connectivityAutoRefreshTips') }}</div>
</div>
<div class="form-check form-switch col-auto ">
<input class="form-check-input" type="checkbox" role="switch" id="ConnectivityRefresh"
:checked="userPreferences.connectivityAutoRefresh"
@change="prefConnectivityRefresh($event.target.checked)">
</div>
</li>

<li class="list-group-item d-flex justify-content-between align-items-start">
:class="[isDarkMode ? 'border-light' : 'border-dark']">
<div class="me-auto">
<div class="fw-bold"><label class="form-check-label" for="ConnectivityNotifications">{{
$t('nav.preferences.popupConnectivityNotifications') }}</label>
Expand Down
18 changes: 13 additions & 5 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,23 @@
},
{
"version": "v3.8",
"date": "May 1, 2024",
"date": "May 4, 2024",
"content": [
{
"type": "add",
"change": "Added a settings panel to save preferences locally."
"type": "add",
"change": "Added preferences panel to save settings locally"
},
{
"type": "improve",
"change": "Optimized some functional logic."
"type": "add",
"change": "Allow customization of multiple default behaviors on second program launch"
},
{
"type": "improve",
"change": "Significantly optimized program logic"
},
{
"type": "fix",
"change": "Fixed some minor issues"
}
]
}
Expand Down
14 changes: 11 additions & 3 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,23 @@
},
{
"version": "v3.8",
"date": "May 1, 2024",
"date": "May 4, 2024",
"content": [
{
"type": "add",
"change": "Ajout d'un panneau de réglages pour sauvegarder les préférences localement."
"change": "Ajout du panneau de préférences pour enregistrer les paramètres localement"
},
{
"type": "add",
"change": "Permettre la personnalisation de plusieurs comportements par défaut lors du deuxième lancement du programme"
},
{
"type": "improve",
"change": "Optimisation de certaines logiques fonctionnelles."
"change": "Optimisation significative de la logique du programme"
},
{
"type": "fix",
"change": "Correction de quelques problèmes mineurs"
}
]
}
Expand Down
12 changes: 10 additions & 2 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,23 @@
},
{
"version": "v3.8",
"date": "May 1, 2024",
"date": "May 4, 2024",
"content": [
{
"type": "add",
"change": "增加设置面板,可以在本地保存偏好设置"
},
{
"type": "add",
"change": "可以自定义程序在第二次启动时的多个默认行为"
},
{
"type": "improve",
"change": "优化了部分功能逻辑"
"change": "大量优化了程序的逻辑"
},
{
"type": "fix",
"change": "修复了一些小问题"
}
]
}
Expand Down

0 comments on commit f89caa3

Please sign in to comment.