Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename epinio to Application Engine when embedded in Rancher #374

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dashboard/pkg/epinio/components/application/AppInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { validateKubernetesName } from '@shell/utils/validators/kubernetes-name'
import { EPINIO_TYPES, EpinioNamespace } from '../../types';
import Application from '../../models/applications';
import { objValuesToString } from '../../utils/settings';
import ProductName from '../../mixins/product-name';

export interface EpinioAppInfo {
meta: {
Expand Down Expand Up @@ -48,6 +49,8 @@ export default Vue.extend<Data, any, any, any>({
ChartValues,
},

mixins: [ProductName],

props: {
application: {
type: Object as PropType<Application>,
Expand Down Expand Up @@ -234,7 +237,7 @@ export default Vue.extend<Data, any, any, any>({
v-model="values.configuration.routes"
data-testid="epinio_app-info_routes"
:title="t('epinio.applications.create.routes.title')"
:protip="t('epinio.applications.create.routes.tooltip')"
:protip="t('epinio.applications.create.routes.tooltip', { epinio: productName})"
:mode="mode"
:value-placeholder="t('epinio.applications.create.routes.placeholder')"
/>
Expand Down
5 changes: 3 additions & 2 deletions dashboard/pkg/epinio/config/epinio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createEpinioRoute, rootEpinioRoute } from '../utils/custom-routing';
import { EPINIO_PRODUCT_NAME, EPINIO_STANDALONE_CLUSTER_NAME, EPINIO_TYPES } from '../types';
import EpinioDiscovery from '../utils/epinio-discovery';
import { MULTI_CLUSTER } from '@shell/store/features';
import { isStandalone } from '../utils/utils';

export function init($plugin: any, store: any) {
const {
Expand All @@ -18,12 +19,12 @@ export function init($plugin: any, store: any) {
weightGroup
} = $plugin.DSL(store, $plugin.name);

const isEpinioSingleProduct = process.env.rancherEnv === 'epinio';
const isEpinioSingleProduct = isStandalone();

if (isEpinioSingleProduct) {
store.dispatch('setIsSingleProduct', {
logo: require(`../assets/logo-epinio.svg`),
productNameKey: 'epinio.label',
productNameKey: 'epinio.label.standalone',
aboutPage: createEpinioRoute('c-cluster-about', { cluster: EPINIO_STANDALONE_CLUSTER_NAME }),
afterLoginRoute: createEpinioRoute('c-cluster-dashboard', { cluster: EPINIO_STANDALONE_CLUSTER_NAME }),
logoRoute: createEpinioRoute('c-cluster-dashboard', { cluster: EPINIO_STANDALONE_CLUSTER_NAME }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ typeLabel:
}
typeDescription:
namespaces: Namespaces group your applications, services and other resources. Deleting a namespace will delete all of it's resources.
applications: Epinio uses Applications to transition your code, through build, to being deployed.
services: Epinio can create instances of your services. Instances can be bound to your applications to provide data, for example a database service bound to an application might provide connection credentials.
applications: Applications transition your code, through build, to being deployed.
services: Instances of your services can be created and shared between Applications. Bind instances to your application to provide data, for example a database service bound to an application might provide connection credentials.
configurations: Configurations are a way to provide data to applications. The data becomes available once the configuration is bound to them.
appcharts: Application Charts define kube resources created by your application. Templates for active applications cannot be changed
catalogservices: Catalog Services provide additional, common functionality to applications. For example an instance of a database Catalog Service can be bound to an application.
Expand All @@ -59,15 +59,19 @@ asyncButton:
waiting: 'Refreshing'
waitingIcon: refresh
epinio:
label: Epinio
label:
standalone: Epinio
embedded: Application Engine
about:
allPackages: See all packages
getBinaries: Get binaries
intro:
dashboard: Dashboard
welcome: Welcome to Epinio
blurb: The Application Development Engine for Kubernetes
description: Epinio takes your application from source code to deployment and allow for Developers and Operators to work better together!
welcome: Welcome to {epinio}
blurb:
standalone: The Application Development Engine for Kubernetes
embedded: The Development Engine for Kubernetes
description: "{epinio} takes your application from source code to deployment and enables Developers and Operators to work better together"
learnMoreLink: https://epinio.io/
learnMore: Learn more
noNamespaces: Create a Namespace, then create your Applications
Expand All @@ -93,10 +97,10 @@ epinio:
tableHeaders:
namespace: Namespace
instances:
header: Epinio instances
header: "{epinio} Instances"
none:
header: No instances of Epinio were found
description: To view an Epinio cluster be sure to import a Cluster where one is installed
header: No instances of {epinio} were found
description: To view an {epinio} instances be sure to import a Cluster where one is installed
tableHeaders:
api: URL
version: Version
Expand Down Expand Up @@ -149,8 +153,6 @@ epinio:
latestCommit: Latest commit deployed
behindCommits: Commits behind
create:
title: Application
titleSubText: Epinio
instances: Instances
settingsVars:
title: Application Variables
Expand All @@ -164,7 +166,7 @@ epinio:
valueLabel: Value
routes:
title: Routes
tooltip: Replace the default route (<app name>.<epinio domain>) with one or more custom routes
tooltip: Replace the default route (<app name>.<{epinio} domain>) with one or more custom routes
placeholder: e.g. my-custom-route.com/my-app
export:
label: Export App
Expand Down Expand Up @@ -245,7 +247,7 @@ epinio:

configurations:
label: Bindings
subtext: Bind to Application
subtext: Bind Configurations and Services to your app
configurations:
select:
placeholderWithOptions: Select configs to bind app to
Expand Down Expand Up @@ -313,7 +315,8 @@ epinio:
editFromCommit:
label: Redeploy
goToEpinio:
label: Epinio App
labelStandalone: Epinio App
labelEmbedded: Application Engine App
viewDeployment:
label: View In Kube Cluster
wm:
Expand Down Expand Up @@ -365,7 +368,7 @@ epinio:
label: Catalog Service
placeholderNoOptions: There are no services
placeholderWithOptions: Select the type of Service to create
failedWaitingForServiceInstance: Service instance was created but failed to be returned by Epinio, no applications were bound
failedWaitingForServiceInstance: Service instance was created but failed to be returned, no applications were bound
catalogService:
tableHeaders:
shortDesc: Headline
Expand All @@ -385,3 +388,6 @@ model:
authConfig:
provider:
epinio: Auth Provider
product:
# Note one other usage of this string above
epinio: This is dynamically replaced in code
8 changes: 7 additions & 1 deletion dashboard/pkg/epinio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import epinioRoutes from './routing/epinio-routing';
import epinioMgmtStore from './store/epinio-mgmt-store';
import epinioStore from './store/epinio-store';
import { createEpinioRoute } from './utils/custom-routing';
import { isStandalone } from './utils/utils';
import epinioL10n from './epinio-l10n/en-us.yaml';

const epinioObjAnnotations = [
'epinio.io/app-container',
Expand Down Expand Up @@ -53,6 +55,10 @@ export default function(plugin: IPlugin) {
// Add hooks to Vue navigation world
plugin.addNavHooks(onEnter, onLeave);

// FIXME: should be done per file in epinio-l10n
epinioL10n.product.epinio = isStandalone() ? epinioL10n.epinio.label.standalone : epinioL10n.epinio.label.embedded;
plugin.addL10n('en-us', epinioL10n);

// Add action button in the menu of each object belonging to Epinio's applications
plugin.addAction(
ActionLocation.TABLE,
Expand All @@ -66,7 +72,7 @@ export default function(plugin: IPlugin) {
]
},
{
labelKey: 'epinio.applications.actions.goToEpinio.label',
labelKey: isStandalone() ? 'epinio.applications.actions.goToEpinio.labelStandalone' : 'epinio.applications.actions.goToEpinio.labelEmbedded',
icon: 'icon-epinio',
enabled(ctx: any) {
const isUserNamespace = ctx.metadata.namespace !== 'epinio';
Expand Down
10 changes: 10 additions & 0 deletions dashboard/pkg/epinio/mixins/product-name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Vue from 'vue';
import { getProductName } from '../utils/utils';

export default Vue.extend({
computed: {
productName() {
return getProductName(this.t.bind(this));
}
}
});
20 changes: 9 additions & 11 deletions dashboard/pkg/epinio/pages/c/_cluster/about.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { MANAGEMENT } from '@shell/config/types';
import { getVendor } from '@shell/config/private-label';
import ProductName from '../../../mixins/product-name';

export default {
async fetch() {
Expand All @@ -9,24 +9,22 @@ export default {
this.version = await this.$store.dispatch('epinio/version');
},

mixins: [ProductName],

data() {
return { version: null };
},
computed: {
appName() {
const isSingleProduct = !!this.$store.getters['isSingleProduct'];

return isSingleProduct ? getVendor() : this.t('epinio.label');
},
computed: {

downloads() {
// TODO: Not sure if we can get the URL from the settings here.
const gitUrl = `https://github.com/epinio/epinio/releases/download`;

return [
this.createOSOption('about.os.mac', 'icon-apple', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-darwin-x86_64`, null),
this.createOSOption('about.os.linux', 'icon-linux', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-linux-x86_64`, this.downloadLinuxImages),
this.createOSOption('about.os.windows', 'icon-windows', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-windows-x86_64.zip`)
this.createOSOption('about.os.mac', 'icon-apple', `${ gitUrl }/${ this.version?.displayVersion }/epinio-darwin-x86_64`, null),
this.createOSOption('about.os.linux', 'icon-linux', `${ gitUrl }/${ this.version?.displayVersion }/epinio-linux-x86_64`, this.downloadLinuxImages),
this.createOSOption('about.os.windows', 'icon-windows', `${ gitUrl }/${ this.version?.displayVersion }/epinio-windows-x86_64.zip`)
];
},

Expand Down Expand Up @@ -58,7 +56,7 @@ export default {
<div class="about">
<template>
<h1 v-t="'about.title'">
{{ appName }}
{{ productName }}
</h1>
<table>
<thead>
Expand All @@ -74,7 +72,7 @@ export default {
target="_blank"
rel="nofollow noopener noreferrer"
>
{{ appName }}
{{ productName }}
</a>
</td><td>{{ versionString }}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ export default Vue.extend<Data, any, any, any>({
>
<Wizard
:steps="steps"
:banner-title="t('epinio.applications.create.title')"
:banner-title-subtext="t('epinio.applications.create.titleSubText')"
header-mode="create"
finish-mode="done"
:edit-first-step="true"
Expand Down
19 changes: 15 additions & 4 deletions dashboard/pkg/epinio/pages/c/_cluster/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Location } from 'vue-router';
import Banner from '@components/Banner/Banner.vue';
import { METRIC } from '@shell/config/types';
import { allHash } from '@shell/utils/promise';
import ProductName from '../../../mixins/product-name';
import { isStandalone } from '../../../utils/utils';

type ComponentService = {
name: string,
Expand All @@ -26,6 +28,9 @@ export default Vue.extend<any, any, any, any>({
DashboardCard,
ConsumptionGauge
},

mixins: [ProductName],

async fetch() {
const hash: { [key:string]: any } = await allHash({
ns: this.$store.dispatch(`epinio/findAll`, { type: EPINIO_TYPES.NAMESPACE }),
Expand All @@ -37,6 +42,7 @@ export default Vue.extend<any, any, any, any>({

this.version = hash.version;
},

data() {
return {
sectionContent: [
Expand Down Expand Up @@ -77,12 +83,15 @@ export default Vue.extend<any, any, any, any>({
aboutLink: !this.$store.getters['isSingleProduct'] ? createEpinioRoute('c-cluster-about', { cluster: this.$store.getters['clusterId'] }) : null,
availableCpu: 100,
availableMemory: 100,
showMetricsInfo: false
showMetricsInfo: false,
isStandalone: isStandalone(),
};
},

created() {
this.redoCards();
},

watch: {
namespaces(old, neu) {
if (isEqual(old, neu)) {
Expand All @@ -106,6 +115,7 @@ export default Vue.extend<any, any, any, any>({
this.redoCards();
}
},

methods: {
async calcAvailableResources() {
if (this.$store.getters['isSingleProduct']) {
Expand Down Expand Up @@ -156,6 +166,7 @@ export default Vue.extend<any, any, any, any>({
}
}
},

computed: {
services() {
const fetchServicesInstances: EpinioServiceModel[] = this.$store.getters['epinio/all'](EPINIO_TYPES.SERVICE_INSTANCE);
Expand Down Expand Up @@ -214,16 +225,16 @@ export default Vue.extend<any, any, any, any>({
<div class="dashboard">
<div class="head">
<div class="head-title">
<h1>{{ t('epinio.intro.welcome') }}</h1>
<h1>{{ t('epinio.intro.welcome', {epinio: productName}) }}</h1>
<span v-if="version">{{ version.displayVersion }}</span>
</div>

<p class="head-subheader">
{{ t('epinio.intro.blurb') }}
{{ isStandalone ? t('epinio.intro.blurb.standalone') : t('epinio.intro.blurb.embedded') }}
</p>

<p>
{{ t('epinio.intro.description') }}
{{ t('epinio.intro.description', {epinio: productName}) }}
</p>

<div class="head-links">
Expand Down
9 changes: 6 additions & 3 deletions dashboard/pkg/epinio/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import epinioAuth, { EpinioAuthTypes } from '../utils/auth';
import EpinioCluster, { EpinioInfoPath } from '../models/cluster';
import LoginDialog from '../components/LoginDialog.vue';
import Dialog from '@shell/components/Dialog.vue';
import ProductName from '../mixins/product-name';

interface Data {
clustersSchema: any;
Expand All @@ -23,6 +24,8 @@ export default Vue.extend<Data, any, any, any>({
AsyncButton, Loading, Link, ResourceTable, LoginDialog, Dialog
},

mixins: [ProductName],

layout: 'plain',

async fetch() {
Expand Down Expand Up @@ -149,15 +152,15 @@ export default Vue.extend<Data, any, any, any>({
v-else-if="clusters.length === 0"
class="root"
>
<h2>{{ t('epinio.instances.none.header') }}</h2>
<p>{{ t('epinio.instances.none.description') }}</p>
<h2>{{ t('epinio.instances.none.header', {epinio: productName}) }}</h2>
<p>{{ t('epinio.instances.none.description', {epinio: productName}) }}</p>
</div>
<div
v-else
class="root"
>
<div class="epinios-table">
<h2>{{ t('epinio.instances.header') }}</h2>
<h2>{{ t('epinio.instances.header', {epinio: productName}) }}</h2>
<ResourceTable
:rows="clusters"
:schema="clustersSchema"
Expand Down
3 changes: 2 additions & 1 deletion dashboard/pkg/epinio/routing/epinio-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import CreateEpinioResource from '../pages/c/_cluster/_resource/create.vue';
import ViewEpinioResource from '../pages/c/_cluster/_resource/_id.vue';
import ViewEpinioNsResource from '../pages/c/_cluster/_resource/_namespace/_id.vue';
import AuthVerify from '../pages/auth/verify.vue';
import { isStandalone } from '../utils/utils';

const meta = {
product: EPINIO_PRODUCT_NAME,
Expand Down Expand Up @@ -66,7 +67,7 @@ const routes: RouteConfig[] = [{
meta
}];

const isEpinioSingleProduct = process.env.rancherEnv === 'epinio';
const isEpinioSingleProduct = isStandalone();

if (!isEpinioSingleProduct) {
routes.unshift({
Expand Down
Loading
Loading