Skip to content

Commit a8096ef

Browse files
shivaamsuii2210
authored andcommitted
(bugfix): Add dark theme support for FAB Security pages (apache#60908)
* fix(fab): Add dark theme support for FAB Security pages Fixes apache#60541
1 parent 24efe2a commit a8096ef

7 files changed

Lines changed: 17 additions & 5 deletions

File tree

providers/fab/src/airflow/providers/fab/www/static/dist/main.99b8deb941ee474726c9.css renamed to providers/fab/src/airflow/providers/fab/www/static/dist/main.8cffe40bcf7cca998f4e.css

File renamed without changes.

providers/fab/src/airflow/providers/fab/www/static/dist/main.99b8deb941ee474726c9.js renamed to providers/fab/src/airflow/providers/fab/www/static/dist/main.8cffe40bcf7cca998f4e.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/fab/src/airflow/providers/fab/www/static/dist/main.99b8deb941ee474726c9.js.LICENSE.txt renamed to providers/fab/src/airflow/providers/fab/www/static/dist/main.8cffe40bcf7cca998f4e.js.LICENSE.txt

File renamed without changes.

providers/fab/src/airflow/providers/fab/www/static/dist/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"flash.js": "flash.865b6940c00b2a9041b3.js",
66
"loadingDots.css": "loadingDots.07f5b9805847242736e1.css",
77
"loadingDots.js": "loadingDots.07f5b9805847242736e1.js",
8-
"main.css": "main.99b8deb941ee474726c9.css",
9-
"main.js": "main.99b8deb941ee474726c9.js",
8+
"main.css": "main.8cffe40bcf7cca998f4e.css",
9+
"main.js": "main.8cffe40bcf7cca998f4e.js",
1010
"materialIcons.css": "materialIcons.4fe84ae36604d84dec78.css",
1111
"materialIcons.js": "materialIcons.4fe84ae36604d84dec78.js",
1212
"moment.js": "moment.0ec3ee3fb60dc999b1fd.js",

providers/fab/src/airflow/providers/fab/www/static/js/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,17 @@ function filterOpSelected(ele) {
275275
}
276276
}
277277

278+
// Apply color scheme from main UI's theme preference (stored by next-themes)
279+
function applyColorScheme() {
280+
const theme = localStorage.getItem("theme");
281+
if (theme === "dark" || theme === "light") {
282+
document.documentElement.setAttribute("data-color-scheme", theme);
283+
}
284+
}
285+
286+
// Apply immediately to prevent flash of wrong theme
287+
applyColorScheme();
288+
278289
$(document).ready(() => {
279290
initializeUITimezone();
280291

providers/fab/src/airflow/providers/fab/www/templates/airflow/main.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
var hostName = '{{ hostname }}';
5959
$('time[title]').tooltip();
6060
</script>
61+
<script src="{{ url_for_asset('runtime.js') }}"></script>
6162
<script src="{{ url_for_asset('moment.js') }}"></script>
6263
<script src="{{ url_for_asset('jquery-ui.min.js') }}"></script>
6364
<script src="{{ url_for_asset('main.js') }}"></script>

providers/fab/www-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17e7dd3aa9da36e2df592eaed1c385c8d1af451612550dce99b57a74e2faf228
1+
7c7b2ff608159b9ea6048dfdd0dd7ccc0041fd362d54324cc869948585e4cc69

0 commit comments

Comments
 (0)