From 43c2bd183c479b500eaec98cff2a3d2d34f4bf73 Mon Sep 17 00:00:00 2001 From: Jessica Forrester Date: Wed, 15 Apr 2015 13:17:52 -0400 Subject: [PATCH] Move pod template describing into its own directive --- bower.json | 2 +- dist/object-describer.js | 36 +++++++++++++++++++++---------- object-describer.js | 9 ++++++++ views/pod-template.html | 11 ++++++++++ views/replication-controller.html | 12 +---------- 5 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 views/pod-template.html diff --git a/bower.json b/bower.json index a3bb72d..482b8b0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "kubernetes-object-describer", - "version": "0.0.3", + "version": "0.0.4", "description": "Provides an extendable describer for kubernetes resources. Includes an angular directive for rendering an instance of a describer.", "moduleType": [ "globals" diff --git a/dist/object-describer.js b/dist/object-describer.js index f7ce40c..3b7cd2a 100644 --- a/dist/object-describer.js +++ b/dist/object-describer.js @@ -96,6 +96,15 @@ angular.module('kubernetesUI') templateUrl: 'views/footer.html' } }) +.directive("kubernetesObjectDescribePodTemplate", function() { + return { + restrict: 'E', + scope: { + template: '=' + }, + templateUrl: 'views/pod-template.html' + } +}) .directive("kubernetesObjectDescribeVolumes", function() { return { restrict: 'E', @@ -192,6 +201,21 @@ angular.module('kubernetesUI').run(['$templateCache', function($templateCache) { ); + $templateCache.put('views/pod-template.html', + "

Pod Template

\n" + + "
\n" + + "
Restart policy
\n" + + "
{{template.restartPolicy}}
\n" + + "
DNS policy
\n" + + "
{{template.dnsPolicy}}
\n" + + "
\n" + + "

Containers

\n" + + "\n" + + "

Volumes

\n" + + " " + ); + + $templateCache.put('views/pod.html', "
\n" + " \n" + @@ -243,17 +267,7 @@ angular.module('kubernetesUI').run(['$templateCache', function($templateCache) { "
{{selectorKey}}
\n" + "
{{selectorValue}}
\n" + " \n" + - "

Pod Template

\n" + - "
\n" + - "
Restart policy
\n" + - "
{{resource.spec.template.spec.restartPolicy}}
\n" + - "
DNS policy
\n" + - "
{{resource.spec.template.spec.dnsPolicy}}
\n" + - "
\n" + - "

Containers

\n" + - " \n" + - "

Volumes

\n" + - " \n" + + " \n" + " \n" + " \n" + " \n" + diff --git a/object-describer.js b/object-describer.js index 64b9c78..db083b2 100644 --- a/object-describer.js +++ b/object-describer.js @@ -96,6 +96,15 @@ angular.module('kubernetesUI') templateUrl: 'views/footer.html' } }) +.directive("kubernetesObjectDescribePodTemplate", function() { + return { + restrict: 'E', + scope: { + template: '=' + }, + templateUrl: 'views/pod-template.html' + } +}) .directive("kubernetesObjectDescribeVolumes", function() { return { restrict: 'E', diff --git a/views/pod-template.html b/views/pod-template.html new file mode 100644 index 0000000..94aeada --- /dev/null +++ b/views/pod-template.html @@ -0,0 +1,11 @@ +

Pod Template

+
+
Restart policy
+
{{template.restartPolicy}}
+
DNS policy
+
{{template.dnsPolicy}}
+
+

Containers

+ +

Volumes

+ \ No newline at end of file diff --git a/views/replication-controller.html b/views/replication-controller.html index 0d89127..6016f45 100644 --- a/views/replication-controller.html +++ b/views/replication-controller.html @@ -15,17 +15,7 @@

Selector

{{selectorKey}}
{{selectorValue}}
-

Pod Template

-
-
Restart policy
-
{{resource.spec.template.spec.restartPolicy}}
-
DNS policy
-
{{resource.spec.template.spec.dnsPolicy}}
-
-

Containers

- -

Volumes

- +