Skip to content

Commit

Permalink
Merge pull request #7513 from GuoLiBin6/feat/glb-master-feature
Browse files Browse the repository at this point in the history
feat: 增加功能选择内容
  • Loading branch information
GuoLiBin6 authored Jan 16, 2025
2 parents 8278120 + e6a4f29 commit 1c41d6e
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/assets/images/features/app_store.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/features/bastion_host.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/features/business_feature.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/features/extdb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/images/features/monitor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/features/suggestion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/components/FeatureSelector/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<license-features v-model="items" :pre-item-check="PreItemCheck" :pre-item-filter="PreItemFilter">
<license-features ref="licenseFeatures" v-model="items" :pre-item-check="PreItemCheck" :pre-item-filter="PreItemFilter">
<template #default="{moduleGroups, itemEvents, groupEvents}">
<div>
<div v-for="mod in moduleGroups" :key="mod.key">
Expand Down Expand Up @@ -182,6 +182,9 @@ export const LicenseFeatures = {
},
},
methods: {
changeSelectedItems (items) {
this.selectedItems = this._selectedItems([...items])
},
_groupLicenseDisabled (currentItems) {
return currentItems.every(item => item.licenseDisabled)
},
Expand Down Expand Up @@ -309,6 +312,12 @@ export default {
this.$emit('change', [...this.items])
},
},
methods: {
changeItems (val) {
this.items = val
this.$refs.licenseFeatures.changeSelectedItems(val)
},
},
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/assets/app_store.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 47 additions & 6 deletions src/constants/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,25 @@ const LicenseItems = [
},
{
key: 'monitor',
meta: meta('monitor', '', false),
meta: meta('resource_managent', 'monitor', false),
},
{
key: 'appstore',
origin_key: 'app_store',
meta: meta('resource_managent', 'monitor', false),
},
{
key: 'report',
meta: meta('resource_managent', 'monitor', false),
},
{
key: 'extdb',
meta: meta('resource_managent', 'monitor', false),
},
{
key: 'bastionhost',
origin_key: 'bastion_host',
meta: meta('resource_managent', 'monitor', false),
},
{
key: 'bill_aliyun',
Expand Down Expand Up @@ -260,9 +278,32 @@ const LicenseItems = [
origin_key: 'volcengine',
meta: meta('resource_managent', 'bill', true),
},
{
key: 'bill_ksyun',
origin_key: 'ksyun',
meta: meta('resource_managent', 'bill', true),
},
{
key: 'bill_kubernetes',
origin_key: 'k8s',
meta: meta('resource_managent', 'bill', false),
},
{
key: 'bill_extdb',
origin_key: 'extdb',
meta: meta('resource_managent', 'bill', false),
},
{
key: 'suggestion',
meta: meta('resource_managent', 'bill', false),
},
{
key: 'auth',
meta: meta('auth', '', false),
meta: meta('resource_managent', 'auth', false),
},
{
key: 'business_feature',
meta: meta('resource_managent', 'auth', false),
},
{
key: 'baidu',
Expand Down Expand Up @@ -292,10 +333,10 @@ const LicenseItems = [
key: 'sangfor',
meta: meta('resource_managent', 'private', true),
},
{
key: 'report',
meta: meta('resource_managent', 'report', false),
},
// {
// key: 'report',
// meta: meta('resource_managent', 'report', false),
// },
]

function fullfillLicenseItems () {
Expand Down
7 changes: 7 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5364,13 +5364,20 @@
"license.feature.bill": "Cost",
"license.feature.auth": "IAM",
"license.feature.report": "Report",
"license.feature.app_store": "App Market",
"license.feature.extdb": "@:cloudPrvidersMap.extdb",
"license.feature.bastion_host": "Fortress Machine",
"license.feature.suggestion": "Optimization Suggestions",
"license.feature.business_feature": "Business Feature",
"license.group.onecloud": "Built-in @:dictionary.private_env Platform",
"license.group.public": "@:scope.text_75",
"license.group.private": "@:scope.text_76",
"license.group.storage": "@:scope.text_77",
"license.group.container": "@:scope.text_78",
"license.group.bill": "Bill Management",
"license.group.report": "Report",
"license.group.auth": "Certification Management",
"license.group.monitor": "Monitoring Operation",
"license.group.default": "",
"scope.auth.login": "Sign in",
"scope.auth.username.placeholder": "User",
Expand Down
7 changes: 7 additions & 0 deletions src/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -5382,13 +5382,20 @@
"license.feature.bill": "コストの最適化",
"license.feature.auth": "認定されたセキュリティ",
"license.feature.report": "レポート#レポート#",
"license.feature.app_store": "アプリケーション市場",
"license.feature.extdb": "@:cloudPrvidersMap.extdb",
"license.feature.bastion_host": "バリアマシン統合",
"license.feature.suggestion": "最適化案",
"license.feature.business_feature": "企業特性",
"license.group.onecloud": "組み込みの@:dictionary.private_envプラットフォーム",
"license.group.public": "@:scope.text_75",
"license.group.private": "@:scope.text_76",
"license.group.storage": "@:scope.text_77",
"license.group.container": "@:scope.text_78",
"license.group.bill": "費用管理",
"license.group.report": "レポート#レポート#",
"license.group.auth": "認証管理",
"license.group.monitor": "監視運維",
"license.group.default": "",
"scope.auth.login": "ユーザーがログオンします",
"scope.auth.username.placeholder": "ユーザー名を入力してください",
Expand Down
7 changes: 7 additions & 0 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5385,13 +5385,20 @@
"license.feature.bill": "费用优化",
"license.feature.auth": "认证安全",
"license.feature.report": "报表",
"license.feature.app_store": "应用市场",
"license.feature.extdb": "@:cloudPrvidersMap.extdb",
"license.feature.bastion_host": "堡垒机集成",
"license.feature.suggestion": "优化建议",
"license.feature.business_feature": "企业特性",
"license.group.onecloud": "内置@:dictionary.private_env平台",
"license.group.public": "@:scope.text_75",
"license.group.private": "@:scope.text_76",
"license.group.storage": "@:scope.text_77",
"license.group.container": "@:scope.text_78",
"license.group.bill": "费用管理",
"license.group.report": "报表",
"license.group.auth": "认证管理",
"license.group.monitor": "监控运维",
"license.group.default": "",
"scope.auth.login": "用户登录",
"scope.auth.username.placeholder": "请输入用户名",
Expand Down
6 changes: 3 additions & 3 deletions src/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@ export const hasMeterService = function () {
return false
}

export const billSupportBrands = ['aliyun', 'aws', 'azure', 'google', 'huawei', 'jdcloud', 'qcloud', 'volcengine']
export const billSupportBrands = ['aliyun', 'aws', 'azure', 'google', 'huawei', 'jdcloud', 'qcloud', 'volcengine', 'ksyun']

export const billItems = billSupportBrands.map(key => `bill_${key}`)

export const fillBillSupportFeatures = (data = [], fillOriginBrand = false) => {
const list = [...data]
const billItems = billSupportBrands.map(key => `bill_${key}`)

const billTargetItems = list.filter(key => billItems.includes(key))
// 旧版本只签发bill,新版本签发bill与billItem
// 旧版本 有费用模块
Expand Down

0 comments on commit 1c41d6e

Please sign in to comment.