提交 a596f5f8 编写于 作者: R riverzhang 提交者: Marcin Maciaszczyk

Add secretType (#2256)

* Add secretType

* Add secretType in secret list

* * Add secret type to details
* Fix some column names

* * Add translations

* remove secret sort not work

* add namesapce

* delete sort-id

* add type to backendapi

* fix secret table
上级 32b926c4
......@@ -797,11 +797,13 @@
<translation id="4846548664493416435" key="MSG_SECRET_DETAIL_DETAIL_2" desc="Tooltip label for hiding secret content">Hide secret content</translation>
<translation id="3077755770695564562" key="MSG_SECRET_DETAIL_DETAIL_3" desc="Secrets info details section bytes.">{{::$ctrl.formatDataValue(value).length}} bytes </translation>
<translation id="7738406856610373390" key="MSG_SECRET_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
<translation id="138292779983873593" key="MSG_SECRET_DETAIL_INFO_1" desc="Secret info details section type entry.">Type</translation>
<translation id="482275567627182819" key="MSG_SECRET_LIST_CARDLIST_0" desc="Label which appears above the list of such objects.">Secrets</translation>
<translation id="2133941155168166972" key="MSG_SECRET_LIST_CARDLIST_1" desc="Label \'Name\' which appears as a column label in the table of secrets (secret list view).">Name</translation>
<translation id="7478420130341878455" key="MSG_SECRET_LIST_CARDLIST_2" desc="Label \'Namespace\' which appears as a column label in the table of secrets (secret list view).">Namespace</translation>
<translation id="4493598488188566434" key="MSG_SECRET_LIST_CARDLIST_3" desc="Label \'Age\' which appears as a column label in the table of secrets (secret list view).">Age</translation>
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">There are no Secrets to display.</translation>
<translation id="2424849052809753229" key="MSG_SECRET_LIST_CARDLIST_5" desc="Label \'Type\' which appears as a column label in the table of secrets (secret list view).">Type</translation>
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">Created at <ph name="START_DATE"> UTC</ph></translation>
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
<translation id="2095406541360162780" key="MSG_SERVICE_DETAIL_DETAIL_1" desc="Text for pods card zerostate in stateful set details page.">There are currently no Pods selected by this Service.</translation>
......
......@@ -829,11 +829,13 @@
<translation id="4846548664493416435" key="MSG_SECRET_DETAIL_DETAIL_2" desc="Tooltip label for hiding secret content">シークレットコンテントを隠す</translation>
<translation id="3077755770695564562" key="MSG_SECRET_DETAIL_DETAIL_3" desc="Secrets info details section bytes.">{{::$ctrl.formatDataValue(value).length}} バイト </translation>
<translation id="7738406856610373390" key="MSG_SECRET_DETAIL_INFO_0" desc="Header in a detail view">詳細</translation>
<translation id="138292779983873593" key="MSG_SECRET_DETAIL_INFO_1" desc="Secret info details section type entry.">タイプ</translation>
<translation id="482275567627182819" key="MSG_SECRET_LIST_CARDLIST_0" desc="Label which appears above the list of such objects.">シークレット</translation>
<translation id="2133941155168166972" key="MSG_SECRET_LIST_CARDLIST_1" desc="Label \'Name\' which appears as a column label in the table of secrets (secret list view).">名前</translation>
<translation id="7478420130341878455" key="MSG_SECRET_LIST_CARDLIST_2" desc="Label \'Namespace\' which appears as a column label in the table of secrets (secret list view).">ネームスペース</translation>
<translation id="4493598488188566434" key="MSG_SECRET_LIST_CARDLIST_3" desc="Label \'Age\' which appears as a column label in the table of secrets (secret list view).">起動時間</translation>
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">表示するものがありません</translation>
<translation id="2424849052809753229" key="MSG_SECRET_LIST_CARDLIST_5" desc="Label \'Type\' which appears as a column label in the table of secrets (secret list view).">タイプ</translation>
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">
<ph name="START_DATE"> UTC に作成</ph>
</translation>
......
......@@ -797,11 +797,13 @@
<translation id="4846548664493416435" key="MSG_SECRET_DETAIL_DETAIL_2" desc="Tooltip label for hiding secret content">隐藏保密字典内容</translation>
<translation id="3077755770695564562" key="MSG_SECRET_DETAIL_DETAIL_3" desc="Secrets info details section bytes.">{{::$ctrl.formatDataValue(value).length}} 字节</translation>
<translation id="7738406856610373390" key="MSG_SECRET_DETAIL_INFO_0" desc="Header in a detail view">详情</translation>
<translation id="138292779983873593" key="MSG_SECRET_DETAIL_INFO_1" desc="Secret info details section type entry.">类型</translation>
<translation id="482275567627182819" key="MSG_SECRET_LIST_CARDLIST_0" desc="Label which appears above the list of such objects.">保密字典</translation>
<translation id="2133941155168166972" key="MSG_SECRET_LIST_CARDLIST_1" desc="Label \'Name\' which appears as a column label in the table of secrets (secret list view).">名称</translation>
<translation id="7478420130341878455" key="MSG_SECRET_LIST_CARDLIST_2" desc="Label \'Namespace\' which appears as a column label in the table of secrets (secret list view).">命名空间</translation>
<translation id="4493598488188566434" key="MSG_SECRET_LIST_CARDLIST_3" desc="Label \'Age\' which appears as a column label in the table of secrets (secret list view).">已创建</translation>
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">没有保密字典可显示</translation>
<translation id="2424849052809753229" key="MSG_SECRET_LIST_CARDLIST_5" desc="Label \'Type\' which appears as a column label in the table of secrets (secret list view).">类型</translation>
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">创建于 <ph name="START_DATE"> UTC</ph></translation>
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">服务</translation>
<translation id="2095406541360162780" key="MSG_SERVICE_DETAIL_DETAIL_1" desc="Text for pods card zerostate in stateful set details page.">此服务目前没有选中容器组</translation>
......
......@@ -65,8 +65,9 @@ func (spec *ImagePullSecretSpec) GetData() map[string][]byte {
// Secret is a single secret returned to the frontend.
type Secret struct {
api.ObjectMeta `json:"objectMeta"`
api.TypeMeta `json:"typeMeta"`
ObjectMeta api.ObjectMeta `json:"objectMeta"`
TypeMeta api.TypeMeta `json:"typeMeta"`
Type v1.SecretType `json:"type"`
}
// SecretsList is a response structure for a queried secrets list.
......@@ -125,8 +126,9 @@ func CreateSecret(client kubernetes.Interface, spec SecretSpec) (*Secret, error)
func toSecret(secret *v1.Secret) *Secret {
return &Secret{
api.NewObjectMeta(secret.ObjectMeta),
api.NewTypeMeta(api.ResourceKindSecret),
ObjectMeta: api.NewObjectMeta(secret.ObjectMeta),
TypeMeta: api.NewTypeMeta(api.ResourceKindSecret),
Type: secret.Type,
}
}
......
......@@ -1156,6 +1156,7 @@ backendApi.NamespaceDetail;
* @typedef {{
* objectMeta: !backendApi.ObjectMeta,
* typeMeta: !backendApi.TypeMeta,
* type: string,
* data: !Object<string, string>,
* }}
*/
......@@ -1164,7 +1165,8 @@ backendApi.SecretDetail;
/**
* @typedef {{
* objectMeta: !backendApi.ObjectMeta,
* typeMeta: !backendApi.TypeMeta
* typeMeta: !backendApi.TypeMeta,
* type: string
* }}
*/
backendApi.Secret;
......
......@@ -19,5 +19,10 @@ limitations under the License.
<kd-info-card-section>
<kd-object-meta-info-card object-meta="::$ctrl.secret.objectMeta">
</kd-object-meta-info-card>
<kd-info-card-entry title="[[Type|Secret info details section type entry.]]">
<kd-middle-ellipsis display-string="{{::$ctrl.secret.type}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.secret.type">-</div>
</kd-info-card-entry>
</kd-info-card-section>
</kd-info-card>
......@@ -32,6 +32,11 @@ limitations under the License.
</kd-middle-ellipsis>
</div>
</kd-resource-card-column>
<kd-resource-card-column>
<kd-middle-ellipsis display-string="{{$ctrl.secret.type}}">
</kd-middle-ellipsis>
<div ng-hide="::$ctrl.secret.type">-</div>
</kd-resource-card-column>
<kd-resource-card-column>
<div ng-if="::$ctrl.secret.objectMeta.creationTimestamp">
{{::$ctrl.secret.objectMeta.creationTimestamp | relativeTime}}
......
......@@ -32,7 +32,7 @@ limitations under the License.
</kd-zero-state>
<kd-resource-card-header-columns ng-show="$ctrl.secretList.listMeta.totalItems">
<kd-resource-card-header-column size="small"
grow="4"
grow="2"
sortable="true"
sort-id="$root.SortableProperties.NAME">
[[Name|Label 'Name' which appears as a column label in the table of secrets (secret list view).]]
......@@ -43,7 +43,11 @@ limitations under the License.
[[Namespace|Label 'Namespace' which appears as a column label in the table of secrets (secret list view).]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small"
grow="1"
grow="2">
[[Type|Label 'Type' which appears as a column label in the table of secrets (secret list view).]]
</kd-resource-card-header-column>
<kd-resource-card-header-column size="small"
grow="2"
sortable="true"
sort-id="$root.SortableProperties.AGE">
[[Age|Label 'Age' which appears as a column label in the table of secrets (secret list view).]]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册