diff --git a/html/webpage/assets/css/bss-overrides.css b/html/webpage/assets/css/bss-overrides.css new file mode 100644 index 0000000..d06cc3c --- /dev/null +++ b/html/webpage/assets/css/bss-overrides.css @@ -0,0 +1,39 @@ +:root, [data-bs-theme=light] { + --bs-primary: #0d6efd; + --bs-primary-rgb: 13,110,253; + --bs-primary-text-emphasis: #052C65; + --bs-primary-bg-subtle: #CFE2FF; + --bs-primary-border-subtle: #9EC5FE; +} + +.btn-primary { + --bs-btn-color: #fff; + --bs-btn-bg: #0d6efd; + --bs-btn-border-color: #0d6efd; + --bs-btn-hover-color: #fff; + --bs-btn-hover-bg: #0B5ED7; + --bs-btn-hover-border-color: #0A58CA; + --bs-btn-focus-shadow-rgb: 219,233,255; + --bs-btn-active-color: #fff; + --bs-btn-active-bg: #0A58CA; + --bs-btn-active-border-color: #0A53BE; + --bs-btn-disabled-color: #fff; + --bs-btn-disabled-bg: #0d6efd; + --bs-btn-disabled-border-color: #0d6efd; +} + +.btn-outline-primary { + --bs-btn-color: #0d6efd; + --bs-btn-border-color: #0d6efd; + --bs-btn-focus-shadow-rgb: 13,110,253; + --bs-btn-hover-color: #fff; + --bs-btn-hover-bg: #0d6efd; + --bs-btn-hover-border-color: #0d6efd; + --bs-btn-active-color: #fff; + --bs-btn-active-bg: #0d6efd; + --bs-btn-active-border-color: #0d6efd; + --bs-btn-disabled-color: #0d6efd; + --bs-btn-disabled-bg: transparent; + --bs-btn-disabled-border-color: #0d6efd; +} + diff --git a/html/webpage/assets/css/styles.css b/html/webpage/assets/css/styles.css index 06d32fc..0c12988 100644 --- a/html/webpage/assets/css/styles.css +++ b/html/webpage/assets/css/styles.css @@ -62,9 +62,9 @@ body { .btn-round-basic:focus { background-color: #f5f5f5; - border-radius: 20px; + border-radius: 8px; box-shadow: inset 4px 4px 10px #88a5bf7b, inset -4px -4px 10px #ffffff; - color: #4d4d4d; + /*color: #4d4d4d;*/ cursor: pointer; font-size: 16px; transition: all 0.2s ease-in-out; @@ -72,7 +72,7 @@ body { } .btn-round-basic { - border-radius: 20px; + border-radius: 08px; box-shadow: rgba(136, 165, 191, 0.48) 6px 2px 16px 0px, rgba(255, 255, 255, 0.8) -6px -2px 16px 0px; --bs-btn-hover-bg: #ffffff; } @@ -82,24 +82,24 @@ body { box-shadow: inset 2px 2px 5px #bcbcbc, inset -2px -2px 5px #ffffff, 2px 2px 5px #bcbcbc, -2px -2px 5px #ffffff; } -.color-import { +.color-import, .color-import:hover, .color-import:focus { color: var(--bs-teal); } -.color-remove { +.color-remove, .color-remove:hover, .color-remove:focus { color: var(--bs-danger); } -.color-edit { +.color-edit, .color-edit:hover, .color-edit:focus { color: var(--bs-primary-text-emphasis); } -.color-add { +.color-add, .color-add:hover, .color-add:focus { color: var(--bs-primary); } .input-login { - border-radius: 50px; + border-radius: 8px; box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px; } @@ -227,25 +227,23 @@ nav-item:focus { } .accordion-item.active { - /*background: rgba(45, 53, 120, 0.15);*/ - /*box-shadow: inset 4px 4px 10px rgba(45, 53, 120, 0.25), inset -4px -4px 10px rgba(255, 255, 255, 0.8);*/ + background: rgba(45, 53, 120, 0.15); + box-shadow: inset 4px 4px 10px rgba(45, 53, 120, 0.25), inset -4px -4px 10px rgba(255, 255, 255, 0.8); } .bg-accordion { border: white 2px; - /*border-radius: 10px;*/ + border-radius: 8px; background: #f8f9fd; } .card-channel { - border-radius: 12px; + border-radius: 8px; background: #ffffff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform 0.2s ease, box-shadow 0.2s ease; border: #ffffff solid 2px !important; - /*padding-left: 2px;*/ - /*padding-right: 5px;*/ padding-top: 12px; padding-bottom: 12px; } @@ -255,3 +253,27 @@ nav-item:focus { border: white solid 3px; } +.progress-bar { + background-color: #172066; +} + +table { + border-radius: 8px; +} + +.bg-modal-body { + background-color: #f8f9fd; +} + +.bg-header-modal { + background-color: #f0f2ff; +} + +.pad-row-btn { + margin: 0.5rem; +} + +.pad-2 { + border-radius: 0 !important; +} + diff --git a/html/webpage/assets/js/broadcastzones.js b/html/webpage/assets/js/broadcastzones.js index 5a2c07f..adb4a0f 100644 --- a/html/webpage/assets/js/broadcastzones.js +++ b/html/webpage/assets/js/broadcastzones.js @@ -1,4 +1,17 @@ +/** + * @typedef {Object} BroadcastZone + * @property {number} index + * @property {string} description + * @property {String} SoundChannel + * @property {String} Box + * @property {String} Relay + */ +/** + * List of broadcast zones available + * @type {BroadcastZone[]} + */ +window.BroadcastZoneList ??= []; /** * Currently selected broadcast zone row in the table @@ -6,6 +19,12 @@ */ window.selectedBroadcastZoneRow = null; +/** + * List of sound channels available + * @type {String[]} + */ +window.SoundChannelList = [] + /** * Fill broadcast zone table body with values * @param {BroadcastZone[]} vv values to fill @@ -23,7 +42,7 @@ function fill_broadcastzonetablebody(vv) { `; $('#broadcastzonetablebody').append(row); let $addedrow = $('#broadcastzonetablebody tr:last'); - $addedrow.click(function () { + $addedrow.off('click').on('click', function () { if (window.selectedBroadcastZoneRow) { window.selectedBroadcastZoneRow.find('td').css('background-color', ''); if (window.selectedBroadcastZoneRow.is($(this))) { @@ -42,7 +61,34 @@ function fill_broadcastzonetablebody(vv) { $('#tablesize').text("Table Size: " + vv.length); } +/** + * Reload broadcast zones from server + * @param {String} APIURL API URL endpoint (default "BroadcastZones/") + */ +function reloadBroadcastZones(APIURL = "BroadcastZones/") { + window.BroadcastZoneList = []; + fetchAPI(APIURL + "List", "GET", {}, null, (okdata) => { + if (Array.isArray(okdata)) { + //console.log("reloadBroadcastZones : ", okdata) + window.BroadcastZoneList.push(...okdata); + fill_broadcastzonetablebody(window.BroadcastZoneList); + } else console.log("reloadBroadcastZones: okdata is not array"); + }, (errdata) => { + alert("Error loading broadcast zones : " + errdata.message); + }); +} +function fetchSoundChannels(APIURL = "SoundChannel/") { + window.SoundChannelList = []; + fetchAPI(APIURL + "SoundChannelDescriptions", "GET", {}, null, (okdata) => { + if (Array.isArray(okdata)) { + //console.log("fetchSoundChannels : ", okdata) + window.SoundChannelList.push(...okdata); + } else console.log("fetchSoundChannels: okdata is not array"); + }, (errdata) => { + alert("Error loading sound channels : " + errdata.message); + }); +} $(document).ready(function () { console.log("broadcastzones.js loaded successfully"); @@ -67,7 +113,7 @@ $(document).ready(function () { let $findzone = $('#findzone'); - $findzone.on('input', function () { + $findzone.off('input').on('input', function () { let searchTerm = $findzone.val().trim().toLowerCase(); if (searchTerm.length > 0) { window.selectedBroadcastZoneRow = null; @@ -97,36 +143,35 @@ $(document).ready(function () { $broadcastzonedescription.val(''); // fill broadcastzonesoundchannel from SoundChannelList $broadcastzonesoundchannel.empty(); - if (Array.isArray(SoundChannelList) && SoundChannelList.length > 0) { + console.log("SoundChannelList:", window.SoundChannelList); + if (Array.isArray(window.SoundChannelList) && window.SoundChannelList.length > 0) { // SoundChannelList ada isinya - SoundChannelList.forEach(ch => { - if (ch.channel && ch.channel.length > 0){ - // hanya yang punya channel saja - $broadcastzonesoundchannel.append($('