mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(apps): moving things around
This commit is contained in:
parent
69d0e82453
commit
f67563e9ee
@ -55,6 +55,20 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
|
||||
Url: "/",
|
||||
})
|
||||
|
||||
if c.OrgRole == m.ROLE_ADMIN {
|
||||
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
|
||||
Text: "Data Sources",
|
||||
Icon: "fa fa-fw fa-database",
|
||||
Url: "/datasources",
|
||||
})
|
||||
|
||||
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
|
||||
Text: "Apps",
|
||||
Icon: "fa fa-fw fa-cubes",
|
||||
Url: "/apps",
|
||||
})
|
||||
}
|
||||
|
||||
orgApps := m.GetAppPluginsQuery{OrgId: c.OrgId}
|
||||
err = bus.Dispatch(&orgApps)
|
||||
if err != nil {
|
||||
|
@ -19,7 +19,7 @@ function (angular, _, $, coreModule, config) {
|
||||
$scope.mainLinks.push({
|
||||
text: item.text,
|
||||
icon: item.icon,
|
||||
href: $scope.getUrl(item.href)
|
||||
url: $scope.getUrl(item.url)
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -40,14 +40,6 @@ function (angular, _, $, coreModule, config) {
|
||||
text: "API Keys",
|
||||
href: $scope.getUrl("/org/apikeys"),
|
||||
});
|
||||
$scope.orgMenu.push({
|
||||
text: "Datasources",
|
||||
href: $scope.getUrl("/datasources"),
|
||||
});
|
||||
$scope.orgMenu.push({
|
||||
text: "Apps",
|
||||
href: $scope.getUrl("/org/apps"),
|
||||
});
|
||||
}
|
||||
|
||||
if ($scope.orgMenu.length > 0) {
|
||||
|
@ -10,6 +10,7 @@ define([
|
||||
$locationProvider.html5Mode(true);
|
||||
|
||||
var loadOrgBundle = new BundleLoader.BundleLoader('app/features/org/all');
|
||||
var loadAppsBundle = new BundleLoader.BundleLoader('app/features/apps/all');
|
||||
|
||||
$routeProvider
|
||||
.when('/', {
|
||||
@ -131,17 +132,17 @@ define([
|
||||
templateUrl: 'app/partials/reset_password.html',
|
||||
controller : 'ResetPasswordCtrl',
|
||||
})
|
||||
.when('/org/apps', {
|
||||
templateUrl: 'app/features/org/partials/app_list.html',
|
||||
.when('/apps', {
|
||||
templateUrl: 'app/features/apps/partials/list.html',
|
||||
controller: 'AppListCtrl',
|
||||
controllerAs: 'ctrl',
|
||||
resolve: loadOrgBundle,
|
||||
resolve: loadAppsBundle,
|
||||
})
|
||||
.when('/org/apps/edit/:type', {
|
||||
templateUrl: 'app/features/org/partials/app_edit.html',
|
||||
.when('/apps/edit/:type', {
|
||||
templateUrl: 'app/features/apps/partials/edit.html',
|
||||
controller: 'AppEditCtrl',
|
||||
controllerAs: 'ctrl',
|
||||
resolve: loadOrgBundle,
|
||||
resolve: loadAppsBundle,
|
||||
})
|
||||
.when('/global-alerts', {
|
||||
templateUrl: 'app/features/dashboard/partials/globalAlerts.html',
|
||||
|
3
public/app/features/apps/all.ts
Normal file
3
public/app/features/apps/all.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import './edit_ctrl';
|
||||
import './list_ctrl';
|
||||
import './app_srv';
|
@ -18,7 +18,7 @@
|
||||
<li>
|
||||
<div class="filter-list-card-controls">
|
||||
<div class="filter-list-card-config">
|
||||
<a href="org/apps/edit/{{app.type}}">
|
||||
<a href="apps/edit/{{app.type}}">
|
||||
<i class="fa fa-cog"></i>
|
||||
</a>
|
||||
</div>
|
@ -1,32 +0,0 @@
|
||||
define([
|
||||
'angular',
|
||||
],
|
||||
function (angular) {
|
||||
'use strict';
|
||||
|
||||
var module = angular.module('grafana.directives');
|
||||
|
||||
module.directive('appConfigLoader', function($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function(scope, elem) {
|
||||
var directive = 'grafana-app-default';
|
||||
//wait for the parent scope to be applied.
|
||||
scope.panelAdded = false;
|
||||
scope.$watch("current", function(newVal) {
|
||||
if (newVal && !scope.panelAdded) {
|
||||
if (newVal.module) {
|
||||
scope.panelAdded = true;
|
||||
directive = 'grafana-app-'+newVal.type;
|
||||
scope.require([newVal.module], function () {
|
||||
var panelEl = angular.element(document.createElement(directive));
|
||||
elem.append(panelEl);
|
||||
$compile(panelEl)(scope);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user