Skip to content

Commit

Permalink
0.2.1: i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
sebt3 committed Mar 9, 2024
1 parent c9b78ba commit 5620f5c
Show file tree
Hide file tree
Showing 55 changed files with 1,304 additions and 455 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
!/front/components/vynil/CategoryMeta.vue
/front/libs/**/*.ts
!/front/libs/*/custom.ts
!/front/libs/i18n/*
!/front/libs/core/*
/front/pages/**/*.vue
!/front/pages/install/vynil/DistribView.vue
Expand Down
18 changes: 17 additions & 1 deletion back/resolvers/vynil/Package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import {kc, cache, applyFilter, applyFieldSelection, getByPath, getMeta } from '
import { gramoConfig } from '../../config.js'
import { lists as distribQueries } from './Distrib.js';

function derefOptions(ret: object, dists) {
Object.keys(ret).forEach((name) => {
if (ret[name]!=null && ret[name]['type']=='object' && !['',null,undefined].includes(ret[name]['x-vynil-category']) && !['',null,undefined].includes(ret[name]['x-vynil-package']) && dists.filter(d=>d.status.components[ret[name]['x-vynil-category']]!=undefined&&d.status.components[ret[name]['x-vynil-category']][ret[name]['x-vynil-package']]!=undefined).length>0) {
Object.assign(ret[name]['properties'], dists.filter(d=>d.status.components[ret[name]['x-vynil-category']]!=undefined&&d.status.components[ret[name]['x-vynil-category']][ret[name]['x-vynil-package']]!=undefined)[0].status.components[ret[name]['x-vynil-category']][ret[name]['x-vynil-package']]['options'])
}
if (ret[name]!=null && ret[name]['type']=='object' && ret[name]['properties']!=undefined) Object.keys(ret[name]['properties']).forEach(key=>derefOptions(ret[name]['properties'][key], dists))
if (ret[name]!=null && ret[name]['type']=='array' && ret[name]['items']!=undefined) Object.keys(ret[name]['items']).forEach(key=>derefOptions(ret[name]['items'][key], dists))
})
return ret
}

const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi);

