Browse Source

feat(plugins): restored config view functionality to plugin page

Torkel Ödegaard 9 years ago
parent
commit
d55dc92502

+ 5 - 5
public/app/core/directives/plugin_component.ts

@@ -160,13 +160,13 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
       }
       // AppConfigCtrl
       case 'app-config-ctrl': {
-        let appModel = scope.ctrl.appModel;
-        return System.import(appModel.module).then(function(appModule) {
+        let model = scope.ctrl.model;
+        return System.import(model.module).then(function(appModule) {
           return {
-            baseUrl: appModel.baseUrl,
-            name: 'app-config-' + appModel.appId,
+            baseUrl: model.baseUrl,
+            name: 'app-config-' + model.pluginId,
             bindings: {appModel: "=", appEditCtrl: "="},
-            attrs: {"app-model": "ctrl.appModel", "app-edit-ctrl": "ctrl"},
+            attrs: {"app-model": "ctrl.model", "app-edit-ctrl": "ctrl"},
             Component: appModule.ConfigCtrl,
           };
         });

+ 19 - 1
public/app/features/plugins/partials/edit.html

@@ -47,6 +47,13 @@
 					<editor-checkbox text="Pinned" model="ctrl.model.pinned" change="ctrl.togglePinned()"></editor-checkbox>
 				</div>
 			</div>
+
+			<div ng-if="ctrl.model.pluginId">
+				<plugin-component type="app-config-ctrl"></plugin-component>
+				<div class="clearfix"></div>
+				<button type="submit" class="btn btn-success" ng-click="ctrl.update()">Save</button>
+			</div>
+
 		</div>
 
 		<aside class="page-sidebar">
@@ -56,7 +63,18 @@
 			</section>
 			<section class="page-sidebar-section" ng-show="ctrl.model.type === 'app'">
 				<h5>Includes</h4>
-				<span>TODO</span>
+				<ul class="ui-list">
+					<li ng-show="!ctrl.includedPanels.length"><em>None</em></li>
+					<li ng-repeat="panel in ctrl.includedPanels">
+						{{panel.name}}
+					</li>
+					<li ng-repeat="ds in ctrl.includedDatasources">
+						{{ds.name}}
+					</li>
+					<li ng-repeat="page in ctrl.model.pages">
+						<a href="apps/{{ctrl.appId}}/page/{{page.slug}}" class="external-link">{{page.name}}</a>
+					</li>
+				</ul>
 			</section>
 			<section class="page-sidebar-section">
 				<h5>Dependencies</h4>

+ 1 - 1
public/sass/_variables.dark.scss

@@ -53,7 +53,7 @@ $page-bg:  			   $dark-2;
 $body-color:   		 $gray-4;
 $text-color:   	   $gray-4;
 $text-color-strong: $white;
-$text-color-weak: $gray-1;
+$text-color-weak: $gray-2;
 
 // gradients
 $brand-gradient: linear-gradient(to right, rgba(255,213,0,0.7) 0%, rgba(255,68,0,0.7) 99%, rgba(255,68,0,0.7) 100%);