diff --git a/frontend/client/app.js b/frontend/client/app.js index 7e6db38a..57148009 100755 --- a/frontend/client/app.js +++ b/frontend/client/app.js @@ -12,21 +12,24 @@ import auth from './auth' import lodash from 'lodash' import VueLodash from 'vue-lodash' -Vue.prototype.$http = axios -Vue.axios = axios +const axiosInstance = axios.create({ + baseURL: './' +}) + +Vue.prototype.$http = axiosInstance +Vue.axios = axiosInstance Vue.router = router Vue.use(NProgress) Vue.use(VueLodash, lodash) // Auth interceptors -axios.interceptors.request.use(function (request) { +axiosInstance.interceptors.request.use(function (request) { request.headers['Authorization'] = 'Bearer ' + auth.getToken() return request }) // Enable devtools Vue.config.devtools = true - sync(store, router) const nprogress = new NProgress({ parent: '.nprogress-container' }) diff --git a/frontend/client/views/pipeline/detail.vue b/frontend/client/views/pipeline/detail.vue index 5640c249..f1e03a83 100755 --- a/frontend/client/views/pipeline/detail.vue +++ b/frontend/client/views/pipeline/detail.vue @@ -173,9 +173,12 @@ export default { this.runID = runID // Run ID specified. Do concurrent request - this.$http.all([this.getPipeline(pipelineID), this.getPipelineRun(pipelineID, runID), this.getPipelineRuns(pipelineID)]) - .then(this.$http.spread(function (pipeline, pipelineRun, pipelineRuns) { + Promise.all([this.getPipeline(pipelineID), this.getPipelineRun(pipelineID, runID), this.getPipelineRuns(pipelineID)]) + .then(values => { // We only redraw the pipeline if pipeline is running + var pipeline = values[0] + var pipelineRun = values[1] + var pipelineRuns = values[2] if (pipelineRun.data.status !== 'running' && !this.lastRedraw) { this.drawPipelineDetail(pipeline.data, pipelineRun.data) this.lastRedraw = true @@ -185,15 +188,17 @@ export default { } this.runsRows = pipelineRuns.data this.pipeline = pipeline.data - }.bind(this))) + }) .catch((error) => { this.$store.commit('clearIntervals') this.$onError(error) }) } else { // Do concurrent request - this.$http.all([this.getPipeline(pipelineID), this.getPipelineRuns(pipelineID)]) - .then(this.$http.spread(function (pipeline, pipelineRuns) { + Promise.all([this.getPipeline(pipelineID), this.getPipelineRuns(pipelineID)]) + .then(values => { + var pipeline = values[0] + var pipelineRuns = values[1] if (!this.lastRedraw) { this.drawPipelineDetail(pipeline.data, null) this.lastRedraw = true @@ -204,7 +209,7 @@ export default { this.runsRows = pipelineRuns.data } this.pipeline = pipeline.data - }.bind(this))) + }) .catch((error) => { this.$store.commit('clearIntervals') this.$onError(error) diff --git a/frontend/config/index.js b/frontend/config/index.js index 4fe275eb..af5e3535 100755 --- a/frontend/config/index.js +++ b/frontend/config/index.js @@ -9,7 +9,7 @@ module.exports = { index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'assets', - assetsPublicPath: '/', + assetsPublicPath: './', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. diff --git a/handlers/handler.go b/handlers/handler.go index 9662a936..993c47e1 100644 --- a/handlers/handler.go +++ b/handlers/handler.go @@ -102,7 +102,7 @@ func InitHandlers(e *echo.Echo) error { e.GET("/favicon.ico", echo.WrapHandler(assetHandler)) e.GET("/assets/css/*", echo.WrapHandler(http.StripPrefix("/", assetHandler))) e.GET("/assets/js/*", echo.WrapHandler(http.StripPrefix("/", assetHandler))) - e.GET("/assets/fonts/*", echo.WrapHandler(http.StripPrefix("/", assetHandler))) + e.GET("/assets/css/assets/fonts/*", echo.WrapHandler(http.StripPrefix("/assets/css/", assetHandler))) e.GET("/assets/img/*", echo.WrapHandler(http.StripPrefix("/", assetHandler))) }