Small fixes

This commit is contained in:
Torkel Ödegaard 2015-03-02 08:33:06 +01:00
parent bee501da4a
commit ea1164322b
4 changed files with 21 additions and 12 deletions

View File

@ -105,9 +105,12 @@ function (angular, _, config) {
$scope.getCurrentDatasource().then(function(datasource) {
$scope.datasource = datasource;
return $scope.refreshData($scope.datasource).then(function() {
var promise = $scope.refreshData($scope.datasource);
if (promise) {
promise.then(function() { $scope.panelMeta.loading = false; });
} else {
$scope.panelMeta.loading = false;
});
}
}, function(err) {
console.log('Panel data error:', err);

View File

@ -61,9 +61,8 @@ function (angular, app, _, config, PanelMeta) {
params.tag = $scope.panel.tag;
}
backendSrv.get('/api/search', params).then(function(result) {
return backendSrv.search(params).then(function(result) {
$scope.dashList = result.dashboards;
$scope.panelMeta.loading = false;
});
};

View File

@ -41,7 +41,7 @@ function (angular, $, config, _) {
var file_load = function(file) {
return $http({
url: "app/dashboards/"+file.replace(/\.(?!json)/,"/")+'?' + new Date().getTime(),
url: "/dashboards/"+file.replace(/\.(?!json)/,"/")+'?' + new Date().getTime(),
method: "GET",
transformResponse: function(response) {
return renderTemplate(response,$routeParams);
@ -63,7 +63,7 @@ function (angular, $, config, _) {
}
file_load(fileToLoad).then(function(result) {
$scope.initDashboard(result, $scope);
$scope.initDashboard({meta: {}, model: result}, $scope);
});
});

View File

@ -11,17 +11,11 @@
<link rel="stylesheet" href="css/grafana.dark.min.css" title="Dark">
<link rel="icon" type="image/png" href="img/fav32.png">
<script type="text/javascript">
window.grafanaBackend = false;
</script>
<!-- build:js app/app.js -->
<script src="vendor/require/require.js"></script>
<script src="app/components/require.standalone.js"></script>
<!-- endbuild -->
<script>require(['app'], function (app) { app.boot(); })</script>
</head>
<body ng-cloak ng-controller="GrafanaCtrl">
@ -41,4 +35,17 @@
<div ng-view></div>
</body>
<script>
window.grafanaBackend = false;
window.grafanaBootData = {
user: {},
settings: {},
};
require(['app'], function (app) {
app.boot();
})
</script>
</html>