Comments (5)
ping @cconard96
from glpi.
As far as I remember, in the .webpack.config.js
, we had to use the following configuration to keep URLs relatives: publicPath: ''
. I guess the same hack should be used for vue components.
from glpi.
Adding ..
before /public
seems to work in my case:
EDIT : It doesn't work everywhere
from glpi.
Adding
..
before/public
seems to work in my case:EDIT : It doesn't work everywhere
Indeed, it work only if the current path has a precise count of directories (e.g. it could work for /front/central.php
but not for /front/asset/assetdefinition.php
).
I tried to use a direct import instead of using the import.meta.webpackContext()
, because I was not able to find any documentation explaining how we could adapt the URL resolution (I am not sure it is even possible).
Here is the patch:
diff --git a/js/src/vue/app.js b/js/src/vue/app.js
index 6cadc3c5b9..c074724a08 100644
--- a/js/src/vue/app.js
+++ b/js/src/vue/app.js
@@ -72,8 +72,11 @@ const components = {};
component_context.keys().forEach((f) => {
// Ex: ./Debug/Toolbar.vue => DebugToolbar
const component_name = f.replace(/^\.\/(.+)\.vue$/, '$1');
+ const path = CFG_GLPI.root_doc + '/public/build/vue/vue-sfc/' + component_name.replace('/', '-') + '-vue.js';
components[component_name] = {
- component: vue.defineAsyncComponent(() => component_context(f)),
+ component: vue.defineAsyncComponent(
+ () => import(/* webpackIgnore: true */path)
+ ),
};
});
// Save components in global scope
The /public/build/vue/vue-sfc/FuzzySearch-Modal-vue.js
file is loaded, but nothing happens (the fuzzy search does not works).
I also tried to use an importmap
, but it does not works. Either I made a mistake, either webpack does not use imports and it then does not work.
<script type="importmap">
{
"imports": {
"/public/build/vue/vue-sfc/FuzzySearch-Modal-vue.js": "{{ config('root_doc') }}/public/build/vue/vue-sfc/FuzzySearch-Modal-vue.js"
}
}
</script>
Another solution could be to use a <base href="{{ config('root_doc') }}">
tag in our pages <head>
, but may have unexpected side effects. I did not tried this solution.
@cconard96 Could you take a look on it? It is really important as it make GLPI unusable when it is not located at the web server root path, for instance when the path is defined by an Alias
apache directive.
from glpi.
Using <base>
isn't a real option. It will break anchors since we use #anchor
, it would refer to the base URL and not the current page anymore.
from glpi.
Related Issues (20)
- Ticket statics timeline broken
- Js console: Uncaught TypeError: ajax_request.profile.sql is undefined HOT 1
- .card-title broken display
- form helper for system name in asset definition displays raw html
- Autoloading custom asset classes broken HOT 1
- Error on displaying network ports HOT 1
- Slow dashboard loading HOT 4
- ticket.knowbaseitems gets knowbaseitems by id not knowbaseitems_id from knowbaseitem_item HOT 1
- codespace build seems to install dependencies twice HOT 1
- "missing configuration" view miss tabler css HOT 2
- FAQ not visible for anonymous
- mail collector: content inside blockquote is ignored
- Error export PDF HOT 3
- Undefined constant "Glpi\RichText\GLPI_TEXT_MAXSIZE (I lost all personal tickets and I no longer have computers) HOT 5
- 2FA Login Broken HOT 3
- Favorite in Saved searches not working
- Duplicated entries in "Computer - Antiviruses"
- only 10 lens with expand_dropdowns=True
- Wrong alternate username with glpi agent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glpi.