chore(View): Remove unnecessary theme view and defer basic styles (#30128)
This commit is contained in:
parent
92680b3fe4
commit
4ac0bb1bed
|
|
@ -36,6 +36,7 @@
|
||||||
width="{{ app_icon_width }}"
|
width="{{ app_icon_width }}"
|
||||||
src="{{ appbuilder.app_icon }}"
|
src="{{ appbuilder.app_icon }}"
|
||||||
alt="{{ appbuilder.app_name }}"
|
alt="{{ appbuilder.app_name }}"
|
||||||
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
{# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with this work
|
|
||||||
for additional information regarding copyright ownership. The ASF licenses this
|
|
||||||
file to you under the Apache License, Version 2.0 (the "License"); you may not
|
|
||||||
use this file except in compliance with the License. You may obtain a copy of
|
|
||||||
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
|
|
||||||
applicable law or agreed to in writing, software distributed under the License
|
|
||||||
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
KIND, either express or implied. See the License for the specific language
|
|
||||||
governing permissions and limitations under the License. #}
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
{# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
{% import 'appbuilder/general/lib.html' as lib %} {% from
|
contributor license agreements. See the NOTICE file distributed with this work
|
||||||
'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context
|
for additional information regarding copyright ownership. The ASF licenses this
|
||||||
%} {% set favicons = appbuilder.app.config['FAVICONS'] %}
|
file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
<html>
|
use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
|
||||||
|
applicable law or agreed to in writing, software distributed under the License
|
||||||
|
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the specific language
|
||||||
|
governing permissions and limitations under the License. #}
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
{% import 'appbuilder/general/lib.html' as lib %} {% from
|
||||||
|
'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context
|
||||||
|
%} {% set favicons = appbuilder.app.config['FAVICONS'] %}
|
||||||
|
{% import "superset/macros.html" as macros %}
|
||||||
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{% include "head_custom_extra.html" %}
|
{% include "head_custom_extra.html" %}
|
||||||
<title>
|
<title>
|
||||||
|
|
@ -28,34 +30,34 @@ governing permissions and limitations under the License. #}
|
||||||
favicon.href.startswith("http") else assets_prefix }}{{favicon.href}}" > {%
|
favicon.href.startswith("http") else assets_prefix }}{{favicon.href}}" > {%
|
||||||
endfor %}
|
endfor %}
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="preload"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/flags/flags16.css"
|
href="{{ assets_prefix }}/static/appbuilder/css/flags/flags16.css"
|
||||||
|
as="style"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="preload"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/fontawesome.min.css"
|
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/fontawesome.min.css"
|
||||||
|
as="style"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="preload"
|
||||||
type="text/css"
|
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/regular.min.css"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/solid.min.css"
|
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/solid.min.css"
|
||||||
|
as="style"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="preload"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/brands.min.css"
|
href="{{ assets_prefix }}/static/appbuilder/css/fontawesome/brands.min.css"
|
||||||
|
as="style"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="preload"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="{{ assets_prefix }}/static/appbuilder/css/select2/select2.min.css"
|
href="{{ assets_prefix }}/static/appbuilder/css/select2/select2.min.css"
|
||||||
|
as="style"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{ css_bundle("theme") }} {% if entry %} {{ css_bundle(entry) }} {% endif %}
|
{{ css_bundle("theme") }} {% if entry %} {{ css_bundle(entry) }} {% endif %}
|
||||||
|
|
@ -120,5 +122,16 @@ governing permissions and limitations under the License. #}
|
||||||
{% block tail_js %} {% if not standalone_mode %} {{ js_bundle('menu') }} {%
|
{% block tail_js %} {% if not standalone_mode %} {{ js_bundle('menu') }} {%
|
||||||
endif %} {% if entry %} {{ js_bundle(entry) }} {% endif %} {% include
|
endif %} {% if entry %} {{ js_bundle(entry) }} {% endif %} {% include
|
||||||
"tail_js_custom_extra.html" %} {% endblock %}
|
"tail_js_custom_extra.html" %} {% endblock %}
|
||||||
|
|
||||||
|
<!-- Handle deferred stylesheets -->
|
||||||
|
<script nonce="{{ macros.get_nonce() }}">
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var preloadLinks = document.querySelectorAll('link[rel="preload"][as="style"]');
|
||||||
|
|
||||||
|
preloadLinks.forEach(function(link) {
|
||||||
|
link.rel = 'stylesheet';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -864,10 +864,6 @@ class Superset(BaseSupersetView):
|
||||||
def log(self) -> FlaskResponse:
|
def log(self) -> FlaskResponse:
|
||||||
return Response(status=200)
|
return Response(status=200)
|
||||||
|
|
||||||
@expose("/theme/")
|
|
||||||
def theme(self) -> FlaskResponse:
|
|
||||||
return self.render_template("superset/theme.html")
|
|
||||||
|
|
||||||
@api
|
@api
|
||||||
@handle_api_exception
|
@handle_api_exception
|
||||||
@has_access
|
@has_access
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue