mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-09 01:12:23 +02:00
added shared attribute user stream table
This commit is contained in:
@@ -735,7 +735,7 @@ pub async fn force_provider_stream_response(
|
||||
addr: &str,
|
||||
app_state: &AppState,
|
||||
user_session: &UserSession,
|
||||
stream_channel: StreamChannel,
|
||||
mut stream_channel: StreamChannel,
|
||||
req_headers: &HeaderMap,
|
||||
input: &ConfigInput,
|
||||
user: &ProxyUserCredentials,
|
||||
@@ -768,6 +768,7 @@ pub async fn force_provider_stream_response(
|
||||
.active_users
|
||||
.update_session_addr(&user.username, &user_session.token, addr)
|
||||
.await;
|
||||
stream_channel.shared = share_stream;
|
||||
let stream =
|
||||
ActiveClientStream::new(stream_details, app_state, user, connection_permission, addr, stream_channel)
|
||||
.await;
|
||||
@@ -807,7 +808,7 @@ pub async fn stream_response(
|
||||
addr: &str,
|
||||
app_state: &AppState,
|
||||
session_token: &str,
|
||||
stream_channel: StreamChannel,
|
||||
mut stream_channel: StreamChannel,
|
||||
stream_url: &str,
|
||||
req_headers: &HeaderMap,
|
||||
input: &ConfigInput,
|
||||
@@ -869,6 +870,7 @@ pub async fn stream_response(
|
||||
} else {
|
||||
None
|
||||
};
|
||||
stream_channel.shared = share_stream;
|
||||
let stream =
|
||||
ActiveClientStream::new(stream_details, app_state, user, connection_permission, addr, stream_channel)
|
||||
.await;
|
||||
@@ -984,7 +986,7 @@ async fn shared_stream_response(
|
||||
addr: &str,
|
||||
user: &ProxyUserCredentials,
|
||||
connect_permission: UserConnectionPermission,
|
||||
stream_channel: StreamChannel
|
||||
mut stream_channel: StreamChannel
|
||||
) -> Option<impl IntoResponse> {
|
||||
if let Some(stream) =
|
||||
SharedStreamManager::subscribe_shared_stream(app_state, stream_url, Some(addr)).await
|
||||
@@ -1003,6 +1005,7 @@ async fn shared_stream_response(
|
||||
axum::http::StatusCode::OK,
|
||||
)));
|
||||
let stream_details = StreamDetails::from_stream(stream);
|
||||
stream_channel.shared = true;
|
||||
let stream =
|
||||
ActiveClientStream::new(stream_details, app_state, user, connect_permission, addr, stream_channel)
|
||||
.await
|
||||
|
||||
@@ -186,6 +186,7 @@ async fn resolve_stream_channel(
|
||||
group: "Unknown".to_string(),
|
||||
title: "Unknown".to_string(),
|
||||
url: hls_url.to_string(),
|
||||
shared: false,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -289,7 +289,8 @@
|
||||
"CHANNEL": "Channel",
|
||||
"GROUP": "Group",
|
||||
"CLIENT_IP": "Client IP",
|
||||
"STREAM_ID": "Stream Id"
|
||||
"STREAM_ID": "Stream Id",
|
||||
"SHARED": "Shared"
|
||||
},
|
||||
"TITLE": {
|
||||
"USER_BOUQUET_EDITOR": "User group editor"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::app::components::menu_item::MenuItem;
|
||||
use crate::app::components::popup_menu::PopupMenu;
|
||||
use crate::app::components::{AppIcon, Table, TableDefinition};
|
||||
use crate::app::components::{AppIcon, Table, TableDefinition, ToggleSwitch};
|
||||
use crate::hooks::use_service_context;
|
||||
use shared::error::{create_tuliprox_error_result, TuliproxError, TuliproxErrorKind};
|
||||
use shared::model::{SortOrder, StreamInfo};
|
||||
@@ -10,14 +10,15 @@ use std::str::FromStr;
|
||||
use yew::prelude::*;
|
||||
use yew_i18n::use_translation;
|
||||
|
||||
const HEADERS: [&str; 7] = [
|
||||
const HEADERS: [&str; 8] = [
|
||||
"LABEL.EMPTY",
|
||||
"LABEL.USERNAME",
|
||||
"LABEL.STREAM_ID",
|
||||
"LABEL.CHANNEL",
|
||||
"LABEL.GROUP",
|
||||
"LABEL.CLIENT_IP",
|
||||
"LABEL.PROVIDER"
|
||||
"LABEL.PROVIDER",
|
||||
"LABEL.SHARED"
|
||||
];
|
||||
|
||||
#[derive(Properties, PartialEq, Clone)]
|
||||
@@ -94,6 +95,7 @@ pub fn StreamsTable(props: &StreamsTableProps) -> Html {
|
||||
4 => html! {dto.channel.group.as_str()},
|
||||
5 => html! {dto.addr.as_str()},
|
||||
6 => html! {dto.provider.as_str()},
|
||||
7 => html! { <ToggleSwitch value={dto.channel.shared} readonly={true} /> },
|
||||
_ => html! {""},
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@ pub struct StreamChannel {
|
||||
pub group: String,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub shared: bool,
|
||||
}
|
||||
impl XtreamPlaylistItem {
|
||||
pub fn to_stream_channel(&self) -> StreamChannel {
|
||||
@@ -21,6 +22,7 @@ impl XtreamPlaylistItem {
|
||||
group: self.group.clone(),
|
||||
title: self.title.clone(),
|
||||
url: self.url.clone(),
|
||||
shared: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +37,7 @@ impl M3uPlaylistItem {
|
||||
group: self.group.clone(),
|
||||
title: self.title.clone(),
|
||||
url: self.url.clone(),
|
||||
shared: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user