export const mutations = {
Expand All @@ -23,13 +34,18 @@ export const lists = {
item.name = name;
item.distrib = distName as string;
item.category = category;
item.options = derefOptions(Object.assign({}, pkg['options']), dists);
(lst as object[]).push(item)
})
})
});
cache.set('vynilPackage', lst, 2);
} catch (err) {
console.error((err as object)['body']);
if (typeof err === 'object' && (err as object)['body'] !=undefined && (err as object)['statusCode'] !=undefined) {
if ((err as object)['statusCode'] != 404 && (err as object)['body']['reason']!='Forbidden') {
console.error('error', (err as object)['body']);
}
} else {console.error('error', err)}
return []
}
}
Expand Down
1 change: 1 addition & 0 deletions front/components/core/MonacoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const props = withDefaults(defineProps<{
wordWrap: "wordWrapColumn",
automaticLayout: true,
});
console.log('xxx', props.properties)
const height = window.innerHeight - 300;
const code=ref(null);
onMounted(() => {
Expand Down
4 changes: 2 additions & 2 deletions front/components/core/OpenApiEditUndefObject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function onAdd() {
<q-input dense v-model="newName" autofocus @keyup.enter="prompt = false" />
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn flat label="Cancel" v-close-popup />
<q-btn flat label="Add" v-close-popup @click="onAdd" />
<q-btn flat :label="$t('core.cancel')" v-close-popup />
<q-btn flat :label="$t('core.add')" v-close-popup @click="onAdd" />
</q-card-actions>
</q-card>
</q-dialog>
Expand Down
41 changes: 23 additions & 18 deletions front/components/core/OpenApiNamedIcon.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
<script setup lang="ts">
defineProps<{
withDefaults(defineProps<{
name: string
isDefault: boolean
}>();
isDefault?: boolean
}>(),{
isDefault: true
});
</script>
<template>
<q-icon :color="isDefault?'':'secondary'" v-if="name == 'name'" name="smart_button" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'namespace'" name="dashboard" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'enable'" name="done" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'app-group'" name="workspaces" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'domain-name'" name="link" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'issuer'" name="local_police" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'ingress-class'" name="alt_route" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'pullPolicy'" name="downloading" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'registry'" name="store" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'repository'" name="image" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'tag'" name="sell" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'dbname'" name="storage" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'engine'" name="settings" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'username'" name="person" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="name == 'type'" name="style" />
<q-icon :color="isDefault?'':'secondary'" v-if="['name'].includes(name)" name="smart_button" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['namespace'].includes(name)" name="dashboard" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['enable'].includes(name)" name="done" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['app-group'].includes(name)" name="workspaces" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['domain-name'].includes(name)" name="link" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['issuer'].includes(name)" name="local_police" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['ingress-class'].includes(name)" name="alt_route" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['pullPolicy'].includes(name)" name="downloading" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['registry'].includes(name)" name="store" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['repository'].includes(name)" name="image" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['tag'].includes(name)" name="sell" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['dbname'].includes(name)" name="storage" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['engine'].includes(name)" name="settings" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['username'].includes(name)" name="person" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['type'].includes(name)" name="style" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['Age','last_updated'].includes(name)" name="access_time" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['Ready'].includes(name)" name="check_circle" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['Status'].includes(name)" name="report" />
<q-icon :color="isDefault?'':'secondary'" v-else-if="['domain', 'key'].includes(name)" :name="name" />
<q-icon :color="isDefault?'':'secondary'" v-else name="question_mark" />
</template>
8 changes: 4 additions & 4 deletions front/components/core/TableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ withDefaults(defineProps<{
</template>
</q-input>
<q-btn icon="filter_list" @click="show_filter=!show_filter">
<q-tooltip>Show filter</q-tooltip>
<q-tooltip>{{ $t('list.showFilter') }}</q-tooltip>
</q-btn>
<q-btn v-if="userefresh == true" icon="refresh" @click="console.log(modelFilter);$emit('refresh')">
<q-tooltip>Refresh data</q-tooltip>
<q-tooltip>{{ $t('list.refresh') }}</q-tooltip>
</q-btn>
<q-btn v-if="usecreate == true" label="Add" color="positive" icon="add" @click="$emit('create')">
<q-tooltip>Create a new {{ itemtype }}</q-tooltip>
<q-btn v-if="usecreate == true" :label="$t('core.add')" color="positive" icon="add" @click="$emit('create')">
<q-tooltip>{{ $t('new.cluster', {name: itemtype}) }}</q-tooltip>
</q-btn>
</q-btn-group>
</div>
Expand Down
2 changes: 1 addition & 1 deletion front/components/navigation/RelatedLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const route = useRoute();
const namespace = ref(useNavigationStore().namespace)
</script>
<template>
<q-btn-dropdown padding="none" dense flat no-caps label="Related" class="text-grey">
<q-btn-dropdown padding="none" dense flat no-caps :label="$t('core.related')" class="text-grey">
<q-list>
<q-item clickable v-close-popup v-for="item in route.meta.related" v-bind:key="item.target" :to="{ name: item.target, params: item.ns||false?{ namespace }:{} }">
<q-item-section>
Expand Down
236 changes: 236 additions & 0 deletions front/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
{
"meta": {
"metadata": "Metadata",
"age": "Age",
"lastUpdate": "last update",
"name": "Name",
"namespace": "Namespace",
"days": "no day | {n} day | {n} days",
"hours": "no hour | {n} hour | {n} hours",
"minutes": "no minut | {n} minute | {n} minutes",
"seconds": "no second | {n} second | {n} seconds"
},
"dashboard": {
"success": "Congratulations",
"noProblem": "No problem found",
"noPerm": "It look like you have no permissions at all"
},
"overview": {
"captionList": "{ short } list",
"titleAllList": "List all { short }",
"titleList": "List { short } in namespace { namespace }",
"dashboardBreadcrumb": "Dashboard",
"dashboardTitle": "{ name } Dashboard",
"dashboardNSTitle": "{ name } Dashboard for { namespace } namespace",
"adviceBreadcrumb": "Advices",
"adviceTitle": "{ name } Advices for all namespaces",
"adviceNSTitle": "{ name } Advices for { namespace } namespace",
"perNamespace": "{short} par namespace"
},
"category": {
"automation": "Automation",
"config": "Configuration",
"database": "Database",
"install": "Installation",
"network": "Network",
"security": "Security",
"storage": "Storage",
"system": "System",
"workflow": "Workflow",
"workload": "Workload"
},
"core": {
"url": "URL",
"ip": "IP",
"highlight": "Highlight",
"type": "Type",
"status": "Status",
"error": "Erreur",
"ready": "Ready",
"events": "Evènements",
"submit": "Submit",
"notFound": "{ short } not found",
"deleteTooltip": "Delete { short } { name }",
"editTooltip": "Edit { short } { name }",
"viewParentTooltip": "View parent { short } { name }",
"wait": "{msg}. Please wait...",
"related": "Related",
"cancel": "Cancel",
"add": "Add",
"networkError": "A network error have occured",
"graphqlError": "A GraphQL error have occured, this is likely a bug"
},
"delete": {
"notifyWorking": "Delete in progress",
"notifyDone": "Delete done",
"notifyError": "Delete failed",
"title": "Confirm <span class=\"text-red\">delete</span>",
"message": "<em>You are</em> about to <span class=\"text-red\">delete</span> { short } <strong>{ name }</strong>"
},
"list": {
"all": "All",
"refresh":"Refresh data",
"showFilter":"Show filter",
"breadcrumb": "List",
"namespaced": "List { short } in namespace: { namespace }",
"cluster": "List { short }"
},
"view": {
"breadcrumb": "View",
"namespaced": "{ short } { name } in namespace: { namespace }",
"cluster": "{ short } { name }",
"tabs": {
"simple": "Configuration",
"yaml": "full Yaml"
}
},
"edit": {
"breadcrumb": "Edit",
"namespaced": "Edit { short } { name } in namespace: { namespace }",
"cluster": "Edit { short } { name }",
"submitTooltip": "Confirm current modifications",
"notifyWorking": "Update in progress",
"notifyDone": "Modification applied",
"notifyError": "Modification failed",
"tabs": {
"simple": "Simple",
"yaml": "full Yaml"
}
},
"new": {
"breadcrumb": "Create",
"namespaced": "Create a new { short } in namespace: { namespace }",
"cluster": "Create a new { short }",
"notifyNotReady": "Not ready yet",
"notifyDone": "Creation proceded",
"notifyError": "Creation failed",
"notifyWorking": "Creation in progress"
},
"cilium": {
"ciliumID": "Cilium ID",
"endpointID": "Endpoint ID",
"identityID": "Identity ID",
"ingressEnforcement": "Ingress Enforcement",
"egressEnforcement": "Egress Enforcement",
"visibilityPolicy": "Visibility Policy",
"endpointState": "Endpoint State",
"disabled": "Disabled"
},
"cnpg": {
"Cluster": "Cluster",
"Instances": "Instances",
"Primary": "Primary",
"Phase": "Phase",
"lastBackup": "Last Backup"
},
"fluxcd": {
"Children": "Children",
"Endpoint": "Endpoint",
"Chart": "Chart",
"Version": "Version",
"SourceKind": "Source Kind",
"SourceName": "Source Name",
"LastRun": "Last run",
"LatestImage": "LatestImage",
"LastChange": "Last Change",
"LastScan": "Last scan",
"Tags": "Tags"
},
"jaeger": {
"Status": "Status",
"Version": "Version",
"Strategy": "Strategy",
"Storage": "Storage"
},
"k8s": {
"Types": "Types",
"CPUs": "CPUs",
"RAM": "RAM",
"Replicas": "Replicas",
"Completion": "Completion",
"Role": "Role",
"Groups": "Groups",
"ServiceAccount": "ServiceAccount",
"Scope": "Scope",
"Group": "Group",
"Kind": "Kind",
"Holder": "Holder",
"Duration": "Duration(s)",
"ReadyToUse": "ReadyToUse",
"SourcePVC": "SourcePVC",
"RestoreSize": "RestoreSize",
"SnapshotClass": "SnapshotClass",
"SnapshotContent": "SnapshotContent",
"CreationTime": "CreationTime",
"Driver": "Driver",
"DeletionPolicy": "DeletionPolicy",
"VolumeSnapshotClass": "VolumeSnapshotClass",
"VolumeSnapshot": "VolumeSnapshot",
"VolumeSnapshotNamespace": "VolumeSnapshotNamespace",
"SourceSnapshotContent": "SourceSnapshotContent",
"DateTaken": "DateTaken"
},
"k8up": {
"DateTaken": "Date taken",
"Repository": "Repository"
},
"mariadb": {
"MariaDB": "MariaDB",
"Secret": "Secret",
"CharSet": "CharSet",
"Collate": "Collate",
"Database": "Database",
"Table": "Table",
"Username": "Username",
"GrantOpt": "GrantOpt",
"PrimaryPod": "PrimaryPod",
"MaxConns": "MaxConns"
},
"mongodb": {
"Phase": "Phase",
"Version": "Version"
},
"monitoring": {
"Version": "Version",
"Replicas": "Replicas",
"Desired": "Desired",
"Paused": "Paused"
},
"namecheap": {
"In": "In",
"Condition": "Condition"
},
"opentelemetry": {
"Endpoint": "Endpoint",
"Sampler": "Sampler",
"SamplerArg": "Sampler Arg",
"Version": "Version",
"Mode": "Mode",
"Image": "Image",
"Management": "Management"
},
"oracle": {
"Output": "Output",
"Cluster": "Cluster",
"Routers": "Routers",
"Instances": "Instances",
"Online": "Online"
},
"redis": {
"ClusterSize": "ClusterSize",
"LeaderReplicas": "LeaderReplicas",
"FollowerReplicas": "FollowerReplicas"
},
"tekton": {
"StartTime": "StartTime",
"CompletionTime": "CompletionTime",
"Address": "Address"
},
"vynil": {
"url": "Url",
"branch": "Banch",
"distrib": "Distribution",
"cat": "Category",
"app": "Application"
}
}
Loading

0 comments on commit 5620f5c

Please sign in to comment.