提交 0a4a8217 编写于 作者: P Piotr Bryk

Merge pull request #834 from taimir/i18n-localize2

Localization of DaemonSetList and -Details views
......@@ -295,4 +295,30 @@
<translation id="2693446009711847579" key="MSG_POD_LIST_CLUSTER_IP_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Cluster IP' which appears as a column label in the table of pods (pod list view).">Cluster IP</translation>
<translation id="5813142739866251633" key="MSG_POD_LIST_LOGS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Logs' for the pod's logs which appears as a column label in the table of pods (pod list view).">Logs</translation>
<translation id="7960943445839044368" key="MSG_POD_LIST_POD_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pod' which is used as a title for the delete/update dialogs (that can be opened from the pod list view.)">Pod</translation>
<translation id="1183334493862832095" key="MSG_DAEMON_SET_LIST_CREATED_AT_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip 'Created at [some date]' showing the exact creation time of the daemon set.">Created at <ph name="CREATION_DATE" /></translation>
<translation id="6536269801786102616" key="MSG_DAEMON_SET_LIST_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' which appears as a column label in the table of daemon sets (daemon set list view).">Name</translation>
<translation id="4173398054373898245" key="MSG_DAEMON_SET_LIST_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' which appears as a column label in the table of daemon sets (daemon set list view).">Labels</translation>
<translation id="1244511811693456890" key="MSG_DAEMON_SET_LIST_PODS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' which appears as a column label in the table of daemon sets (daemon set list view).">Pods</translation>
<translation id="6332752487795060801" key="MSG_DAEMON_SET_LIST_AGE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Age' which appears as a column label in the table of daemon sets (daemon set list view).">Age</translation>
<translation id="8642137973376039305" key="MSG_DAEMON_SET_LIST_INTERNAL_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Internal endpoints' which appears as a column label in the table of daemon sets (daemon set list view).">Internal endpoints</translation>
<translation id="4618575725879423736" key="MSG_DAEMON_SET_LIST_EXTERNAL_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'External endpoints' which appears as a column label in the table of daemon sets (daemon set list view).">External endpoints</translation>
<translation id="6393297430328784111" key="MSG_DAEMON_SET_LIST_IMAGES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' which appears as a column label in the table of daemon sets (daemon set list view).">Images</translation>
<translation id="5827493628743169857" key="MSG_DAEMON_SET_LIST_DAEMON_SET_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Daemon set' which is used as a title for the delete/update dialogs (that can be opened on the daemon set list view.)">Daemon Set</translation>
<translation id="4300538864956302901" key="MSG_DAEMON_SET_DETAIL_OVERVIEW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Overview' on the left navigation tab on the daemon set detail page.">Overview</translation>
<translation id="1323629914147178678" key="MSG_DAEMON_SET_DETAIL_PODS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pods' for the pods information section on the daemon set detail page.">Pods</translation>
<translation id="3665284318614920515" key="MSG_DAEMON_SET_DETAIL_EVENTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' on the right navigation tab on the daemon set detail page.">Events</translation>
<translation id="6016438303542201356" key="MSG_DAEMON_SET_INFO_RESOURCE_DETAILS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Resource details' at the top of the daemon set details page.">Resource details</translation>
<translation id="3721222763091466156" key="MSG_DAEMON_SET_INFO_DETAILS_SUBTITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Subtitle 'Details' for the left section with general information about a daemon set on the daemonset details page.">Details</translation>
<translation id="7584335351714670917" key="MSG_DAEMON_SET_INFO_NAMESPACE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' for the daemon set namespace on the details page.">Namespace</translation>
<translation id="5560848877490809715" key="MSG_DAEMON_SET_INFO_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' for the daemon set name on the details page.">Name</translation>
<translation id="6410738843532678290" key="MSG_DAEMON_SET_INFO_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' for the daemon set's labels list on the daemon set details page.">Labels</translation>
<translation id="4219844447591472092" key="MSG_DAEMON_SET_INFO_IMAGES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' for the list of images used in a daemon set, on its details page.">Images</translation>
<translation id="6964572476509814314" key="MSG_DAEMON_SET_INFO_STATUS_SUBTITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Subtitle 'Status' for the right section with pod status information on the daemon set details page.">Status</translation>
<translation id="7717657511877774779" key="MSG_DAEMON_SET_INFO_PODS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the pods in a daemon set on its details page.">Pods</translation>
<translation id="8115427792060255111" key="MSG_DAEMON_SET_INFO_PODS_STATUS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods status' for the status of the pods in a daemon set, on the daemon set details page.">Pods status</translation>
<translation id="8384261412987442737" key="MSG_DAEMON_SET_INFO_PODS_CREATED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods were created (daemon set details page)."><ph name="PODS_COUNT" /> created</translation>
<translation id="5423848389467319464" key="MSG_DAEMON_SET_INFO_PODS_RUNNING_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are running (daemon set details page)."><ph name="PODS_COUNT" /> running</translation>
<translation id="2328533985893907512" key="MSG_DAEMON_SET_INFO_PODS_PENDING_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are pending (daemon set details page)."><ph name="PODS_COUNT" /> pending</translation>
<translation id="6856411708593343212" key="MSG_DAEMON_SET_INFO_PODS_FAILED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods have failed (daemon set details page)."><ph name="PODS_COUNT" /> failed</translation>
<translation id="710513909601852119" key="MSG_DAEMON_SET_INFO_PODS_DESIRED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are desired to run (daemon set details page)."><ph name="PODS_COUNT" /> desired</translation>
</translationbundle>
......@@ -295,4 +295,30 @@
<translation id="2693446009711847579" key="MSG_POD_LIST_CLUSTER_IP_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Cluster IP' which appears as a column label in the table of pods (pod list view).">Cluster IP</translation>
<translation id="5813142739866251633" key="MSG_POD_LIST_LOGS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Logs' for the pod's logs which appears as a column label in the table of pods (pod list view).">Logs</translation>
<translation id="7960943445839044368" key="MSG_POD_LIST_POD_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pod' which is used as a title for the delete/update dialogs (that can be opened from the pod list view.)">Pod</translation>
<translation id="1183334493862832095" key="MSG_DAEMON_SET_LIST_CREATED_AT_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip 'Created at [some date]' showing the exact creation time of the daemon set.">Created at <ph name="CREATION_DATE" /></translation>
<translation id="6536269801786102616" key="MSG_DAEMON_SET_LIST_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' which appears as a column label in the table of daemon sets (daemon set list view).">Name</translation>
<translation id="4173398054373898245" key="MSG_DAEMON_SET_LIST_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' which appears as a column label in the table of daemon sets (daemon set list view).">Labels</translation>
<translation id="1244511811693456890" key="MSG_DAEMON_SET_LIST_PODS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' which appears as a column label in the table of daemon sets (daemon set list view).">Pods</translation>
<translation id="6332752487795060801" key="MSG_DAEMON_SET_LIST_AGE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Age' which appears as a column label in the table of daemon sets (daemon set list view).">Age</translation>
<translation id="8642137973376039305" key="MSG_DAEMON_SET_LIST_INTERNAL_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Internal endpoints' which appears as a column label in the table of daemon sets (daemon set list view).">Internal endpoints</translation>
<translation id="4618575725879423736" key="MSG_DAEMON_SET_LIST_EXTERNAL_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'External endpoints' which appears as a column label in the table of daemon sets (daemon set list view).">External endpoints</translation>
<translation id="6393297430328784111" key="MSG_DAEMON_SET_LIST_IMAGES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' which appears as a column label in the table of daemon sets (daemon set list view).">Images</translation>
<translation id="5827493628743169857" key="MSG_DAEMON_SET_LIST_DAEMON_SET_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Daemon set' which is used as a title for the delete/update dialogs (that can be opened on the daemon set list view.)">Daemon Set</translation>
<translation id="4300538864956302901" key="MSG_DAEMON_SET_DETAIL_OVERVIEW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Overview' on the left navigation tab on the daemon set detail page.">Overview</translation>
<translation id="1323629914147178678" key="MSG_DAEMON_SET_DETAIL_PODS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pods' for the pods information section on the daemon set detail page.">Pods</translation>
<translation id="3665284318614920515" key="MSG_DAEMON_SET_DETAIL_EVENTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' on the right navigation tab on the daemon set detail page.">Events</translation>
<translation id="6016438303542201356" key="MSG_DAEMON_SET_INFO_RESOURCE_DETAILS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Resource details' at the top of the daemon set details page.">Resource details</translation>
<translation id="3721222763091466156" key="MSG_DAEMON_SET_INFO_DETAILS_SUBTITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Subtitle 'Details' for the left section with general information about a daemon set on the daemonset details page.">Details</translation>
<translation id="7584335351714670917" key="MSG_DAEMON_SET_INFO_NAMESPACE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' for the daemon set namespace on the details page.">Namespace</translation>
<translation id="5560848877490809715" key="MSG_DAEMON_SET_INFO_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' for the daemon set name on the details page.">Name</translation>
<translation id="6410738843532678290" key="MSG_DAEMON_SET_INFO_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Labels' for the daemon set's labels list on the daemon set details page.">Labels</translation>
<translation id="4219844447591472092" key="MSG_DAEMON_SET_INFO_IMAGES_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Images' for the list of images used in a daemon set, on its details page.">Images</translation>
<translation id="6964572476509814314" key="MSG_DAEMON_SET_INFO_STATUS_SUBTITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Subtitle 'Status' for the right section with pod status information on the daemon set details page.">Status</translation>
<translation id="7717657511877774779" key="MSG_DAEMON_SET_INFO_PODS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods' for the pods in a daemon set on its details page.">Pods</translation>
<translation id="8115427792060255111" key="MSG_DAEMON_SET_INFO_PODS_STATUS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Pods status' for the status of the pods in a daemon set, on the daemon set details page.">Pods status</translation>
<translation id="8384261412987442737" key="MSG_DAEMON_SET_INFO_PODS_CREATED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods were created (daemon set details page)."><ph name="PODS_COUNT" /> created</translation>
<translation id="5423848389467319464" key="MSG_DAEMON_SET_INFO_PODS_RUNNING_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are running (daemon set details page)."><ph name="PODS_COUNT" /> running</translation>
<translation id="2328533985893907512" key="MSG_DAEMON_SET_INFO_PODS_PENDING_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are pending (daemon set details page)."><ph name="PODS_COUNT" /> pending</translation>
<translation id="6856411708593343212" key="MSG_DAEMON_SET_INFO_PODS_FAILED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods have failed (daemon set details page)."><ph name="PODS_COUNT" /> failed</translation>
<translation id="710513909601852119" key="MSG_DAEMON_SET_INFO_PODS_DESIRED_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="The message says that that many pods are desired to run (daemon set details page)."><ph name="PODS_COUNT" /> desired</translation>
</translationbundle>
......@@ -17,10 +17,10 @@ limitations under the License.
<div layout="column">
<md-content>
<md-tabs md-border-bottom md-dynamic-height>
<md-tab label="Overview">
<md-tab label="{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_OVERVIEW_LABEL}}">
<kd-daemon-set-info daemon-set="::ctrl.daemonSetDetail"></kd-daemon-set-info>
<kd-content-card>
<kd-title>Pods</kd-title>
<kd-title>{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.daemonSetDetail.pods"
logs-href-fn="::ctrl.getPodLogsHref(pod)">
......@@ -28,7 +28,7 @@ limitations under the License.
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="Events">
<md-tab label="{{::ctrl.i18n.MSG_DAEMON_SET_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list events="::ctrl.daemonSetDetail.eventList.events"></kd-event-card-list>
</md-tab>
</md-tabs>
......
......@@ -23,5 +23,20 @@ export class DaemonSetDetailController {
constructor(daemonSetDetail) {
/** @export {!backendApi.DaemonSet} */
this.daemonSetDetail = daemonSetDetail;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Label 'Overview' on the left navigation tab on the daemon set detail
page. */
MSG_DAEMON_SET_DETAIL_OVERVIEW_LABEL: goog.getMsg('Overview'),
/** @export {string} @desc Title 'Pods' for the pods information section on the daemon set detail
page. */
MSG_DAEMON_SET_DETAIL_PODS_TITLE: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Events' on the right navigation tab on the daemon set detail
page. */
MSG_DAEMON_SET_DETAIL_EVENTS_LABEL: goog.getMsg('Events'),
};
......@@ -15,46 +15,45 @@ limitations under the License.
-->
<kd-info-card>
<kd-info-card-header>Resource details</kd-info-card-header>
<kd-info-card-section name="Details">
<kd-info-card-entry title="Name">
<kd-info-card-header>{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_RESOURCE_DETAILS_TITLE}}</kd-info-card-header>
<kd-info-card-section name="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_DETAILS_SUBTITLE}}">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_NAME_LABEL}}">
<kd-middle-ellipsis
display-string="{{::$ctrl.daemonSet.objectMeta.name}}">
</kd-middle-ellipsis>
</kd-info-card-entry>
<kd-info-card-entry title="Namespace">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_NAMESPACE_LABEL}}">
{{::$ctrl.daemonSet.objectMeta.namespace}}
</kd-info-card-entry>
<kd-info-card-entry title="Labels">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_LABELS_LABEL}}">
<kd-labels labels="::$ctrl.daemonSet.objectMeta.labels"></kd-labels>
</kd-info-card-entry>
<kd-info-card-entry title="Images">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_IMAGES_LABEL}}">
<div ng-repeat="image in $ctrl.daemonSet.containerImages">
<kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
</div>
</kd-info-card-entry>
</kd-info-card-section>
<kd-info-card-section name="Status">
<kd-info-card-entry title="Pods">
<kd-info-card-section name="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_STATUS_SUBTITLE}}">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_LABEL}}">
<div ng-if="!$ctrl.areDesiredPodsRunning()">
{{::$ctrl.daemonSet.podInfo.current}} created,
{{::$ctrl.daemonSet.podInfo.desired}} desired
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_CREATED_LABEL}},
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_DESIRED_LABEL}}
</div>
<div ng-if="$ctrl.areDesiredPodsRunning()">
{{::$ctrl.daemonSet.podInfo.running}} running
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_RUNNING_LABEL}}
</div>
</kd-info-card-entry>
<kd-info-card-entry title="Pods status" ng-if="!$ctrl.areDesiredPodsRunning()">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_STATUS_LABEL}}" ng-if="!$ctrl.areDesiredPodsRunning()">
<div ng-if="!$ctrl.areDesiredPodsRunning()">
<div ng-if="::$ctrl.daemonSet.podInfo.pending" class="kd-comma-separated-item">
{{::$ctrl.daemonSet.podInfo.pending}} pending<!-- Collapse whitespace
--></div>
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_PENDING_LABEL}}
</div>
<div ng-if="::$ctrl.daemonSet.podInfo.failed" class="kd-comma-separated-item">
{{::$ctrl.daemonSet.podInfo.failed}} failed<!-- Collapse whitespace
--></div>
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_FAILED_LABEL}}></div>
<div ng-if="::$ctrl.daemonSet.podInfo.running" class="kd-comma-separated-item">
{{::$ctrl.daemonSet.podInfo.running}} running
{{::$ctrl.i18n.MSG_DAEMON_SET_INFO_PODS_RUNNING_LABEL}}
</div>
</div>
</kd-info-card-entry>
......
......@@ -25,6 +25,9 @@ export default class DaemonSetInfoController {
* @export {!backendApi.DaemonSet}
*/
this.daemonSet;
/** @export */
this.i18n = i18n(this.daemonSet);
}
/**
......@@ -49,3 +52,55 @@ export const daemonSetInfoComponent = {
'daemonSet': '=',
},
};
/**
* @param {!backendApi.DaemonSet} daemonSet
* @return {!Object} a dictionary of translatable messages
*/
function i18n(daemonSet) {
return {
/** @export {string} @desc Title 'Resource details' at the top of the daemon set details page.*/
MSG_DAEMON_SET_INFO_RESOURCE_DETAILS_TITLE: goog.getMsg('Resource details'),
/** @export {string} @desc Subtitle 'Details' for the left section with general information
about a daemon set on the daemonset details page.*/
MSG_DAEMON_SET_INFO_DETAILS_SUBTITLE: goog.getMsg('Details'),
/** @export {string} @desc Label 'Namespace' for the daemon set namespace on the details page.*/
MSG_DAEMON_SET_INFO_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Name' for the daemon set name on the details page.*/
MSG_DAEMON_SET_INFO_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Labels' for the daemon set's labels list on the
daemon set details page.*/
MSG_DAEMON_SET_INFO_LABELS_LABEL: goog.getMsg('Labels'),
/** @export {string} @desc Label 'Images' for the list of images used in a daemon set, on its
details page. */
MSG_DAEMON_SET_INFO_IMAGES_LABEL: goog.getMsg('Images'),
/** @export {string} @desc Subtitle 'Status' for the right section with pod status information
on the daemon set details page.*/
MSG_DAEMON_SET_INFO_STATUS_SUBTITLE: goog.getMsg('Status'),
/** @export {string} @desc Label 'Pods' for the pods in a daemon set on its details page.*/
MSG_DAEMON_SET_INFO_PODS_LABEL: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Pods status' for the status of the pods in a daemon set, on
the daemon set details page.*/
MSG_DAEMON_SET_INFO_PODS_STATUS_LABEL: goog.getMsg('Pods status'),
/** @export {string} @desc The message says that that many pods were created
(daemon set details page). */
MSG_DAEMON_SET_INFO_PODS_CREATED_LABEL:
goog.getMsg('{$podsCount} created', {'podsCount': daemonSet.podInfo.current}),
/** @export {string} @desc The message says that that many pods are running
(daemon set details page). */
MSG_DAEMON_SET_INFO_PODS_RUNNING_LABEL:
goog.getMsg('{$podsCount} running', {'podsCount': daemonSet.podInfo.running}),
/** @export {string} @desc The message says that that many pods are pending
(daemon set details page). */
MSG_DAEMON_SET_INFO_PODS_PENDING_LABEL:
goog.getMsg('{$podsCount} pending', {'podsCount': daemonSet.podInfo.pending}),
/** @export {string} @desc The message says that that many pods have failed
(daemon set details page). */
MSG_DAEMON_SET_INFO_PODS_FAILED_LABEL:
goog.getMsg('{$podsCount} failed', {'podsCount': daemonSet.podInfo.failed}),
/** @export {string} @desc The message says that that many pods are desired to run
(daemon set details page). */
MSG_DAEMON_SET_INFO_PODS_DESIRED_LABEL:
goog.getMsg('{$podsCount} desired', {'podsCount': daemonSet.podInfo.desired}),
};
}
......@@ -16,13 +16,13 @@ limitations under the License.
<kd-resource-card-list selectable="::$ctrl.selectable" with-statuses="::$ctrl.withStatuses">
<kd-resource-card-header-columns>
<kd-resource-card-header-column>Name</kd-resource-card-header-column>
<kd-resource-card-header-column>Labels</kd-resource-card-header-column>
<kd-resource-card-header-column>Pods</kd-resource-card-header-column>
<kd-resource-card-header-column>Age</kd-resource-card-header-column>
<kd-resource-card-header-column>Internal endpoints</kd-resource-card-header-column>
<kd-resource-card-header-column>External endpoints</kd-resource-card-header-column>
<kd-resource-card-header-column>Images</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_NAME_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_LABELS_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_PODS_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_AGE_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_INTERNAL_ENDPOINTS_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_EXTERNAL_ENDPOINTS_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column>{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_IMAGES_LABEL}}</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="nogrow">
</kd-resource-card-header-column>
</kd-resource-card-header-columns>
......@@ -58,7 +58,7 @@ limitations under the License.
<kd-resource-card-column>
{{::daemonSet.objectMeta.creationTimestamp | relativeTime}}
<md-tooltip>
Created at {{::daemonSet.objectMeta.creationTimestamp | date:'short'}}
{{::$ctrl.getCreatedAtTooltip(daemonSet.objectMeta.creationTimestamp)}}
</md-tooltip>
</kd-resource-card-column>
<kd-resource-card-column>
......@@ -81,9 +81,9 @@ limitations under the License.
</kd-resource-card-column>
<kd-resource-card-column class="kd-row-layout-column kd-icon-column">
<kd-resource-card-menu>
<kd-resource-card-delete-menu-item resource-kind-name="Daemon Set">
<kd-resource-card-delete-menu-item resource-kind-name="{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_DAEMON_SET_TITLE}}">
</kd-resource-card-delete-menu-item>
<kd-resource-card-edit-menu-item resource-kind-name="Daemon Set">
<kd-resource-card-edit-menu-item resource-kind-name="{{::$ctrl.i18n.MSG_DAEMON_SET_LIST_DAEMON_SET_TITLE}}">
</kd-resource-card-edit-menu-item>
</kd-resource-card-menu>
</kd-resource-card-column>
......
......@@ -21,9 +21,10 @@ import {stateName} from 'daemonsetdetail/daemonsetdetail_state';
export class DaemonSetCardListController {
/**
* @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate
* @ngInject
*/
constructor($state) {
constructor($state, $interpolate) {
/**
* Initialized from the scope.
* @export {!backendApi.ReplicationController}
......@@ -33,6 +34,9 @@ export class DaemonSetCardListController {
/** @private {!ui.router.$state} */
this.state_ = $state;
/** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate;
/**
* @export
*/
......@@ -69,6 +73,20 @@ export class DaemonSetCardListController {
* @export
*/
isSuccess(daemonSet) { return !this.isPending(daemonSet) && !this.hasWarnings(daemonSet); }
/**
* @export
* @param {string} creationDate - creation date of the daemon set
* @return {string} localized tooltip with the formated creation date
*/
getCreatedAtTooltip(creationDate) {
let filter = this.interpolate_(`{{date | date:'short'}}`);
/** @type {string} @desc Tooltip 'Created at [some date]' showing the exact creation time of
* the daemon set.*/
let MSG_DAEMON_SET_LIST_CREATED_AT_TOOLTIP =
goog.getMsg('Created at {$creationDate}', {'creationDate': filter({'date': creationDate})});
return MSG_DAEMON_SET_LIST_CREATED_AT_TOOLTIP;
}
}
/**
......@@ -92,7 +110,30 @@ export const daemonSetCardListComponent = {
const i18n = {
/** @export {string} @desc tooltip for failed pod card icon */
MSG_PODS_ARE_FAILED_TOOLTIP: goog.getMsg('One or more pods have errors.'),
/** @export {string} @desc tooltip for pending pod card icon */
MSG_PODS_ARE_PENDING_TOOLTIP: goog.getMsg('One or more pods are in pending state.'),
/** @export {string} @desc Label 'Name' which appears as a column label in the table of
daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of
daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'),
/** @export {string} @desc Label 'Pods' which appears as a column label in the table of
daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_PODS_LABEL: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Age' which appears as a column label in the table of
daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_AGE_LABEL: goog.getMsg('Age'),
/** @export {string} @desc Label 'Internal endpoints' which appears as a column label in the table
of daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_INTERNAL_ENDPOINTS_LABEL: goog.getMsg('Internal endpoints'),
/** @export {string} @desc Label 'External endpoints' which appears as a column label in the table
of daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_EXTERNAL_ENDPOINTS_LABEL: goog.getMsg('External endpoints'),
/** @export {string} @desc Label 'Images' which appears as a column label in the table of
daemon sets (daemon set list view). */
MSG_DAEMON_SET_LIST_IMAGES_LABEL: goog.getMsg('Images'),
/** @export {string} @desc Title 'Daemon set' which is used as a title for the delete/update
dialogs (that can be opened on the daemon set list view.) */
MSG_DAEMON_SET_LIST_DAEMON_SET_TITLE: goog.getMsg('Daemon Set'),
};
......@@ -23,9 +23,18 @@ describe('Daemon Set Info controller', () => {
beforeEach(() => {
angular.mock.module(daemonSetDetailModule.name);
angular.mock.inject(($componentController, $rootScope) => {
ctrl = $componentController('kdDaemonSetInfo', {$scope: $rootScope});
ctrl = $componentController('kdDaemonSetInfo', {$scope: $rootScope}, {
daemonSet: {
podInfo: {
running: 0,
desired: 0,
failed: 0,
current: 0,
pending: 0,
},
},
});
});
});
......
......@@ -40,4 +40,8 @@ describe('Daemon Set card', () => {
expect(ctrl.getDaemonSetDetailHref(daemonSet)).toEqual('#/daemonset/foo-namespace/foo-name');
});
it('should format the "created at" tooltip correctly'), () => {
expect(ctrl.getCreatedAtTooltip('2016-06-06T09:13:12Z')).toEqual('Created at 6/6/16 09:13 AM');
};
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册