@danhachuel/thunderbolt 0.4.36 → 0.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +35 -30
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -2080,6 +2080,41 @@ def render_channels():
|
|
|
2080
2080
|
st.session_state.pop("channel_spreadsheet_rows", None)
|
|
2081
2081
|
st.rerun()
|
|
2082
2082
|
|
|
2083
|
+
st.divider()
|
|
2084
|
+
st.subheader("Canais cadastrados")
|
|
2085
|
+
registered_channels = read_json("channels.json", [])
|
|
2086
|
+
if not registered_channels:
|
|
2087
|
+
st.info("Nenhum canal cadastrado.")
|
|
2088
|
+
else:
|
|
2089
|
+
registered_rows = [
|
|
2090
|
+
{
|
|
2091
|
+
"Nome": str(channel.get("name") or ""),
|
|
2092
|
+
"Handle": str(channel.get("handle") or ""),
|
|
2093
|
+
"URL": str(channel.get("url") or ""),
|
|
2094
|
+
"Nicho": channel_niche_label(channel),
|
|
2095
|
+
"Descrição": str(channel.get("description") or ""),
|
|
2096
|
+
"Origem": str(channel.get("import_source") or channel.get("metrics_source") or "manual"),
|
|
2097
|
+
"Activo": "Sim" if channel.get("active", True) else "Não",
|
|
2098
|
+
}
|
|
2099
|
+
for channel in registered_channels
|
|
2100
|
+
]
|
|
2101
|
+
st.dataframe(
|
|
2102
|
+
registered_rows,
|
|
2103
|
+
use_container_width=True,
|
|
2104
|
+
hide_index=True,
|
|
2105
|
+
height=420,
|
|
2106
|
+
column_config={
|
|
2107
|
+
"Nome": st.column_config.TextColumn("Nome", width=180),
|
|
2108
|
+
"Handle": st.column_config.TextColumn("Handle", width=150),
|
|
2109
|
+
"URL": st.column_config.LinkColumn("URL", width=260),
|
|
2110
|
+
"Nicho": st.column_config.TextColumn("Nicho", width=180),
|
|
2111
|
+
"Descrição": st.column_config.TextColumn("Descrição", width=420),
|
|
2112
|
+
"Origem": st.column_config.TextColumn("Origem", width=150),
|
|
2113
|
+
"Activo": st.column_config.TextColumn("Activo", width=80),
|
|
2114
|
+
},
|
|
2115
|
+
)
|
|
2116
|
+
st.caption("Tabela de canais cadastrados. Use a barra inferior para navegar horizontalmente e a barra lateral para percorrer os registos.")
|
|
2117
|
+
|
|
2083
2118
|
with batch_tab:
|
|
2084
2119
|
st.caption("Esta subaba usa a conta Google/YouTube seleccionada para listar os canais que ela gere. Não lê a caixa Gmail e não usa e-mails como pesquisa pública.")
|
|
2085
2120
|
accounts = [account for account in settings.get("youtube_batch_accounts", []) if isinstance(account, dict) and account.get("id")]
|
|
@@ -2226,39 +2261,9 @@ def render_channels():
|
|
|
2226
2261
|
st.success(f"Canal {channel['name']} guardado manualmente.")
|
|
2227
2262
|
st.rerun()
|
|
2228
2263
|
|
|
2229
|
-
st.subheader("Canais cadastrados")
|
|
2230
2264
|
channels = read_json("channels.json", [])
|
|
2231
2265
|
if not channels:
|
|
2232
|
-
st.info("Nenhum canal cadastrado.")
|
|
2233
2266
|
return
|
|
2234
|
-
channel_rows = [
|
|
2235
|
-
{
|
|
2236
|
-
"Nome": str(channel.get("name") or ""),
|
|
2237
|
-
"Handle": str(channel.get("handle") or ""),
|
|
2238
|
-
"URL": str(channel.get("url") or ""),
|
|
2239
|
-
"Nicho": channel_niche_label(channel),
|
|
2240
|
-
"Descrição": str(channel.get("description") or ""),
|
|
2241
|
-
"Origem": str(channel.get("import_source") or channel.get("metrics_source") or "manual"),
|
|
2242
|
-
"Activo": "Sim" if channel.get("active", True) else "Não",
|
|
2243
|
-
}
|
|
2244
|
-
for channel in channels
|
|
2245
|
-
]
|
|
2246
|
-
st.dataframe(
|
|
2247
|
-
channel_rows,
|
|
2248
|
-
use_container_width=True,
|
|
2249
|
-
hide_index=True,
|
|
2250
|
-
height=min(360, 76 + 38 * len(channel_rows)),
|
|
2251
|
-
column_config={
|
|
2252
|
-
"Nome": st.column_config.TextColumn("Nome", width=180),
|
|
2253
|
-
"Handle": st.column_config.TextColumn("Handle", width=150),
|
|
2254
|
-
"URL": st.column_config.LinkColumn("URL", width=220),
|
|
2255
|
-
"Nicho": st.column_config.TextColumn("Nicho", width=160),
|
|
2256
|
-
"Descrição": st.column_config.TextColumn("Descrição", width=360),
|
|
2257
|
-
"Origem": st.column_config.TextColumn("Origem", width=130),
|
|
2258
|
-
"Activo": st.column_config.TextColumn("Activo", width=80),
|
|
2259
|
-
},
|
|
2260
|
-
)
|
|
2261
|
-
st.caption("Tabela de canais cadastrados. Os cartões abaixo mantêm as ações de edição, credenciais e vídeos publicados.")
|
|
2262
2267
|
for channel in channels:
|
|
2263
2268
|
channel_id = str(channel["id"])
|
|
2264
2269
|
edit_key = f"edit_channel_{channel_id}"
|
package/package.json
CHANGED