From c9b78bab8919ad182252f4b4c93fc98d4b752f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Thu, 7 Mar 2024 19:12:06 +0100 Subject: [PATCH] 0.2.0 --- front/libs/certmanager/custom.ts | 16 +++---- front/libs/core/index.ts | 9 ++++ front/libs/fluxcd/custom.ts | 29 ++++++------ front/libs/jaegertracing/custom.ts | 5 +-- front/libs/k8s/custom.ts | 45 +++++++++++-------- front/libs/k8up/custom.ts | 12 ++--- front/libs/mariadb/custom.ts | 26 ++++------- front/libs/monitoring/custom.ts | 14 +++--- front/libs/namecheap/custom.ts | 5 +-- front/libs/opentelemetry/custom.ts | 15 +++---- front/libs/oracle/custom.ts | 8 ++-- front/libs/rabbitmq/custom.ts | 5 +-- front/libs/redis/custom.ts | 4 +- front/libs/traefik/custom.ts | 2 +- front/libs/vynil/custom.ts | 8 ++-- front/libs/zalando/custom.ts | 5 +-- front/pages/install/vynil/InstallView.vue | 7 +++ .../pages/install/vynil/installDashboard.vue | 7 ++- package.json | 2 +- utils/gen.ts | 2 + utils/generator/back/obj.resolvers.ts.hbs | 6 +++ utils/generator/config.ts | 4 ++ .../front/obj.components.list.vue.hbs | 6 ++- utils/generator/front/obj.pages.view.vue.hbs | 7 +++ utils/generator/partials/back/problems.ts.hbs | 16 +++++++ .../partials/front/status.fields.vue.hbs | 22 ++++----- .../partials/resolvers/certmanager.ts.hbs | 2 +- .../partials/resolvers/endpoint.ts.hbs | 22 +++++++++ .../partials/resolvers/stateful.ts.hbs | 18 ++++++++ 29 files changed, 206 insertions(+), 123 deletions(-) create mode 100644 utils/generator/partials/resolvers/endpoint.ts.hbs create mode 100644 utils/generator/partials/resolvers/stateful.ts.hbs diff --git a/front/libs/certmanager/custom.ts b/front/libs/certmanager/custom.ts index 30811641..5c1bb657 100644 --- a/front/libs/certmanager/custom.ts +++ b/front/libs/certmanager/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { networkColor, networkIcon } from '../../routes/custom'; export const certmanagerIcon = networkIcon; export const certmanagerTitle = 'cert-manager'; @@ -29,32 +29,30 @@ export const colorIssuer = networkColor; export const descriptionIssuer = ''; export const shortIssuer = 'Issuer'; export const extraChallengeColumns:Array = [ - {name: 'State', label: 'State', field: row => row.status.state, sortable: true, align: tableColumnAlign.left}, {name: 'Domain', label: 'Domain', field: row => row.spec.dnsName, sortable: true, align: tableColumnAlign.left}, {name: 'Reason', label: 'Reason', field: row => row.status.reason, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraOrderColumns:Array = [ - {name: 'State', label: 'State', field: row => row.status.state, sortable: true, align: tableColumnAlign.left}, {name: 'Issuer', label: 'Issuer', field: row => row.spec.issuerRef.name, sortable: true, align: tableColumnAlign.left}, {name: 'Reason', label: 'Reason', field: row => row.status.reason, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraCertificateColumns:Array = [ {name: 'Secret', label: 'Secret', field: row => row.spec.secretName, sortable: true, align: tableColumnAlign.left}, {name: 'Issuer', label: 'Issuer', field: row => row.spec.issuerRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraCertificateRequestColumns:Array = [ {name: 'Issuer', label: 'Issuer', field: row => row.spec.issuerRef.name, sortable: true, align: tableColumnAlign.left}, {name: 'Requestor', label: 'Requestor', field: row => row.spec.username, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraClusterIssuerColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraIssuerColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; // Certificate') (eq short 'CertificateRequest')) (or (eq short 'ClusterIssuer') (eq short 'Issuer' export const ChallengeListExcludes = [ diff --git a/front/libs/core/index.ts b/front/libs/core/index.ts index d39b7b97..3a6a7190 100644 --- a/front/libs/core/index.ts +++ b/front/libs/core/index.ts @@ -114,3 +114,12 @@ export function addByPath(target,path,data) { export function getByPath(obj, path) { return path.split("/").reduce((res,cur) => res==null?null:res[cur.replaceAll('~1','/')],obj) } + +export function timeAgo(date:string) { + const delta = new Date().getTime() - new Date(date).getTime(); + const days = Math.floor(delta / (1000 * 60 * 60 * 24)); + const hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((delta % (1000 * 60)) / 1000); + return `${days>0?`${days} days `:''}${hours>0?`${hours} hours `:''}${minutes>0?`${minutes} minutes `:''}${seconds>0?`${seconds} seconds `:''}` +} diff --git a/front/libs/fluxcd/custom.ts b/front/libs/fluxcd/custom.ts index 918381a2..443a647d 100644 --- a/front/libs/fluxcd/custom.ts +++ b/front/libs/fluxcd/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { automationColor, automationIcon, } from '../../routes/custom'; export const fluxcdIcon = automationIcon; export const fluxcdTitle = 'Flux CD'; @@ -58,52 +58,54 @@ export const descriptionHelmRelease = ''; export const shortHelmRelease = 'HelmRelease'; export const extraKustomizationColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Children', label: 'Children', field: row => row.status.inventory.entries.length, sortable: true, align: tableColumnAlign.left}, + {name: 'LastChange', label: 'Last Change', field: row => timeAgo(row.status?.conditions[0].lastTransitionTime), sortable: true, align: tableColumnAlign.left}, ]; export const extraReceiverColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraAlertColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraProviderColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraGitRepositoryColumns:Array = [ {name: 'URL', label: 'URL', field: row => row.spec.url, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'LastChange', label: 'Last Change', field: row => row.status!=undefined&&Array.isArray(row.status.conditions)?timeAgo(row.status.conditions[0].lastTransitionTime):'--', sortable: true, align: tableColumnAlign.left}, ]; export const extraBucketColumns:Array = [ {name: 'Endpoint', label: 'Endpoint', field: row => row.spec.endpoint, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraHelmChartColumns:Array = [ {name: 'Chart', label: 'Chart', field: row => row.spec.chart, sortable: true, align: tableColumnAlign.left}, {name: 'Version', label: 'Version', field: row => row.spec.version, sortable: true, align: tableColumnAlign.left}, {name: 'Source Kind', label: 'Source Kind', field: row => row.spec.sourceRef.kind, sortable: true, align: tableColumnAlign.left}, {name: 'Source Name', label: 'Source Name', field: row => row.spec.sourceRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraHelmRepositoryColumns:Array = [ {name: 'URL', label: 'URL', field: row => row.spec.url, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraOCIRepositoryColumns:Array = [ {name: 'URL', label: 'URL', field: row => row.spec.url, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraImageUpdateAutomationColumns:Array = [ - {name: 'Last run', label: 'Last run', field: row => row.status?.lastAutomationRunTime, sortable: true, align: tableColumnAlign.left}, + {name: 'Last run', label: 'Last run', field: row => timeAgo(row.status?.lastAutomationRunTime), sortable: true, align: tableColumnAlign.left}, ]; export const extraImagePolicyColumns:Array = [ {name: 'LatestImage', label: 'LatestImage', field: row => row.status?.latestImage, sortable: true, align: tableColumnAlign.left}, + {name: 'LastChange', label: 'Last Change', field: row => timeAgo(row.status?.conditions[0].lastTransitionTime), sortable: true, align: tableColumnAlign.left}, ]; export const extraImageRepositoryColumns:Array = [ - {name: 'Last scan', label: 'Last scan', field: row => row.status.lastScanResult?.scanTime, sortable: true, align: tableColumnAlign.left}, + {name: 'LastScan', label: 'Last scan', field: row => timeAgo(row.status.lastScanResult?.scanTime), sortable: true, align: tableColumnAlign.left}, {name: 'Tags', label: 'Tags', field: row => row.status?.lastScanResult?.tagCount, sortable: true, align: tableColumnAlign.left}, ]; export const extraHelmReleaseColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const KustomizationListExcludes = [ ]; @@ -131,6 +133,7 @@ export const ProviderSimpleExcludes = [ ]; export const GitRepositoryListExcludes = [ { path: 'spec/url', include: true }, + { path: 'status', include: true }, ]; export const GitRepositoryReadExcludes = [ ]; diff --git a/front/libs/jaegertracing/custom.ts b/front/libs/jaegertracing/custom.ts index d9f88fff..1ae44b7c 100644 --- a/front/libs/jaegertracing/custom.ts +++ b/front/libs/jaegertracing/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { systemColor, systemIcon, } from '../../routes/custom'; export const jaegertracingIcon = systemIcon; export const jaegertracingTitle = 'Tracing'; @@ -13,14 +13,13 @@ export const extraJaegerColumns:Array = [ {name: 'Version', label: 'Version', field: row => row.status.version, sortable: true, align: tableColumnAlign.left}, {name: 'Strategy', label: 'Strategy', field: row => row.spec.strategy, sortable: true, align: tableColumnAlign.left}, {name: 'Storage', label: 'Storage', field: row => row.spec.storage.type, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const JaegerListExcludes = [ { path: 'status/phase', include: true }, { path: 'status/version', include: true }, { path: 'spec/strategy', include: true }, { path: 'spec/storage/type', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const JaegerReadExcludes = [ ]; diff --git a/front/libs/k8s/custom.ts b/front/libs/k8s/custom.ts index 0067a957..481981da 100644 --- a/front/libs/k8s/custom.ts +++ b/front/libs/k8s/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { configColor, configIcon,securityColor, securityIcon,networkColor, networkIcon,workloadColor, workloadIcon,systemColor, systemIcon,storageColor, storageIcon,workflowColor, workflowIcon, } from '../../routes/custom'; export const k8sIcon = 'fas fa-dharmachakra'; export const k8sTitle = 'Standard'; @@ -201,6 +201,8 @@ export const extraNamespaceColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraNodeColumns:Array = [ + {name: 'CPUs', label: 'CPUs', field: row => row.status.capacity.cpu, sortable: true, align: tableColumnAlign.left}, + {name: 'RAM', label: 'RAM', field: row => row.status.capacity.memory, sortable: true, align: tableColumnAlign.left}, // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraPersistentVolumeColumns:Array = [ @@ -237,21 +239,22 @@ export const extraControllerRevisionColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraDaemonSetColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Replicas', label: 'Replicas', field: row => row.status.numberReady, sortable: true, align: tableColumnAlign.left}, ]; export const extraDeploymentColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Replicas', label: 'Replicas', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, ]; export const extraReplicaSetColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraStatefulSetColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Replicas', label: 'Replicas', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, ]; export const extraHorizontalPodAutoscalerColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraJobColumns:Array = [ + {name: 'Completion', label: 'Completion', field: row => timeAgo(row.status.completionTime), sortable: true, align: tableColumnAlign.left}, // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraCronJobColumns:Array = [ @@ -264,7 +267,7 @@ export const extraIngressColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraNetworkPolicyColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Types', label: 'Types', field: row => row.spec.policyTypes.join(', '), sortable: true, align: tableColumnAlign.left}, ]; export const extraPodDisruptionBudgetColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, @@ -273,10 +276,14 @@ export const extraRoleColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraClusterRoleBindingColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Role', label: 'Role', field: row => row.roleRef.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Groups', label: 'Groups', field: row => Array.isArray(row.subjects)?row.subjects.filter(s=>s.kind == 'Group').map(s=>s.name).join(', '):'', sortable: true, align: tableColumnAlign.left}, + {name: 'ServiceAccount', label: 'ServiceAccount', field: row => Array.isArray(row.subjects)?row.subjects.filter(s=>s.kind == 'ServiceAccount').map(s=>s.namespace+' '+s.name).join(', '):'', sortable: true, align: tableColumnAlign.left}, ]; export const extraRoleBindingColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Role', label: 'Role', field: row => row.roleRef.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Groups', label: 'Groups', field: row => Array.isArray(row.subjects)?row.subjects.filter(s=>s.kind == 'Group').map(s=>s.name).join(', '):'', sortable: true, align: tableColumnAlign.left}, + {name: 'ServiceAccount', label: 'ServiceAccount', field: row => Array.isArray(row.subjects)?row.subjects.filter(s=>s.kind == 'ServiceAccount').map(s=>s.namespace+' '+s.name).join(', '):'', sortable: true, align: tableColumnAlign.left}, ]; export const extraClusterRoleColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, @@ -303,13 +310,16 @@ export const extraValidatingWebhookConfigurationColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraCustomResourceDefinitionColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Scope', label: 'Scope', field: row => row.spec.scope, sortable: true, align: tableColumnAlign.left}, + {name: 'Group', label: 'Group', field: row => row.spec.group, sortable: true, align: tableColumnAlign.left}, + {name: 'Kind', label: 'Kind', field: row => row.spec.names.kind, sortable: true, align: tableColumnAlign.left}, ]; export const extraPriorityClassColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraLeaseColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Holder', label: 'Holder', field: row => row.spec.holderIdentity, sortable: true, align: tableColumnAlign.left}, + {name: 'Duration', label: 'Duration(s)', field: row => row.spec.leaseDurationSeconds, sortable: true, align: tableColumnAlign.left}, ]; export const extraRuntimeClassColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, @@ -325,12 +335,12 @@ export const extraVolumeSnapshotColumns:Array = [ {name: 'SnapshotClass', label: 'SnapshotClass', field: row => row.spec.volumeSnapshotClassName, sortable: true, align: tableColumnAlign.left}, {name: 'SnapshotContent', label: 'SnapshotContent', field: row => row.status.boundVolumeSnapshotContentName, sortable: true, align: tableColumnAlign.left}, {name: 'CreationTime', label: 'CreationTime', field: row => row.status.creationTime, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraVolumeSnapshotClassColumns:Array = [ {name: 'Driver', label: 'Driver', field: row => row.driver, sortable: true, align: tableColumnAlign.left}, {name: 'DeletionPolicy', label: 'DeletionPolicy', field: row => row.deletionPolicy, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraVolumeSnapshotContentColumns:Array = [ {name: 'ReadyToUse', label: 'ReadyToUse', field: row => row.status.readyToUse, sortable: true, align: tableColumnAlign.left}, @@ -340,7 +350,7 @@ export const extraVolumeSnapshotContentColumns:Array = [ {name: 'VolumeSnapshotClass', label: 'VolumeSnapshotClass', field: row => row.spec.volumeSnapshotClassName, sortable: true, align: tableColumnAlign.left}, {name: 'VolumeSnapshot', label: 'VolumeSnapshot', field: row => row.spec.volumeSnapshotRef.name, sortable: true, align: tableColumnAlign.left}, {name: 'VolumeSnapshotNamespace', label: 'VolumeSnapshotNamespace', field: row => row.spec.volumeSnapshotRef.namespace, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const ConfigMapListExcludes = [ ]; @@ -601,14 +611,13 @@ export const EndpointSliceReadExcludes = [ export const EndpointSliceSimpleExcludes = [ ]; export const VolumeSnapshotListExcludes = [ - { path: 'status/readyToUse', include: true }, { path: 'spec/source/persistentVolumeClaimName', include: true }, { path: 'spec/source/volumeSnapshotContentName', include: true }, - { path: 'status/restoreSize', include: true }, { path: 'spec/volumeSnapshotClassName', include: true }, + { path: 'status/readyToUse', include: true }, + { path: 'status/restoreSize', include: true }, { path: 'status/boundVolumeSnapshotContentName', include: true }, { path: 'status/creationTime', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const VolumeSnapshotReadExcludes = [ ]; @@ -617,21 +626,19 @@ export const VolumeSnapshotSimpleExcludes = [ export const VolumeSnapshotClassListExcludes = [ { path: 'driver', include: true }, { path: 'deletionPolicy', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const VolumeSnapshotClassReadExcludes = [ ]; export const VolumeSnapshotClassSimpleExcludes = [ ]; export const VolumeSnapshotContentListExcludes = [ - { path: 'status/readyToUse', include: true }, - { path: 'status/restoreSize', include: true }, { path: 'spec/deletionPolicy', include: true }, { path: 'spec/driver', include: true }, { path: 'spec/volumeSnapshotClassName', include: true }, { path: 'spec/volumeSnapshotRef/name', include: true }, { path: 'spec/volumeSnapshotRef/namespace', include: true }, - { path: 'metadata/creationTimestamp', include: true }, + { path: 'status/readyToUse', include: true }, + { path: 'status/restoreSize', include: true }, ]; export const VolumeSnapshotContentReadExcludes = [ ]; diff --git a/front/libs/k8up/custom.ts b/front/libs/k8up/custom.ts index 584c2ee3..1cf1fd04 100644 --- a/front/libs/k8up/custom.ts +++ b/front/libs/k8up/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { systemColor, systemIcon, } from '../../routes/custom'; export const iconBackup = 'backup'; export const iconRestore = 'cloud_download'; @@ -37,22 +37,22 @@ export const colorSnapshot = systemColor; export const descriptionSnapshot = ''; export const shortSnapshot = 'Snapshot'; export const extraArchiveColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraBackupColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraCheckColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraPreBackupPodColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraPruneColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraRestoreColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraScheduleColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, diff --git a/front/libs/mariadb/custom.ts b/front/libs/mariadb/custom.ts index b28fa867..a729e467 100644 --- a/front/libs/mariadb/custom.ts +++ b/front/libs/mariadb/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { databaseColor, databaseIcon, } from '../../routes/custom'; export const iconBackup = 'backup'; export const iconConnection = 'link'; @@ -39,18 +39,18 @@ export const shortUser = 'User'; export const extraBackupColumns:Array = [ {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraConnectionColumns:Array = [ {name: 'Secret', label: 'Secret', field: row => row.spec.secretName, sortable: true, align: tableColumnAlign.left}, {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraDatabaseColumns:Array = [ {name: 'CharSet', label: 'CharSet', field: row => row.spec.characterSet, sortable: true, align: tableColumnAlign.left}, {name: 'Collate', label: 'Collate', field: row => row.spec.collate, sortable: true, align: tableColumnAlign.left}, {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Name', label: 'Name', field: row => row.spec.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraGrantColumns:Array = [ @@ -59,28 +59,27 @@ export const extraGrantColumns:Array = [ {name: 'Username', label: 'Username', field: row => row.spec.username, sortable: true, align: tableColumnAlign.left}, {name: 'GrantOpt', label: 'GrantOpt', field: row => row.spec.grantOption, sortable: true, align: tableColumnAlign.left}, {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraMariaDBColumns:Array = [ {name: 'Primary Pod', label: 'Primary Pod', field: row => row.status.currentPrimary, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraRestoreColumns:Array = [ {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraSqlJobColumns:Array = [ {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraUserColumns:Array = [ {name: 'MaxConns', label: 'MaxConns', field: row => row.spec.maxUserConnections, sortable: true, align: tableColumnAlign.left}, {name: 'MariaDB', label: 'MariaDB', field: row => row.spec.mariaDbRef.name, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const BackupListExcludes = [ { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const BackupReadExcludes = [ ]; @@ -89,7 +88,6 @@ export const BackupSimpleExcludes = [ export const ConnectionListExcludes = [ { path: 'spec/secretName', include: true }, { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const ConnectionReadExcludes = [ ]; @@ -99,7 +97,6 @@ export const DatabaseListExcludes = [ { path: 'spec/characterSet', include: true }, { path: 'spec/collate', include: true }, { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'spec/name', include: true }, ]; export const DatabaseReadExcludes = [ @@ -112,7 +109,6 @@ export const GrantListExcludes = [ { path: 'spec/username', include: true }, { path: 'spec/grantOption', include: true }, { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const GrantReadExcludes = [ ]; @@ -120,7 +116,6 @@ export const GrantSimpleExcludes = [ ]; export const MariaDBListExcludes = [ { path: 'status/currentPrimary', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const MariaDBReadExcludes = [ ]; @@ -128,7 +123,6 @@ export const MariaDBSimpleExcludes = [ ]; export const RestoreListExcludes = [ { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const RestoreReadExcludes = [ ]; @@ -136,7 +130,6 @@ export const RestoreSimpleExcludes = [ ]; export const SqlJobListExcludes = [ { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const SqlJobReadExcludes = [ ]; @@ -145,7 +138,6 @@ export const SqlJobSimpleExcludes = [ export const UserListExcludes = [ { path: 'spec/maxUserConnections', include: true }, { path: 'spec/mariaDbRef/name', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const UserReadExcludes = [ ]; diff --git a/front/libs/monitoring/custom.ts b/front/libs/monitoring/custom.ts index 85d4f29a..d046f5f8 100644 --- a/front/libs/monitoring/custom.ts +++ b/front/libs/monitoring/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' export const iconAlertmanager = 'apps'; export const iconPrometheus = 'apps'; import { systemColor, configIcon, } from '../../routes/custom'; @@ -44,7 +44,7 @@ export const extraAlertmanagerColumns:Array = [ {name: 'Version', label: 'Version', field: row => row.spec.version, sortable: true, align: tableColumnAlign.left}, {name: 'Replicas', label: 'Replicas', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, {name: 'Ready', label: 'Ready', field: row => row.status.availableReplicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Paused', label: 'Paused', field: row => row.status.paused, sortable: true, align: tableColumnAlign.left}, ]; export const extraPodMonitorColumns:Array = [ @@ -57,7 +57,7 @@ export const extraPrometheusColumns:Array = [ {name: 'Version', label: 'Version', field: row => row.spec.version, sortable: true, align: tableColumnAlign.left}, {name: 'Desired', label: 'Desired', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, {name: 'Ready', label: 'Ready', field: row => row.status.availableReplicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Paused', label: 'Paused', field: row => row.status.paused, sortable: true, align: tableColumnAlign.left}, ]; export const extraPrometheusRuleColumns:Array = [ @@ -70,7 +70,7 @@ export const extraThanosRulerColumns:Array = [ {name: 'Version', label: 'Version', field: row => row.spec.version, sortable: true, align: tableColumnAlign.left}, {name: 'Replicas', label: 'Replicas', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, {name: 'Ready', label: 'Ready', field: row => row.status.availableReplicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Paused', label: 'Paused', field: row => row.status.paused, sortable: true, align: tableColumnAlign.left}, ]; export const extraAlertmanagerConfigColumns:Array = [ @@ -80,14 +80,13 @@ export const extraPrometheusAgentColumns:Array = [ {name: 'Version', label: 'Version', field: row => row.spec.version, sortable: true, align: tableColumnAlign.left}, {name: 'Desired', label: 'Desired', field: row => row.spec.replicas, sortable: true, align: tableColumnAlign.left}, {name: 'Ready', label: 'Ready', field: row => row.status.availableReplicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Paused', label: 'Paused', field: row => row.status.paused, sortable: true, align: tableColumnAlign.left}, ]; export const AlertmanagerListExcludes = [ { path: 'spec/version', include: true }, { path: 'spec/replicas', include: true }, { path: 'status/availableReplicas', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/paused', include: true }, ]; export const AlertmanagerReadExcludes = [ @@ -110,7 +109,6 @@ export const PrometheusListExcludes = [ { path: 'spec/version', include: true }, { path: 'spec/replicas', include: true }, { path: 'status/availableReplicas', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/paused', include: true }, ]; export const PrometheusReadExcludes = [ @@ -133,7 +131,6 @@ export const ThanosRulerListExcludes = [ { path: 'spec/version', include: true }, { path: 'spec/replicas', include: true }, { path: 'status/availableReplicas', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/paused', include: true }, ]; export const ThanosRulerReadExcludes = [ @@ -150,7 +147,6 @@ export const PrometheusAgentListExcludes = [ { path: 'spec/version', include: true }, { path: 'spec/replicas', include: true }, { path: 'status/availableReplicas', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/paused', include: true }, ]; export const PrometheusAgentReadExcludes = [ diff --git a/front/libs/namecheap/custom.ts b/front/libs/namecheap/custom.ts index 38fbde1e..76ac21e6 100644 --- a/front/libs/namecheap/custom.ts +++ b/front/libs/namecheap/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { systemColor, systemIcon, } from '../../routes/custom'; export const namecheapIcon = 'apps'; export const namecheapTitle = 'mayFly'; @@ -10,12 +10,11 @@ export const descriptionScheduledResource = ''; export const shortScheduledResource = 'ScheduledResource'; export const extraScheduledResourceColumns:Array = [ {name: 'In', label: 'In', field: row => row.spec.in, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Condition', label: 'Condition', field: row => row.status.condition, sortable: true, align: tableColumnAlign.left}, ]; export const ScheduledResourceListExcludes = [ { path: 'spec/in', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/condition', include: true }, ]; export const ScheduledResourceReadExcludes = [ diff --git a/front/libs/opentelemetry/custom.ts b/front/libs/opentelemetry/custom.ts index 8cb34992..090793c5 100644 --- a/front/libs/opentelemetry/custom.ts +++ b/front/libs/opentelemetry/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { systemColor, systemIcon, installIcon, configIcon} from '../../routes/custom'; export const opentelemetryIcon = 'apps'; export const opentelemetryTitle = 'Telemetry'; @@ -17,13 +17,13 @@ export const colorOpenTelemetryCollector = systemColor; export const descriptionOpenTelemetryCollector = ''; export const shortOpenTelemetryCollector = 'OpenTelemetryCollector'; export const extraInstrumentationColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Endpoint', label: 'Endpoint', field: row => row.spec.exporter.endpoint, sortable: true, align: tableColumnAlign.left}, {name: 'Sampler', label: 'Sampler', field: row => row.spec.sampler.type, sortable: true, align: tableColumnAlign.left}, {name: 'Sampler Arg', label: 'Sampler Arg', field: row => row.spec.sampler.argument, sortable: true, align: tableColumnAlign.left}, ]; export const extraOpAMPBridgeColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Version', label: 'Version', field: row => row.status.version, sortable: true, align: tableColumnAlign.left}, {name: 'Endpoint', label: 'Endpoint', field: row => row.spec.endpoint, sortable: true, align: tableColumnAlign.left}, ]; @@ -31,12 +31,11 @@ export const extraOpenTelemetryCollectorColumns:Array = [ {name: 'Mode', label: 'Mode', field: row => row.spec.mode, sortable: true, align: tableColumnAlign.left}, {name: 'Version', label: 'Version', field: row => row.status.version, sortable: true, align: tableColumnAlign.left}, {name: 'Ready', label: 'Ready', field: row => row.status.scale.statusReplicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Image', label: 'Image', field: row => row.status.image, sortable: true, align: tableColumnAlign.left}, {name: 'Management', label: 'Management', field: row => row.spec.managementState, sortable: true, align: tableColumnAlign.left}, ]; export const InstrumentationListExcludes = [ - { path: 'metadata/creationTimestamp', include: true }, { path: 'spec/exporter/endpoint', include: true }, { path: 'spec/sampler/type', include: true }, { path: 'spec/sampler/argument', include: true }, @@ -46,9 +45,8 @@ export const InstrumentationReadExcludes = [ export const InstrumentationSimpleExcludes = [ ]; export const OpAMPBridgeListExcludes = [ - { path: 'metadata/creationTimestamp', include: true }, - { path: 'status/version', include: true }, { path: 'spec/endpoint', include: true }, + { path: 'status/version', include: true }, ]; export const OpAMPBridgeReadExcludes = [ ]; @@ -56,11 +54,10 @@ export const OpAMPBridgeSimpleExcludes = [ ]; export const OpenTelemetryCollectorListExcludes = [ { path: 'spec/mode', include: true }, + { path: 'spec/managementState', include: true }, { path: 'status/version', include: true }, { path: 'status/scale/statusReplicas', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/image', include: true }, - { path: 'spec/managementState', include: true }, ]; export const OpenTelemetryCollectorReadExcludes = [ ]; diff --git a/front/libs/oracle/custom.ts b/front/libs/oracle/custom.ts index c6a94e49..cc395c58 100644 --- a/front/libs/oracle/custom.ts +++ b/front/libs/oracle/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { databaseColor, databaseIcon, } from '../../routes/custom'; export const oracleIcon = databaseIcon; export const oracleTitle = 'Oracle'; @@ -17,20 +17,19 @@ export const extraInnoDBClusterColumns:Array = [ {name: 'Online', label: 'Online', field: row => row.status.cluster.onlineInstances, sortable: true, align: tableColumnAlign.left}, {name: 'Instances', label: 'Instances', field: row => row.spec.instances, sortable: true, align: tableColumnAlign.left}, {name: 'Routers', label: 'Routers', field: row => row.spec.router.instances, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraMySQLBackupColumns:Array = [ {name: 'Cluster', label: 'Cluster', field: row => row.spec.clusterName, sortable: true, align: tableColumnAlign.left}, {name: 'Status', label: 'Status', field: row => row.status.status, sortable: true, align: tableColumnAlign.left}, {name: 'Output', label: 'Output', field: row => row.status.output, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const InnoDBClusterListExcludes = [ { path: 'status/cluster/status', include: true }, { path: 'status/cluster/onlineInstances', include: true }, { path: 'spec/instances', include: true }, { path: 'spec/router/instances', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const InnoDBClusterReadExcludes = [ ]; @@ -40,7 +39,6 @@ export const MySQLBackupListExcludes = [ { path: 'spec/clusterName', include: true }, { path: 'status/status', include: true }, { path: 'status/output', include: true }, - { path: 'metadata/creationTimestamp', include: true }, ]; export const MySQLBackupReadExcludes = [ ]; diff --git a/front/libs/rabbitmq/custom.ts b/front/libs/rabbitmq/custom.ts index c4a39c6d..0d30c66c 100644 --- a/front/libs/rabbitmq/custom.ts +++ b/front/libs/rabbitmq/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { databaseColor, databaseIcon, } from '../../routes/custom'; export const rabbitmqIcon = databaseIcon; export const rabbitmqTitle = 'RabbitMQ'; @@ -9,10 +9,9 @@ export const colorRabbitmqCluster = databaseColor; export const descriptionRabbitmqCluster = ''; export const shortRabbitmqCluster = 'RabbitmqCluster'; export const extraRabbitmqClusterColumns:Array = [ - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const RabbitmqClusterListExcludes = [ - { path: 'metadata/creationTimestamp', include: true }, ]; export const RabbitmqClusterReadExcludes = [ ]; diff --git a/front/libs/redis/custom.ts b/front/libs/redis/custom.ts index dd9a30fc..4444cc72 100644 --- a/front/libs/redis/custom.ts +++ b/front/libs/redis/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { databaseColor, databaseIcon, installIcon } from '../../routes/custom'; export const redisIcon = databaseIcon; export const redisTitle = 'Redis'; @@ -27,7 +27,7 @@ export const extraRedisClusterColumns:Array = [ {name: 'ClusterSize', label: 'ClusterSize', field: row => row.spec.clusterSize, sortable: true, align: tableColumnAlign.left}, {name: 'LeaderReplicas', label: 'LeaderReplicas', field: row => row.spec.redisLeader.replicas, sortable: true, align: tableColumnAlign.left}, {name: 'FollowerReplicas', label: 'FollowerReplicas', field: row => row.spec.redisFollower.replicas, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, ]; export const extraRedisReplicationColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, diff --git a/front/libs/traefik/custom.ts b/front/libs/traefik/custom.ts index 3621255d..c9d8e96a 100644 --- a/front/libs/traefik/custom.ts +++ b/front/libs/traefik/custom.ts @@ -55,7 +55,7 @@ export const extraIngressRouteUDPColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, ]; export const extraMiddlewareColumns:Array = [ -// {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, + {name: 'Type', label: 'Type', field: row => Object.keys(row.spec)[0], sortable: true, align: tableColumnAlign.left}, ]; export const extraMiddlewareTCPColumns:Array = [ // {name: 'Name', label: 'Name', field: row => row.metadata.name, sortable: true, align: tableColumnAlign.left}, diff --git a/front/libs/vynil/custom.ts b/front/libs/vynil/custom.ts index 11d4ff73..1e699c02 100644 --- a/front/libs/vynil/custom.ts +++ b/front/libs/vynil/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' export const vynilIcon = 'album'; export const vynilTitle = 'Vynil'; export const iconDistrib = 'speaker_group'; @@ -17,14 +17,14 @@ export const PackageListExcludes = []; export const CategoryListExcludes = []; export const extraDistribColumns:Array = [ {name: 'url', label: 'url', field: row => row.spec.url, sortable: true, align: tableColumnAlign.left}, - {name: 'last_updated', label: 'last_updated', field: row => row.status.last_updated, sortable: true, align: tableColumnAlign.left}, + {name: 'branch', label: 'branch', field: row => row.spec.branch, sortable: true, align: tableColumnAlign.left}, + {name: 'last_updated', label: 'last_updated', field: row => timeAgo(row.status.last_updated), sortable: true, align: tableColumnAlign.left}, ]; export const extraInstallColumns:Array = [ {name: 'dist', label: 'dist', field: row => row.spec.distrib, sortable: true, align: tableColumnAlign.left}, {name: 'cat', label: 'cat', field: row => row.spec.category, sortable: true, align: tableColumnAlign.left}, {name: 'app', label: 'app', field: row => row.spec.component, sortable: true, align: tableColumnAlign.left}, - {name: 'status', label: 'status', field: row => row.status.status, sortable: true, align: tableColumnAlign.left}, - {name: 'last_updated', label: 'last_updated', field: row => row.status.last_updated, sortable: true, align: tableColumnAlign.left}, + {name: 'last_updated', label: 'last_updated', field: row => timeAgo(row.status.last_updated), sortable: true, align: tableColumnAlign.left}, ]; export const DistribListExcludes = [ { path: 'spec/url', include: true }, diff --git a/front/libs/zalando/custom.ts b/front/libs/zalando/custom.ts index bb39b2d5..36a3ffad 100644 --- a/front/libs/zalando/custom.ts +++ b/front/libs/zalando/custom.ts @@ -1,6 +1,6 @@ // noGramoGenerator import { QTableColumn } from 'quasar' -import { tableColumnAlign } from '../core' +import { tableColumnAlign, timeAgo } from '../core' import { databaseColor, databaseIcon, } from '../../routes/custom'; export const zalandoIcon = databaseIcon; export const zalandoTitle = 'Zalando PG'; @@ -23,7 +23,7 @@ export const extrapostgresqlColumns:Array = [ {name: 'Volume', label: 'Volume', field: row => row.spec.volume.size, sortable: true, align: tableColumnAlign.left}, {name: 'CPU-Request', label: 'CPU-Request', field: row => row.spec.resources.requests.cpu, sortable: true, align: tableColumnAlign.left}, {name: 'Memory-Request', label: 'Memory-Request', field: row => row.spec.resources.requests.memory, sortable: true, align: tableColumnAlign.left}, - {name: 'Age', label: 'Age', field: row => row.metadata.creationTimestamp, sortable: true, align: tableColumnAlign.left}, + {name: 'Age', label: 'Age', field: row => timeAgo(row.metadata.creationTimestamp), sortable: true, align: tableColumnAlign.left}, {name: 'Status', label: 'Status', field: row => row.status.PostgresClusterStatus, sortable: true, align: tableColumnAlign.left}, ]; export const extraClusterKopfPeeringColumns:Array = [ @@ -39,7 +39,6 @@ export const postgresqlListExcludes = [ { path: 'spec/volume/size', include: true }, { path: 'spec/resources/requests/cpu', include: true }, { path: 'spec/resources/requests/memory', include: true }, - { path: 'metadata/creationTimestamp', include: true }, { path: 'status/PostgresClusterStatus', include: true }, ]; export const postgresqlReadExcludes = [ diff --git a/front/pages/install/vynil/InstallView.vue b/front/pages/install/vynil/InstallView.vue index dd402e93..3b2ea29e 100644 --- a/front/pages/install/vynil/InstallView.vue +++ b/front/pages/install/vynil/InstallView.vue @@ -673,6 +673,13 @@ onResult(res => { if (res.data!=undefined && Array.isArray(res.data.k8sNamespace) && res.data.k8sNamespace[0].vynilInstall[0]!=undefined && res.data.k8sNamespace[0].vynilInstall[0]!=null) { model.value = res.data.k8sNamespace[0].vynilInstall[0] } + sectionCounts.value.consumeLeft = 0; + sectionCounts.value.consumeRight = 0; + sectionCounts.value.parent = 0; + sectionCounts.value.gets = 0; + sectionCounts.value.users = 0; + sectionCounts.value.uses = 0; + sectionCounts.value.bellow = 0; sectionCounts.value.uses += conditions.value["consumevynilPackage"](res.data)?1:0; sectionCounts.value.uses += conditions.value["usek8sJob"](res.data)?1:0; sectionCounts.value.parent += conditions.value["parentvynilInstall"](res.data)?1:0; diff --git a/front/pages/install/vynil/installDashboard.vue b/front/pages/install/vynil/installDashboard.vue index 5c4af937..edc3865a 100644 --- a/front/pages/install/vynil/installDashboard.vue +++ b/front/pages/install/vynil/installDashboard.vue @@ -4,6 +4,9 @@ import { defineAsyncComponent } from 'vue' import installQuery from '@/queries/vynil/install.read.graphql' const pieChart = defineAsyncComponent(() => import( '@/components/charts/pieChart.vue')); const radialLineChart = defineAsyncComponent(() => import( '@/components/charts/radialLineChart.vue')); +const ProblemOverview = defineAsyncComponent(() => import( '@/components/core/ProblemOverview.vue')); +const OverviewSkeleton = defineAsyncComponent(() => import( '@/components/core/OverviewSkeleton.vue')); +const TableSkeleton = defineAsyncComponent(() => import( '@/components/core/TableSkeleton.vue')); const vynilDistribList = defineAsyncComponent(() => import( '@/components/vynil/DistribList.vue')); import { DistribSimpleExcludes } from '../../../libs/vynil/Distrib.js' const vynilInstallList = defineAsyncComponent(() => import( '@/components/vynil/InstallList.vue')); @@ -21,7 +24,7 @@ const InstallProblems = ref([]); const CatDistCount = ref([]); if (isNamespaced()) setNamespaceFromRoute(); const navigation = useNavigationStoreRef(); -const { result, refetch, onResult, onError } = useQuery(installQuery, { +const { result, loading, refetch, onResult, onError } = useQuery(installQuery, { "Distrib": { "filters": [], "excludes": DistribSimpleExcludes @@ -69,7 +72,7 @@ onResult((res) => { -
+
diff --git a/package.json b/package.json index d72dbd31..067542a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gramo", - "version": "0.1.8", + "version": "0.2.0", "description": "A cross-navigation Kubernetes front-end", "main": "index.js", "scripts": { diff --git a/utils/gen.ts b/utils/gen.ts index 72e5553c..38801194 100755 --- a/utils/gen.ts +++ b/utils/gen.ts @@ -31,6 +31,8 @@ loadPartial('resolversSelector', path.resolve(partials_resolvers, 'select loadPartial('resolversIngress', path.resolve(partials_resolvers, 'ingress.ts.hbs')); loadPartial('resolversServiceAccount', path.resolve(partials_resolvers, 'serviceAccount.ts.hbs')); loadPartial('resolversNodeName', path.resolve(partials_resolvers, 'nodeName.ts.hbs')); +loadPartial('resolversEndpoint', path.resolve(partials_resolvers, 'endpoint.ts.hbs')); +loadPartial('resolversStateful', path.resolve(partials_resolvers, 'stateful.ts.hbs')); loadPartial('resolversRole', path.resolve(partials_resolvers, 'role.ts.hbs')); loadPartial('resolversRoleBinding', path.resolve(partials_resolvers, 'roleBinding.ts.hbs')); loadPartial('resolversCertManager', path.resolve(partials_resolvers, 'certmanager.ts.hbs')); diff --git a/utils/generator/back/obj.resolvers.ts.hbs b/utils/generator/back/obj.resolvers.ts.hbs index 08429b97..d94777e0 100644 --- a/utils/generator/back/obj.resolvers.ts.hbs +++ b/utils/generator/back/obj.resolvers.ts.hbs @@ -26,6 +26,12 @@ export const mutations = { }; const localResolvers = { {{#each autoResolvers}} + {{#if (eq algo 'stateful')}} +{{> resolversStateful algo=this.algo type=this.type targetShort=this.targetShort targetGroup=this.targetGroup path=this.path }} + {{/if}} + {{#if (eq algo 'endpoint')}} +{{> resolversEndpoint algo=this.algo type=this.type targetShort=this.targetShort targetGroup=this.targetGroup path=this.path }} + {{/if}} {{#if (eq algo 'k8up')}} {{> resolversK8up algo=this.algo type=this.type targetShort=this.targetShort targetGroup=this.targetGroup path=this.path }} {{/if}} diff --git a/utils/generator/config.ts b/utils/generator/config.ts index 19ed2501..84e9900d 100644 --- a/utils/generator/config.ts +++ b/utils/generator/config.ts @@ -8,6 +8,7 @@ export const excludes = [ {group: 'vynil', short: 'Install', for: ['list', 'simple'], values: [{path:'status/tfstate'}, {path:'status/plan'}]}, ]; const uses = [ + {algo: 'endpoint', group: 'k8s', short: 'Endpoints', usedGroup: 'k8s', usedShort: 'Pod'}, {algo: 'traefik', group: 'k8s', short: 'Ingress', usedGroup: 'traefik', usedShort: 'Middleware', path: null}, {algo: 'vynil', group: 'vynil', short: 'Install', usedGroup: 'k8s', usedShort: 'Job', path: null}, {algo: 'vynil', group: 'vynil', short: 'Distrib', usedGroup: 'k8s', usedShort: 'Job', path: null}, @@ -75,6 +76,8 @@ const provides = [ {algo: 'apiService', group: 'k8s', short: 'APIService', providedGroup: 'k8s', providedShort: 'CustomResourceDefinition'}, ]; const equity = [ + {algo: 'endpoint', group: 'k8s', short: 'Endpoints', parentGroup: 'k8s', parentShort: 'Service'}, + {algo: 'stateful', group: 'k8s', short: 'Service', parentGroup: 'k8s', parentShort: 'StatefulSet'}, {algo: 'certmanager', group: 'k8s', short: 'Secret', parentGroup: 'certmanager', parentShort: 'Certificate'}, {algo: 'k8s', group: 'k8s', short: 'Secret', parentGroup: 'secretgenerator', parentShort: 'BasicAuth'}, {algo: 'k8s', group: 'k8s', short: 'Secret', parentGroup: 'secretgenerator', parentShort: 'SSHKeyPair'}, @@ -93,6 +96,7 @@ const children = [ // {algo: 'k8up', group: 'k8s', short: 'Job', parentGroup: 'k8up', parentShort: 'Archive'}, // {algo: 'k8up', group: 'k8up', short: 'Archive', parentGroup: 'k8up', parentShort: 'Schedule'}, {algo: 'certmanager', group: 'certmanager', short: 'CertificateRequest', parentGroup: 'certmanager', parentShort: 'Certificate'}, + {algo: 'certmanager', group: 'certmanager', short: 'Order', parentGroup: 'certmanager', parentShort: 'Certificate'}, {algo: 'k8s', group: 'core', short: 'Container', parentGroup: 'k8s', parentShort: 'Pod'}, {algo: 'k8s', group: 'k8s', short: 'ReplicaSet', parentGroup: 'k8s', parentShort: 'Deployment'}, {algo: 'k8s', group: 'k8s', short: 'Pod', parentGroup: 'k8s', parentShort: 'ReplicaSet'}, diff --git a/utils/generator/front/obj.components.list.vue.hbs b/utils/generator/front/obj.components.list.vue.hbs index f833a11d..1c3eaf04 100644 --- a/utils/generator/front/obj.components.list.vue.hbs +++ b/utils/generator/front/obj.components.list.vue.hbs @@ -30,8 +30,10 @@ withDefaults(defineProps<{model: object[], useAction?:boolean, useRefresh?: bool diff --git a/utils/generator/front/obj.pages.view.vue.hbs b/utils/generator/front/obj.pages.view.vue.hbs index cdab8afe..d318bda8 100644 --- a/utils/generator/front/obj.pages.view.vue.hbs +++ b/utils/generator/front/obj.pages.view.vue.hbs @@ -87,6 +87,13 @@ onResult(res => { if (res.data!=undefined{{#if namespaced}} && Array.isArray(res.data.k8sNamespace) {{/if}} && res.data{{#if namespaced}}.k8sNamespace[0]{{/if}}.{{ group }}{{ short }}[0]!=undefined && res.data{{#if namespaced}}.k8sNamespace[0]{{/if}}.{{ group }}{{ short }}[0]!=null) { model.value = res.data{{#if namespaced}}.k8sNamespace[0]{{/if}}.{{ group }}{{ short }}[0] } + sectionCounts.value.consumeLeft = 0; + sectionCounts.value.consumeRight = 0; + sectionCounts.value.parent = 0; + sectionCounts.value.gets = 0; + sectionCounts.value.users = 0; + sectionCounts.value.uses = 0; + sectionCounts.value.bellow = 0; {{#if (eq group 'cattle')}} {{> cattleCustom ctx=. page='view' operation='dataPrepare'}} {{/if}} diff --git a/utils/generator/partials/back/problems.ts.hbs b/utils/generator/partials/back/problems.ts.hbs index 42ba7f46..1d8d227d 100644 --- a/utils/generator/partials/back/problems.ts.hbs +++ b/utils/generator/partials/back/problems.ts.hbs @@ -40,6 +40,14 @@ } })) } {{/if}} +{{#if (and (eq group 'certmanager') (or (eq short 'Order') (eq short 'Challenge')))}} + if (parent['status'] != undefined && parent['status']['state'] != 'valid') { + problems.push({ + source: 'status', + description: `The {{short}} is ${parent['status']['state']}` + }) + } +{{/if}} {{#if (and (eq group 'k8up') (or (or (eq short 'Backup') (eq short 'Check')) (eq short 'Prune')))}} if (parent['status'] != undefined && Array.isArray(parent['status']['conditions']) && parent['status']['conditions'].filter(c=>c['reason']=='Failed'&&c['status']=='True').length>0) { problems.unshift(...parent['status']['conditions'].filter(c=>c['reason']=='Failed'&&c['status']=='True').map(c=>{ return { @@ -160,6 +168,14 @@ }) } {{/if}} +{{#if (and (eq group 'k8s') (eq short 'Deployment'))}} + if (parent['status'] != undefined && parent['status']['unavailableReplicas']>0) { + problems.push({ + source: 'unavailableReplicas', + description: `${parent['status']['unavailableReplicas']} unavailable pods` + }) + } +{{/if}} {{#if (and (eq group 'k8s') (eq short 'StatefulSet'))}} if (parent['spec'] != undefined && parent['status'] != undefined && parent['spec']['replicas']>parent['status']['availableReplicas']) { problems.push({ diff --git a/utils/generator/partials/front/status.fields.vue.hbs b/utils/generator/partials/front/status.fields.vue.hbs index f542e4dc..63946730 100644 --- a/utils/generator/partials/front/status.fields.vue.hbs +++ b/utils/generator/partials/front/status.fields.vue.hbs @@ -1,11 +1,11 @@ {{#if (eq (getByPath properties 'status/properties/conditions/type') 'array')}} - +