Skip to content

Commit

Permalink
Merge branch 'master' into node-sass-8-update
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored Dec 9, 2024
2 parents 8c1688a + e2613a9 commit 4446146
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 101 deletions.
4 changes: 1 addition & 3 deletions app/apps-tab/detail/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@
expand=(action expandFn)
expandOnInit=false
}}
{{marked-down
markdown=model.app.notes
}}
{{t "generic.removed" }}
{{/accordion-list-item}}
{{/if}}

Expand Down
4 changes: 2 additions & 2 deletions app/components/new-catalog/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</div>
<div class="col span-8">
{{#if appReadmeContent}}
{{marked-down markdown=appReadmeContent}}
{{t "generic.removed" }}
{{else if (not noAppReadme)}}
<div class="text-center">
<i class="icon icon-spinner icon-spin icon-3x"></i>
Expand Down Expand Up @@ -66,7 +66,7 @@
<div class="row">
{{#if readmeContent}}
<div class="col span-12" style="overflow-y: auto; max-height: 500px;">
{{marked-down markdown=readmeContent}}
{{t "generic.removed" }}
</div>
{{else}}
<h2 class="mb-10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
<div class="col span-8">
{{#if appReadmeContent}}
{{marked-down markdown=appReadmeContent}}
{{t "generic.removed" }}
{{else if (not noAppReadme)}}
<div class="text-center">
<i class="icon icon-spinner icon-spin icon-3x"></i>
Expand Down Expand Up @@ -59,7 +59,7 @@
<div class="row">
{{#if readmeContent}}
<div class="col span-12 readme-content">
{{marked-down markdown=readmeContent}}
{{t "generic.removed" }}
</div>
{{else}}
<h2 class="mb-10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,17 @@ export default Component.extend(ClusterDriver, {
errors: [],
step: 2,
regions: responses.regions.data.filter((region) => (region.status === 'ok' && region.capabilities.includes('Kubernetes'))),
nodeTypes: responses.nodeTypes.data.filter((type) => (['standard', 'highmem', 'dedicated'].includes(type.class))),
nodeTypes: responses.nodeTypes.data.filter(
(type) => (['standard', 'highmem', 'dedicated'].includes(type.class))
).map((type) => {
// We need to set default values for effective prices
return {
...type,
isException: false,
effectiveHourly: type.price.hourly,
effectiveMonthly: type.price.monthly
}
}),
k8sVersions: responses.k8sVersions.data,
});

Expand Down Expand Up @@ -239,8 +249,9 @@ export default Component.extend(ClusterDriver, {
const selectedNodePoolList = get(this, 'selectedNodePoolList');
const nodePools = selectedNodePoolList.map((np) => {
return `${ np.id }=${ np.count }`
})
});

set(this, 'configHasRegionException', selectedNodePoolList.filter((type) => type.isException).length > 0)
set(this, 'cluster.lkeEngineConfig.nodePools', nodePools);
}),

Expand All @@ -249,6 +260,28 @@ export default Component.extend(ClusterDriver, {
this.prefillSelectedNodePoolList();
}),

updateEffectiveTypePrices: observer('cluster.lkeEngineConfig.region', function() {
// We need special handling for regional price exceptions
const nodeTypes = this.nodeTypes.map((type) => {
let override = undefined;

if (type['region_prices'] !== undefined) {
override = type.region_prices.find((override) => override.id === this.cluster.lkeEngineConfig.region);
}

const isException = override !== undefined;

return {
...type,
isException,
effectiveHourly: isException ? override.hourly : type.price.hourly,
effectiveMonthly: isException ? override.monthly : type.price.monthly
}
});

set(this, 'nodeTypes', nodeTypes);
}),

// Any computed properties or custom logic can go here

// for region choises
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@
<div class="acc-label pb-15">
{{t "clusterNew.linodelke.nodePoolConfig.monthly"}}:
</div>
{{format-number this.selectedNodePoolObj.price.monthly style='currency' currency='USD' allowEmpty=true}}
{{format-number this.selectedNodePoolObj.effectiveMonthly style='currency' currency='USD' allowEmpty=true}}
</div>
<div class="col span-1">
<div class="acc-label pb-15">
{{t "clusterNew.linodelke.nodePoolConfig.hourly"}}:
</div>
{{format-number this.selectedNodePoolObj.price.hourly style='currency' currency='USD' allowEmpty=true}}
{{format-number this.selectedNodePoolObj.effectiveHourly style='currency' currency='USD' allowEmpty=true}}
</div>
<div class="col span-1">
<div class="acc-label pb-15">
Expand Down Expand Up @@ -255,6 +255,13 @@
</h2>
</div>
</div>
{{# if this.configHasRegionException}}
{{banner-message
icon="icon-alert"
color="bg-warning mb-10"
message=(t "clusterNew.linodelke.selectedNodePoolType.regionPriceWarning")
}}
{{/if}}
{{#sortable-table
classNames="grid fixed mb-0 sortable-table"
sortBy=sortBy
Expand All @@ -274,10 +281,10 @@
{{member.label}}
</td>
<td data-title="{{dt.priceMonthly}}">
{{format-number member.price.monthly style='currency' currency='USD' allowEmpty=true}}
{{format-number member.effectiveMonthly style='currency' currency='USD' allowEmpty=true}}
</td>
<td data-title="{{dt.priceHourly}}">
{{format-number member.price.hourly style='currency' currency='USD' allowEmpty=true}}
{{format-number member.effectiveHourly style='currency' currency='USD' allowEmpty=true}}
</td>
<td data-title="{{dt.ram}}">
{{member.memoryGb}} {{t "generic.gigabyte"}}
Expand Down
42 changes: 0 additions & 42 deletions lib/shared/addon/components/marked-down/component.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/shared/addon/components/marked-down/template.hbs

This file was deleted.

7 changes: 5 additions & 2 deletions lib/shared/addon/helpers/linkify.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { helper } from '@ember/component/helper';
import { htmlSafe } from '@ember/string';
import Ember from 'ember';
import linkifyStr from 'linkifyjs/string';
import linkifyStr from 'linkify-string';

const MAX_LENGTH = 1000;

Expand All @@ -15,7 +15,10 @@ export function linkify(params) {
content = Ember.Handlebars.Utils.escapeExpression(content);

content = linkifyStr(content, {
attributes: { rel: 'nofollow noreferrer' },
attributes: {
rel: 'nofollow noreferrer',
target: '_blank',
},
defaultProtocol: 'https'
});

Expand Down
1 change: 0 additions & 1 deletion lib/shared/app/components/marked-down/component.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/shared/app/helpers/linkify.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// https://github.com/ef4/ember-browserify#the-workaround
import linkifyStr from 'linkifyjs/string'; // eslint-disable-line no-unused-vars
import linkifyStr from 'linkify-string'; // eslint-disable-line no-unused-vars
export { default } from 'shared/helpers/linkify';
2 changes: 0 additions & 2 deletions lib/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"dependencies": {
"async": "*",
"d3": "*",
"dompurify": "*",
"echarts": "*",
"@rancher/ember-api-store": "*",
"ember-auto-import": "*",
Expand All @@ -27,7 +26,6 @@
"json2yaml": "*",
"jsyaml": "*",
"liquid-fire": "*",
"marked": "*",
"prettycron": "*",
"prismjs": "*",
"semver": "*",
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
"@glimmer/tracking": "^1.0.3",
"@rancher/ember-api-store": "~4.0.0",
"ansi_up": "^5.0.0",
"async": "3.2.0",
"async": "3.2.2",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"d3": "3.5.17",
"dompurify": "^2.1.1",
"dot-object": "^2.1.4",
"dotenv": "^8.2.0",
"echarts": "4.9.0",
Expand Down Expand Up @@ -90,10 +89,10 @@
"js-yaml": "3.14.0",
"json2yaml": "^1.1.0",
"jsondiffpatch": "^0.4.1",
"linkifyjs": "^2.1.9",
"linkifyjs": "^4.1.3",
"linkify-string": "^4.1.3",
"loader.js": "^4.7.0",
"marked": "^2.0.0",
"moment": "~2.29.0",
"moment": "~2.29.4",
"node-sass": "8.0.0",
"objects-to-csv": "^1.3.5",
"prettycron": "^0.10.0",
Expand Down
6 changes: 4 additions & 2 deletions translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ generic:
persistentVolume: persistent volume
random: Random
remove: Remove
removed: Functionality has been removed from the legacy UI
restarts: Restarts
role: Role
save: Save
Expand Down Expand Up @@ -3347,7 +3348,7 @@ clusterNew:
fleet: Fleet Agent Configuration
accordionDetail:
cluster: Customize scheduling fields and resource limits for the Rancher cluster agent
fleet: Customize scheduling fields and resource limits for the Rancher fleet agent
fleet: Customize scheduling fields and resource limits for the Rancher fleet agent
banners:
advanced: These are advanced configuration options. Generally, they should be left as-is.
resourceRequests: Pod Requests and Limits do not have a default configuration.
Expand Down Expand Up @@ -3621,7 +3622,7 @@ clusterNew:
parsedDockerBridgeCidr: Docker bridge address can not overlap with the selected Virtual Network or the Kubernetes service address range
parsedServiceCidr: Kubernetes service address range must fall within the selected Virtual Network range.
serviceCidr: Kubernetes service address range must be valid CIDR format.
nodeResourceGroup:
nodeResourceGroup:
length: "{key} name cannot exceed 80 characters."
chars: "{key} name may only consist of underscores, periods, hyphens, parentheses, and letters or digits."
periodEnd: "{key} name cannot end with a period."
Expand Down Expand Up @@ -4396,6 +4397,7 @@ clusterNew:
selectedNodePoolType:
label: Select type
placeholder: Select a node pool type
regionPriceWarning: One or more node pools in this configuration are subject to region-specific pricing. These prices are reflected in the displayed configuration below.
shortLabel: Linode LKE
tags:
label: Tags
Expand Down
Loading

0 comments on commit 4446146

Please sign in to comment.