mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
feat: hide proxy names
This commit is contained in:
@@ -10,6 +10,8 @@ struct ProxyGroupRowView: View {
|
||||
|
||||
@ObservedObject var proxyGroup: DBProxyGroup
|
||||
|
||||
@EnvironmentObject var hideProxyNames: HideProxyNames
|
||||
|
||||
var body: some View {
|
||||
NavigationLink {
|
||||
ProxyGroupView(proxyGroup: proxyGroup)
|
||||
@@ -21,7 +23,9 @@ struct ProxyGroupRowView: View {
|
||||
var labelView: some View {
|
||||
VStack(spacing: 2) {
|
||||
HStack(alignment: .center) {
|
||||
Text(proxyGroup.name)
|
||||
Text(hideProxyNames.hide
|
||||
? String(proxyGroup.id.prefix(8))
|
||||
: proxyGroup.name)
|
||||
.font(.system(size: 15))
|
||||
Spacer()
|
||||
if let proxy = proxyGroup.currentProxy {
|
||||
@@ -34,7 +38,11 @@ struct ProxyGroupRowView: View {
|
||||
HStack {
|
||||
Text(proxyGroup.type.rawValue)
|
||||
Spacer()
|
||||
Text(proxyGroup.now ?? "")
|
||||
if let proxy = proxyGroup.currentProxy {
|
||||
Text(hideProxyNames.hide
|
||||
? String(proxy.id.prefix(8))
|
||||
: proxy.name)
|
||||
}
|
||||
}
|
||||
.font(.system(size: 11))
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
@@ -11,6 +11,8 @@ struct ProxyGroupView: View {
|
||||
@ObservedObject var proxyGroup: DBProxyGroup
|
||||
@EnvironmentObject var searchString: ProxiesSearchString
|
||||
|
||||
@EnvironmentObject var hideProxyNames: HideProxyNames
|
||||
|
||||
@State private var columnCount: Int = 3
|
||||
@State private var isUpdatingSelect = false
|
||||
@State private var selectable = false
|
||||
@@ -56,7 +58,9 @@ struct ProxyGroupView: View {
|
||||
|
||||
var proxyInfoView: some View {
|
||||
HStack() {
|
||||
Text(proxyGroup.name)
|
||||
Text(hideProxyNames.hide
|
||||
? String(proxyGroup.id.prefix(8))
|
||||
: proxyGroup.name)
|
||||
.font(.system(size: 17))
|
||||
Text(proxyGroup.type.rawValue)
|
||||
.font(.system(size: 13))
|
||||
|
||||
@@ -11,6 +11,8 @@ struct ProxyItemView: View {
|
||||
@Binding var proxy: DBProxy
|
||||
@State var selectable: Bool
|
||||
|
||||
@EnvironmentObject var hideProxyNames: HideProxyNames
|
||||
|
||||
init(proxy: Binding<DBProxy>, selectable: Bool) {
|
||||
self._proxy = proxy
|
||||
self.selectable = selectable
|
||||
@@ -24,7 +26,9 @@ struct ProxyItemView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack(alignment: .center) {
|
||||
Text(proxy.name)
|
||||
Text(hideProxyNames.hide
|
||||
? String(proxy.id.prefix(8))
|
||||
: proxy.name)
|
||||
.truncationMode(.tail)
|
||||
.lineLimit(1)
|
||||
Spacer(minLength: 6)
|
||||
|
||||
Reference in New Issue
Block a user