Skip to content

Commit

Permalink
Add last used column for API tokens (#12114)
Browse files Browse the repository at this point in the history
* Add last used column for API tokens

* Address PR feedback
  • Loading branch information
nwmac authored Jan 21, 2025
1 parent 78c867e commit 8c0ced4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5764,6 +5764,7 @@ tableHeaders:
lastSchedule: Last Schedule
lastSeen: Last Seen
lastSeenTooltip: The time at which the most recent occurrence of this event was recorded
lastUsed: Last Used
loggingOutputProviders: Provider
machines: Machines
machineNodeName: Node
Expand Down
6 changes: 5 additions & 1 deletion shell/components/formatter/LiveExpiryDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export default {
type: Object,
default: () => {}
},
missingKey: {
type: String,
default: 'generic.never',
}
},
data() {
Expand Down Expand Up @@ -77,7 +81,7 @@ export default {
/>
<span
v-else
v-t="'generic.never'"
v-t="missingKey"
class="text-muted"
/>
</template>
3 changes: 2 additions & 1 deletion shell/config/product/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
USER_ID, USERNAME, USER_DISPLAY_NAME, USER_PROVIDER, USER_LAST_LOGIN, USER_DISABLED_IN, USER_DELETED_IN, WORKLOAD_ENDPOINTS, STORAGE_CLASS_DEFAULT,
STORAGE_CLASS_PROVISIONER, PERSISTENT_VOLUME_SOURCE,
HPA_REFERENCE, MIN_REPLICA, MAX_REPLICA, CURRENT_REPLICA,
ACCESS_KEY, DESCRIPTION, EXPIRES, EXPIRY_STATE, SUB_TYPE, AGE_NORMAN, SCOPE_NORMAN, PERSISTENT_VOLUME_CLAIM, RECLAIM_POLICY, PV_REASON, WORKLOAD_HEALTH_SCALE, POD_RESTARTS,
ACCESS_KEY, DESCRIPTION, EXPIRES, EXPIRY_STATE, LAST_USED, SUB_TYPE, AGE_NORMAN, SCOPE_NORMAN, PERSISTENT_VOLUME_CLAIM, RECLAIM_POLICY, PV_REASON, WORKLOAD_HEALTH_SCALE, POD_RESTARTS,
DURATION, MESSAGE, REASON, LAST_SEEN_TIME, EVENT_TYPE, OBJECT, ROLE, ROLES, VERSION, INTERNAL_EXTERNAL_IP, KUBE_NODE_OS, CPU, RAM, SECRET_DATA
} from '@shell/config/table-headers';

Expand Down Expand Up @@ -542,6 +542,7 @@ export function init(store) {
ACCESS_KEY,
DESCRIPTION,
SCOPE_NORMAN,
LAST_USED,
EXPIRES,
AGE_NORMAN
]);
Expand Down
11 changes: 11 additions & 0 deletions shell/config/table-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,17 @@ export const EXPIRES = {
formatter: 'LiveExpiryDate'
};

export const LAST_USED = {
name: 'lastUsed',
value: 'lastUsedAt',
labelKey: 'tableHeaders.lastUsed',
align: 'left',
sort: ['lastUsedAt'],
width: 200,
formatter: 'LiveExpiryDate',
formatterOpts: { missingKey: 'generic.unknown' },
};

export const RESTART = {
name: 'restart',
labelKey: 'tableHeaders.restart',
Expand Down

0 comments on commit 8c0ced4

Please sign in to comment.