提交 7e03166e 编写于 作者: A Atanas Mirchev

Localization of ReplicaSetDetail and -List views

上级 3f83fc6d
......@@ -245,4 +245,33 @@
<translation id="8899011645347915060" key="MSG_RC_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 replication controllers (RC list view).">Age</translation>
<translation id="5374042781853456387" key="MSG_RC_LIST_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Endpoints' which appears as a column label in the table of replication controllers (RC list view).">Endpoints</translation>
<translation id="5433863247446350775" key="MSG_RC_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 replication controllers (RC list view).">Images</translation>
<translation id="8767997176248405237" key="MSG_REPLICA_SET_LIST_DEPLOY_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip for the '+' (deploy) button on the replica set list page.">Deploy a containerized app</translation>
<translation id="8299490700020675585" key="MSG_REPLICA_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 replica set.">Created at <ph name="CREATION_DATE" /></translation>
<translation id="2197716156312771575" key="MSG_REPLICA_SET_LIST_PODS_ERRORS_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip saying that some pods in a replica set have errors.">One or more pods have errors</translation>
<translation id="7599108088551291474" key="MSG_REPLICA_SET_LIST_PODS_PENDING_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip saying that some pods in a replica set are pending.">One or more pods are in pending state</translation>
<translation id="5261549269957373177" key="MSG_REPLICA_SET_LIST_REPLICA_SET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Replica Set' which appears at the top of the delete dialog, opened from a replica set list page.">Replica Set</translation>
<translation id="4025964858170096506" key="MSG_REPLICA_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 replica sets (replica set list view).">Name</translation>
<translation id="1993484478466532120" key="MSG_REPLICA_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 replica sets (replica set list view).">Labels</translation>
<translation id="1075715537227574541" key="MSG_REPLICA_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 replica sets (replica set list view).">Pods</translation>
<translation id="717929808301673459" key="MSG_REPLICA_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 replica sets (replica set list view).">Age</translation>
<translation id="4177382164291072231" key="MSG_REPLICA_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 replica sets (replica set list view).">Images</translation>
<translation id="6421110350778699826" key="MSG_REPLICA_SET_DETAIL_REPLICA_SET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Replica Set' which appears at the top of the delete dialog, opened from a replica set details page.">Replica Set</translation>
<translation id="3672827725815353804" key="MSG_REPLICA_SET_DETAIL_PODS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pods', which appears at the top of the pods list on the replica set details view.">Pods</translation>
<translation id="4479562582180028876" key="MSG_REPLICA_SET_DETAIL_OVERVIEW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Overview' for the left navigation tab on the replica set details page.">Overview</translation>
<translation id="5744235193377495761" key="MSG_REPLICA_SET_DETAIL_EVENTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' for the right navigation tab on the replica set details page.">Events</translation>
<translation id="3389843194829052494" key="MSG_REPLICA_SET_DETAIL_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 replica set details page.">Resource details</translation>
<translation id="6752899775879284523" key="MSG_REPLICA_SET_DETAIL_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 replica set on the replica set details page.">Details</translation>
<translation id="7262661227281549532" key="MSG_REPLICA_SET_DETAIL_NAMESPACE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' for the replica set namespace on the replica set details page.">Namespace</translation>
<translation id="2521964392156363405" key="MSG_REPLICA_SET_DETAIL_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' for the replica set name on the replication controller details page.">Name</translation>
<translation id="1551769728551234918" key="MSG_REPLICA_SET_DETAIL_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Label selector' for the replica set's labels list on the replica set details page.">Labels</translation>
<translation id="8919418206139670891" key="MSG_REPLICA_SET_DETAIL_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 replica set, on its details page.">Images</translation>
<translation id="8210773367251942049" key="MSG_REPLICA_SET_DETAIL_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 replica set details page.">Status</translation>
<translation id="3229888510497501973" key="MSG_REPLICA_SET_DETAIL_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 replica set on its details page.">Pods</translation>
<translation id="5031788738993845665" key="MSG_REPLICA_SET_DETAIL_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 replica set, on the replica set details page.">Pods status</translation>
<translation id="1193713714329626256" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> created</translation>
<translation id="8663039587736881994" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> running</translation>
<translation id="8939537005108222252" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> pending</translation>
<translation id="100607008425520225" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> failed</translation>
<translation id="2341408397568673692" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> desired</translation>
<translation id="4426855330749728668" key="MSG_SERVICE_IS_PENDING_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="tooltip for pending pod card icon">This service is in a pending state.</translation>
</translationbundle>
\ No newline at end of file
......@@ -245,4 +245,33 @@
<translation id="8899011645347915060" key="MSG_RC_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 replication controllers (RC list view).">Age</translation>
<translation id="5374042781853456387" key="MSG_RC_LIST_ENDPOINTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Endpoints' which appears as a column label in the table of replication controllers (RC list view).">Endpoints</translation>
<translation id="5433863247446350775" key="MSG_RC_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 replication controllers (RC list view).">Images</translation>
<translation id="8767997176248405237" key="MSG_REPLICA_SET_LIST_DEPLOY_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip for the '+' (deploy) button on the replica set list page.">Deploy a containerized app</translation>
<translation id="8299490700020675585" key="MSG_REPLICA_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 replica set.">Created at <ph name="CREATION_DATE" /></translation>
<translation id="2197716156312771575" key="MSG_REPLICA_SET_LIST_PODS_ERRORS_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip saying that some pods in a replica set have errors.">One or more pods have errors</translation>
<translation id="7599108088551291474" key="MSG_REPLICA_SET_LIST_PODS_PENDING_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Tooltip saying that some pods in a replica set are pending.">One or more pods are in pending state</translation>
<translation id="5261549269957373177" key="MSG_REPLICA_SET_LIST_REPLICA_SET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Replica Set' which appears at the top of the delete dialog, opened from a replica set list page.">Replica Set</translation>
<translation id="4025964858170096506" key="MSG_REPLICA_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 replica sets (replica set list view).">Name</translation>
<translation id="1993484478466532120" key="MSG_REPLICA_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 replica sets (replica set list view).">Labels</translation>
<translation id="1075715537227574541" key="MSG_REPLICA_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 replica sets (replica set list view).">Pods</translation>
<translation id="717929808301673459" key="MSG_REPLICA_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 replica sets (replica set list view).">Age</translation>
<translation id="4177382164291072231" key="MSG_REPLICA_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 replica sets (replica set list view).">Images</translation>
<translation id="6421110350778699826" key="MSG_REPLICA_SET_DETAIL_REPLICA_SET_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Replica Set' which appears at the top of the delete dialog, opened from a replica set details page.">Replica Set</translation>
<translation id="3672827725815353804" key="MSG_REPLICA_SET_DETAIL_PODS_TITLE" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Title 'Pods', which appears at the top of the pods list on the replica set details view.">Pods</translation>
<translation id="4479562582180028876" key="MSG_REPLICA_SET_DETAIL_OVERVIEW_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Overview' for the left navigation tab on the replica set details page.">Overview</translation>
<translation id="5744235193377495761" key="MSG_REPLICA_SET_DETAIL_EVENTS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Events' for the right navigation tab on the replica set details page.">Events</translation>
<translation id="3389843194829052494" key="MSG_REPLICA_SET_DETAIL_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 replica set details page.">Resource details</translation>
<translation id="6752899775879284523" key="MSG_REPLICA_SET_DETAIL_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 replica set on the replica set details page.">Details</translation>
<translation id="7262661227281549532" key="MSG_REPLICA_SET_DETAIL_NAMESPACE_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Namespace' for the replica set namespace on the replica set details page.">Namespace</translation>
<translation id="2521964392156363405" key="MSG_REPLICA_SET_DETAIL_NAME_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Name' for the replica set name on the replication controller details page.">Name</translation>
<translation id="1551769728551234918" key="MSG_REPLICA_SET_DETAIL_LABELS_LABEL" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="Label 'Label selector' for the replica set's labels list on the replica set details page.">Labels</translation>
<translation id="8919418206139670891" key="MSG_REPLICA_SET_DETAIL_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 replica set, on its details page.">Images</translation>
<translation id="8210773367251942049" key="MSG_REPLICA_SET_DETAIL_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 replica set details page.">Status</translation>
<translation id="3229888510497501973" key="MSG_REPLICA_SET_DETAIL_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 replica set on its details page.">Pods</translation>
<translation id="5031788738993845665" key="MSG_REPLICA_SET_DETAIL_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 replica set, on the replica set details page.">Pods status</translation>
<translation id="1193713714329626256" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> created</translation>
<translation id="8663039587736881994" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> running</translation>
<translation id="8939537005108222252" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> pending</translation>
<translation id="100607008425520225" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> failed</translation>
<translation id="2341408397568673692" key="MSG_REPLICA_SET_DETAIL_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 (replica set details page)."><ph name="PODS_COUNT" /> desired</translation>
<translation id="4426855330749728668" key="MSG_SERVICE_IS_PENDING_TOOLTIP" source="/home/mirchev/go_workspace/src/github.com/kubernetes/dashboard/.tmp/serve/app-dev.js" desc="tooltip for pending pod card icon">This service is in a pending state.</translation>
</translationbundle>
\ No newline at end of file
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<kd-actionbar-detail-buttons resource-kind-name="Replica Set"
<kd-actionbar-detail-buttons resource-kind-name="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_REPLICA_SET_LABEL}}"
type-meta="$ctrl.details.typeMeta"
object-meta="$ctrl.details.objectMeta">
</kd-actionbar-detail-buttons>
......@@ -23,5 +23,14 @@ export class ActionBarController {
constructor(replicaSetDetail) {
/** @export {!backendApi.ReplicaSetDetail} */
this.details = replicaSetDetail;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Label 'Replica Set' which appears at the top of the
delete dialog, opened from a replica set details page. */
MSG_REPLICA_SET_DETAIL_REPLICA_SET_LABEL: goog.getMsg('Replica Set'),
};
......@@ -17,11 +17,11 @@ 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_REPLICA_SET_DETAIL_OVERVIEW_LABEL}}">
<kd-replica-set-info replica-set="::ctrl.replicaSetDetail"></kd-replica-set-info>
<kd-content-card>
<kd-title>Pods</kd-title>
<kd-title>{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_TITLE}}</kd-title>
<kd-content>
<kd-pod-card-list pod-list="::ctrl.replicaSetDetail.podList"
logs-href-fn="::ctrl.getPodLogsHref(pod)" with-statuses="true">
......@@ -29,7 +29,7 @@ limitations under the License.
</kd-content>
</kd-content-card>
</md-tab>
<md-tab label="Events">
<md-tab label="{{::ctrl.i18n.MSG_REPLICA_SET_DETAIL_EVENTS_LABEL}}">
<kd-event-card-list events="::ctrl.replicaSetDetail.eventList.events"></kd-event-card-list>
</md-tab>
</md-tabs>
......
......@@ -23,5 +23,20 @@ export class ReplicaSetDetailController {
constructor(replicaSetDetail) {
/** @export {!backendApi.ReplicaSetDetail} */
this.replicaSetDetail = replicaSetDetail;
/** @export */
this.i18n = i18n;
}
}
const i18n = {
/** @export {string} @desc Title 'Pods', which appears at the top of the pods list on the
replica set details view. */
MSG_REPLICA_SET_DETAIL_PODS_TITLE: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Overview' for the left navigation tab on the replica
set details page. */
MSG_REPLICA_SET_DETAIL_OVERVIEW_LABEL: goog.getMsg('Overview'),
/** @export {string} @desc Label 'Events' for the right navigation tab on the replica
set details page. */
MSG_REPLICA_SET_DETAIL_EVENTS_LABEL: goog.getMsg('Events'),
};
......@@ -15,46 +15,47 @@ 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_REPLICA_SET_DETAIL_RESOURCE_DETAILS_TITLE}}</kd-info-card-header>
<kd-info-card-section name="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_DETAILS_SUBTITLE}}">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_NAME_LABEL}}">
<kd-middle-ellipsis
display-string="{{::$ctrl.replicaSet.objectMeta.name}}">
</kd-middle-ellipsis>
</kd-info-card-entry>
<kd-info-card-entry title="Namespace">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_NAMESPACE_LABEL}}">
{{::$ctrl.replicaSet.objectMeta.namespace}}
</kd-info-card-entry>
<kd-info-card-entry title="Labels">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_LABELS_LABEL}}">
<kd-labels labels="::$ctrl.replicaSet.objectMeta.labels"></kd-labels>
</kd-info-card-entry>
<kd-info-card-entry title="Images">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_IMAGES_LABEL}}">
<div ng-repeat="image in $ctrl.replicaSet.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_REPLICA_SET_DETAIL_STATUS_SUBTITLE}}">
<kd-info-card-entry title="{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_LABEL}}">
<div ng-if="!$ctrl.areDesiredPodsRunning()">
{{::$ctrl.replicaSet.podInfo.current}} created,
{{::$ctrl.replicaSet.podInfo.desired}} desired
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_CREATED_LABEL}},
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_DESIRED_LABEL}}
</div>
<div ng-if="$ctrl.areDesiredPodsRunning()">
{{::$ctrl.replicaSet.podInfo.running}} running
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_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_REPLICA_SET_DETAIL_PODS_STATUS_LABEL}}"
ng-if="!$ctrl.areDesiredPodsRunning()">
<div ng-if="!$ctrl.areDesiredPodsRunning()">
<div ng-if="::$ctrl.replicaSet.podInfo.pending" class="kd-comma-separated-item">
{{::$ctrl.replicaSet.podInfo.pending}} pending<!-- Collapse whitespace
--></div>
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_PENDING_LABEL}}
</div>
<div ng-if="::$ctrl.replicaSet.podInfo.failed" class="kd-comma-separated-item">
{{::$ctrl.replicaSet.podInfo.failed}} failed<!-- Collapse whitespace
--></div>
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_FAILED_LABEL}}
</div>
<div ng-if="::$ctrl.replicaSet.podInfo.running" class="kd-comma-separated-item">
{{::$ctrl.replicaSet.podInfo.running}} running
{{::$ctrl.i18n.MSG_REPLICA_SET_DETAIL_PODS_RUNNING_LABEL}}
</div>
</div>
</kd-info-card-entry>
......
......@@ -17,7 +17,7 @@
*/
export default class ReplicaSetInfoController {
/**
* Constructs replication controller info object.
* Constructs replica set info object.
*/
constructor() {
/**
......@@ -25,6 +25,9 @@ export default class ReplicaSetInfoController {
* @export {!backendApi.ReplicaSetDetail}
*/
this.replicaSet;
/** @export */
this.i18n = i18n(this.replicaSet);
}
/**
......@@ -49,3 +52,59 @@ export const replicaSetInfoComponent = {
'replicaSet': '=',
},
};
/**
* @param {!backendApi.ReplicaSetDetail} replicaSet
* @return {!Object} a dictionary of translatable messages
*/
function i18n(replicaSet) {
return {
/** @export {string} @desc Title 'Resource details' at the top of the replica set
details page.*/
MSG_REPLICA_SET_DETAIL_RESOURCE_DETAILS_TITLE: goog.getMsg('Resource details'),
/** @export {string} @desc Subtitle 'Details' for the left section with general information
about a replica set on the replica set details page.*/
MSG_REPLICA_SET_DETAIL_DETAILS_SUBTITLE: goog.getMsg('Details'),
/** @export {string} @desc Label 'Namespace' for the replica set namespace on the
replica set details page.*/
MSG_REPLICA_SET_DETAIL_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Name' for the replica set name on the replication
controller details page.*/
MSG_REPLICA_SET_DETAIL_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Label selector' for the replica set's labels list
on the replica set details page.*/
MSG_REPLICA_SET_DETAIL_LABELS_LABEL: goog.getMsg('Labels'),
/** @export {string} @desc Label 'Images' for the list of images used in a replica
set, on its details page. */
MSG_REPLICA_SET_DETAIL_IMAGES_LABEL: goog.getMsg('Images'),
/** @export {string} @desc Subtitle 'Status' for the right section with pod status information
on the replica set details page.*/
MSG_REPLICA_SET_DETAIL_STATUS_SUBTITLE: goog.getMsg('Status'),
/** @export {string} @desc Label 'Pods' for the pods in a replica set on its details
page.*/
MSG_REPLICA_SET_DETAIL_PODS_LABEL: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Pods status' for the status of the pods in a replica
set, on the replica set details page.*/
MSG_REPLICA_SET_DETAIL_PODS_STATUS_LABEL: goog.getMsg('Pods status'),
/** @export {string} @desc The message says that that many pods were created
(replica set details page). */
MSG_REPLICA_SET_DETAIL_PODS_CREATED_LABEL:
goog.getMsg('{$podsCount} created', {'podsCount': replicaSet.podInfo.current}),
/** @export {string} @desc The message says that that many pods are running
(replica set details page). */
MSG_REPLICA_SET_DETAIL_PODS_RUNNING_LABEL:
goog.getMsg('{$podsCount} running', {'podsCount': replicaSet.podInfo.running}),
/** @export {string} @desc The message says that that many pods are pending
(replica set details page). */
MSG_REPLICA_SET_DETAIL_PODS_PENDING_LABEL:
goog.getMsg('{$podsCount} pending', {'podsCount': replicaSet.podInfo.pending}),
/** @export {string} @desc The message says that that many pods have failed
(replica set details page). */
MSG_REPLICA_SET_DETAIL_PODS_FAILED_LABEL:
goog.getMsg('{$podsCount} failed', {'podsCount': replicaSet.podInfo.failed}),
/** @export {string} @desc The message says that that many pods are desired to run
(replica set details page). */
MSG_REPLICA_SET_DETAIL_PODS_DESIRED_LABEL:
goog.getMsg('{$podsCount} desired', {'podsCount': replicaSet.podInfo.desired}),
};
}
......@@ -19,12 +19,12 @@ limitations under the License.
<md-icon class="material-icons md-warn"
ng-if="::$ctrl.hasWarnings()">
error
<md-tooltip>One or more pods have errors</md-tooltip>
<md-tooltip>{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_PODS_ERRORS_TOOLTIP}}</md-tooltip>
</md-icon>
<md-icon class="material-icons"
ng-if="::$ctrl.isPending()">
timelapse
<md-tooltip>One or more pods are in pending state</md-tooltip>
<md-tooltip>{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_PODS_PENDING_TOOLTIP}}</md-tooltip>
</md-icon>
<md-icon class="material-icons" style="color: green";
......@@ -53,7 +53,7 @@ limitations under the License.
<kd-resource-card-column>
{{::$ctrl.replicaSet.objectMeta.creationTimestamp | relativeTime}}
<md-tooltip>
Created at {{::$ctrl.replicaSet.objectMeta.creationTimestamp | date:'short'}}
{{::$ctrl.getCreatedAtTooltip($ctrl.replicaSet.objectMeta.creationTimestamp)}}
</md-tooltip>
</kd-resource-card-column>
<kd-resource-card-column>
......@@ -63,9 +63,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="Replica Set">
<kd-resource-card-delete-menu-item resource-kind-name="{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_REPLICA_SET_LABEL}}">
</kd-resource-card-delete-menu-item>
<kd-resource-card-edit-menu-item resource-kind-name="Replica Set">
<kd-resource-card-edit-menu-item resource-kind-name="{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_REPLICA_SET_LABEL}}">
</kd-resource-card-edit-menu-item>
</kd-resource-card-menu>
</kd-resource-card-column>
......
......@@ -23,9 +23,10 @@ import {stateName} from 'replicasetdetail/replicasetdetail_state';
export default class ReplicaSetCardController {
/**
* @param {!ui.router.$state} $state
* @param {!angular.$interpolate} $interpolate
* @ngInject
*/
constructor($state) {
constructor($state, $interpolate) {
/**
* Initialized from the scope.
* @export {!backendApi.ReplicaSet}
......@@ -34,6 +35,12 @@ export default class ReplicaSetCardController {
/** @private {!ui.router.$state} */
this.state_ = $state;
/** @private */
this.interpolate_ = $interpolate;
/** @export */
this.i18n = i18n;
}
/**
......@@ -66,6 +73,20 @@ export default class ReplicaSetCardController {
* @export
*/
isSuccess() { return !this.isPending() && !this.hasWarnings(); }
/**
* @export
* @param {string} creationDate - creation date of the replica 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
* replica set. */
let MSG_REPLICA_SET_LIST_CREATED_AT_TOOLTIP =
goog.getMsg('Created at {$creationDate}', {'creationDate': filter({'date': creationDate})});
return MSG_REPLICA_SET_LIST_CREATED_AT_TOOLTIP;
}
}
/**
......@@ -78,3 +99,13 @@ export const replicaSetCardComponent = {
controller: ReplicaSetCardController,
templateUrl: 'replicasetlist/replicasetcard.html',
};
const i18n = {
/** @export {string} @desc Tooltip saying that some pods in a replica set have errors. */
MSG_REPLICA_SET_LIST_PODS_ERRORS_TOOLTIP: goog.getMsg('One or more pods have errors'),
/** @export {string} @desc Tooltip saying that some pods in a replica set are pending. */
MSG_REPLICA_SET_LIST_PODS_PENDING_TOOLTIP: goog.getMsg('One or more pods are in pending state'),
/** @export {string} @desc Label 'Replica Set' which appears at the top of the
delete dialog, opened from a replica set list page. */
MSG_REPLICA_SET_LIST_REPLICA_SET_LABEL: goog.getMsg('Replica Set'),
};
......@@ -17,19 +17,19 @@ limitations under the License.
<kd-resource-card-list selectable="false" with-statuses="true">
<kd-resource-card-header-columns>
<kd-resource-card-header-column grow="2">
Name
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_NAME_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="2">
Labels
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_LABELS_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow" size="small">
Pods
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_PODS_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column grow="nogrow" size="small">
Age
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_AGE_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column>
Images
{{::$ctrl.i18n.MSG_REPLICA_SET_LIST_IMAGES_LABEL}}
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small" grow="nogrow">
</kd-resource-card-header-column>
......
......@@ -12,6 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @final
*/
class ReplicaSetCardListController {
constructor() {
/** @export */
this.i18n = i18n;
}
}
/**
* @return {!angular.Component}
*/
......@@ -21,4 +31,23 @@ export const replicaSetCardListComponent = {
'replicaSets': '<',
},
templateUrl: 'replicasetlist/replicasetcardlist.html',
controller: ReplicaSetCardListController,
};
const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of
replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_NAME_LABEL: goog.getMsg('Name'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of
replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_LABELS_LABEL: goog.getMsg('Labels'),
/** @export {string} @desc Label 'Pods' which appears as a column label in the table of
replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_PODS_LABEL: goog.getMsg('Pods'),
/** @export {string} @desc Label 'Age' which appears as a column label in the
table of replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_AGE_LABEL: goog.getMsg('Age'),
/** @export {string} @desc Label 'Images' which appears as a column label in the
table of replica sets (replica set list view). */
MSG_REPLICA_SET_LIST_IMAGES_LABEL: goog.getMsg('Images'),
};
......@@ -16,5 +16,5 @@ limitations under the License.
<md-button class="md-icon-button" ng-click="ctrl.redirectToDeployPage()">
<md-icon class="kd-actionbar-icon-button">add</md-icon>
<md-tooltip md-direction="left">Deploy a containerized app</md-tooltip>
<md-tooltip md-direction="left">{{::ctrl.i18n.MSG_REPLICA_SET_LIST_DEPLOY_TOOLTIP}}</md-tooltip>
</md-button>
......@@ -25,6 +25,9 @@ export default class ReplicaSetListActionBarController {
constructor($state) {
/** @private {!ui.router.$state} */
this.state_ = $state;
/** @export */
this.i18n = i18n;
}
/**
......@@ -32,3 +35,8 @@ export default class ReplicaSetListActionBarController {
*/
redirectToDeployPage() { this.state_.go(deploy); }
}
const i18n = {
/** @export {string} @desc Tooltip for the '+' (deploy) button on the replica set list page. */
MSG_REPLICA_SET_LIST_DEPLOY_TOOLTIP: goog.getMsg('Deploy a containerized app'),
};
......@@ -25,7 +25,17 @@ describe('Replica Set Info controller', () => {
angular.mock.module(replicaSetDetailModule.name);
angular.mock.inject(($componentController, $rootScope) => {
ctrl = $componentController('kdReplicaSetInfo', {$scope: $rootScope});
ctrl = $componentController('kdReplicaSetInfo', {$scope: $rootScope}, {
replicaSet: {
podInfo: {
running: 0,
desired: 0,
failed: 0,
current: 0,
pending: 0,
},
},
});
});
});
......
......@@ -118,4 +118,8 @@ describe('Replica Set card', () => {
expect(ctrl.isPending()).toBe(false);
expect(ctrl.isSuccess()).toBe(true);
});
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.
先完成此消息的编辑!
想要评论请 注册