1111 type =" radio"
1212 id =" timeIntervalChart-tab"
1313 name =" settings-group"
14- checked
15- v-on:change =" selectTab(SettingsTab.TimeIntervalChart )"
14+ : checked= " selectedTab == SettingsTab.Dashboard "
15+ v-on:change =" selectTab(SettingsTab.Dashboard )"
1616 />
1717 <label name =" tabName" for =" timeIntervalChart-tab" >{{ t('dashboard.message') }}</label >
1818
1919 <div class =" settings-content" >
20- <Dashboad v-if =" selectedTab == SettingsTab.TimeIntervalChart " />
20+ <Dashboad v-if =" selectedTab == SettingsTab.Dashboard " />
2121 </div >
2222 </div >
2323 <!-- <p class="tab-separator">Settings</p> -->
2626 type =" radio"
2727 id =" general-tab"
2828 name =" settings-group"
29+ :checked =" selectedTab == SettingsTab.GeneralSettings"
2930 v-on:change =" selectTab(SettingsTab.GeneralSettings)"
3031 />
3132 <label name =" tabName" for =" general-tab" >{{ t('generalSettings.message') }}</label >
4041 type =" radio"
4142 id =" white-list-tab"
4243 name =" settings-group"
44+ :checked =" selectedTab == SettingsTab.WhiteList"
4345 v-on:change =" selectTab(SettingsTab.WhiteList)"
4446 />
4547 <label name =" tabName" for =" white-list-tab" >{{ t('whiteListSettings.message') }}</label >
5456 type =" radio"
5557 id =" limits-tab"
5658 name =" settings-group"
59+ :checked =" selectedTab == SettingsTab.Limits"
5760 v-on:change =" selectTab(SettingsTab.Limits)"
5861 />
5962 <label name =" tabName" for =" limits-tab" >{{ t('limitsSettings.message') }}</label >
6770 type =" radio"
6871 id =" notification-tab"
6972 name =" settings-group"
73+ :checked =" selectedTab == SettingsTab.Notifications"
7074 v-on:change =" selectTab(SettingsTab.Notifications)"
7175 />
7276 <label name =" tabName" for =" notification-tab" >{{ t('notificationsSettings.message') }}</label >
8185 type =" radio"
8286 id =" about-tab"
8387 name =" settings-group"
88+ :checked =" selectedTab == SettingsTab.About"
8489 v-on:change =" selectTab(SettingsTab.About)"
8590 />
8691 <label name =" tabName" for =" about-tab" >{{ t('aboutSettings.message') }}</label >
@@ -107,7 +112,20 @@ const { t } = useI18n();
107112
108113const selectedTab = ref <SettingsTab >();
109114
110- onMounted (() => (selectedTab .value = SettingsTab .TimeIntervalChart ));
115+ onMounted (() => {
116+ const urlObj = new URL (location .href );
117+ const tabName = urlObj .searchParams .get (' tab' );
118+ if (tabName != null && tabName != ' ' ) {
119+ switch (tabName ) {
120+ case ' dashboard' :
121+ selectedTab .value = SettingsTab .Dashboard ;
122+ break ;
123+ case ' settings' :
124+ selectedTab .value = SettingsTab .GeneralSettings ;
125+ break ;
126+ }
127+ } else selectedTab .value = selectedTab .value = SettingsTab .Dashboard ;
128+ });
111129
112130function selectTab(value : SettingsTab ) {
113131 selectedTab .value = value ;
0 commit comments