fix hardcoded static path in angularjs
use $windowProvider.$get().STATIC_URL to get correct the static path use $window.WEBROOT to get correct webroot Change-Id: I06a764f231c9f7042ef7be0867df705ceb9d0278
This commit is contained in:
parent
113209883e
commit
bbd5bed33c
@ -8,10 +8,11 @@
|
||||
CloudkittyStepController.$inject = [
|
||||
'$scope',
|
||||
'horizon.framework.widgets.wizard.events',
|
||||
'$http'
|
||||
'$http',
|
||||
'$window'
|
||||
];
|
||||
|
||||
function CloudkittyStepController($scope, wizardEvents, $http) {
|
||||
function CloudkittyStepController($scope, wizardEvents, $http, $window) {
|
||||
|
||||
var onSwitch = $scope.$on(wizardEvents.ON_SWITCH, function(evt, args) {
|
||||
|
||||
@ -35,7 +36,7 @@
|
||||
|
||||
var form_data = [{"service": "compute", "desc": desc_form, "volume": $scope.model.newInstanceSpec.instance_count}];
|
||||
|
||||
$http.post('/dashboard/project/rating/quote', form_data).then(function(res, status) {
|
||||
$http.post($window.WEBROOT + 'project/rating/quote', form_data).then(function(res, status) {
|
||||
$scope.price = res.data;
|
||||
});
|
||||
});
|
||||
|
@ -12,10 +12,11 @@
|
||||
|
||||
$provide.decorator("horizon.dashboard.project.workflow.launch-instance.workflow", ['$delegate', function ($delegate) {
|
||||
var workflow = $delegate;
|
||||
var static_path = $windowProvider.$get().STATIC_URL;
|
||||
workflow.append({
|
||||
formName: 'CloudkittyForm',
|
||||
templateUrl: '/dashboard/static/cloudkitty/templates/cloudkitty-step.html',
|
||||
helpUrl: '/dashboard/static/cloudkitty/templates/cloudkitty-help.html',
|
||||
templateUrl: static_path + 'cloudkitty/templates/cloudkitty-step.html',
|
||||
helpUrl: static_path + 'cloudkitty/templates/cloudkitty-help.html',
|
||||
title: 'Price'
|
||||
});
|
||||
return workflow;
|
||||
|
Loading…
Reference in New Issue
Block a user