Skip to content

Commit

Permalink
[K8sBroadcaster] wip Move and simplify Broadcaster
Browse files Browse the repository at this point in the history
  • Loading branch information
mickel8 committed Dec 13, 2024
1 parent c916871 commit 09918a3
Show file tree
Hide file tree
Showing 27 changed files with 2,439 additions and 280 deletions.
20 changes: 20 additions & 0 deletions k8s_broadcaster/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,23 @@
@import "tailwindcss/utilities";

/* This file is for your main application CSS */

::-webkit-scrollbar {
display: none;
}

.details {
padding: 5px 0px;
}

summary {
color: #0d0d0d;
align-items: center;
padding-bottom: 5px;
justify-content: space-between;
}

.summary-content {
color: #606060;
padding: 5px 0px;
}
37 changes: 23 additions & 14 deletions k8s_broadcaster/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,38 @@
//

// Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
import "phoenix_html"
import 'phoenix_html';
// Establish Phoenix Socket and LiveView configuration.
import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import topbar from "../vendor/topbar"
import { Socket } from 'phoenix';
import { LiveSocket } from 'phoenix_live_view';
import topbar from '../vendor/topbar';

let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {
import { Home } from './home.js';
import { Panel } from './panel.js';

let Hooks = {};
Hooks.Home = Home;
Hooks.Panel = Panel;

let csrfToken = document
.querySelector("meta[name='csrf-token']")
.getAttribute('content');
let liveSocket = new LiveSocket('/live', Socket, {
longPollFallbackMs: 2500,
params: {_csrf_token: csrfToken}
})
params: { _csrf_token: csrfToken },
hooks: Hooks,
});

// Show progress bar on live navigation and form submits
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
topbar.config({ barColors: { 0: '#29d' }, shadowColor: 'rgba(0, 0, 0, .3)' });
window.addEventListener('phx:page-loading-start', (_info) => topbar.show(300));
window.addEventListener('phx:page-loading-stop', (_info) => topbar.hide());

// connect if there are any LiveViews on the page
liveSocket.connect()
liveSocket.connect();

// expose liveSocket on window for web console debug logs and latency simulation:
// >> liveSocket.enableDebug()
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket

window.liveSocket = liveSocket;
Loading

0 comments on commit 09918a3

Please sign in to comment.