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

S-mart 应用迭代 #1171

Merged
merged 6 commits into from
Mar 14, 2024
Merged
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: 5 additions & 0 deletions webfe/package_vue/src/assets/css/ps-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1157,3 +1157,8 @@ span.ellipsis {
margin-left: 10px;
}
}

.shadow-card-style {
box-shadow: 0 2px 4px 0 #1919290d;
border-radius: 2px;
}
13 changes: 9 additions & 4 deletions webfe/package_vue/src/components/paas-module-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="module-operate">
<!-- 新增模块 -->
<div
v-bk-tooltips="{ content: $t('当前应用不允许创建其他模块'), disabled: isCreatedModule }"
v-bk-tooltips="{ content: $t(disableTips), disabled: isCreatedModule }"
class="icon-warapper mr8"
:class="{ disabled: !isCreatedModule }"
:title="$t('新增模块')"
Expand Down Expand Up @@ -54,7 +54,7 @@
type="error"
:title="$t('主模块不能删除,删除操作无法撤回,请在删除前与应用其他成员沟通')"
></bk-alert>
<span v-bk-tooltips="{ content: $t('当前应用不允许创建其他模块'), disabled: isCreatedModule }">
<span v-bk-tooltips="{ content: $t(disableTips), disabled: isCreatedModule }">
<bk-button
theme="primary"
:disabled="!isCreatedModule"
Expand Down Expand Up @@ -186,7 +186,7 @@ export default defineComponent({
visiable: false,
isLoading: false,
});
const { curAppInfo } = store.state;
const { curAppInfo, curAppModule } = store.state;

bus.$on('cloud-change-module', (data) => {
active.value = data.params.moduleId;
Expand All @@ -203,6 +203,11 @@ export default defineComponent({
// 是否展示新建模块入口
const isCreatedModule = computed(() => curAppInfo.application?.config_info?.can_create_extra_modules);

const isSmartApp = computed(() => curAppModule.source_origin === vm.proxy.GLOBAL.APP_TYPES.SMART_APP);

// 新建模块禁用提示
const disableTips = computed(() => (isSmartApp.value ? 'S-mart 应用不允许在页面上新建模块' : '当前应用不允许创建其他模块'));

// 切换tab
const handleTabChange = async () => {
const curModule = (props.moduleList || []).find(e => e.name === active.value);
Expand Down Expand Up @@ -260,7 +265,6 @@ export default defineComponent({
appCode: props.appCode,
moduleName: curAppModuleName.value,
});
console.log('vue', vm);
bkMessage({
theme: 'success',
message: '模块删除成功',
Expand Down Expand Up @@ -309,6 +313,7 @@ export default defineComponent({
formRemoveConfirmCode,
localLanguage,
isCreatedModule,
disableTips,
};
},
});
Expand Down
3 changes: 3 additions & 0 deletions webfe/package_vue/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,7 @@ export default {
无权限: 'No permissions',
已申请: 'Applied',
当前应用不允许创建其他模块: 'The current application does not allow the creation of other modules.',
'S-mart 应用不允许在页面上新建模块': 'S-mart applications do not allow creating new modules on the page',
'格式不正确,只能包含:汉字、英文字母、数字、连字符(-),长度小于 20 个字符': 'The format is incorrect and can only contain: Chinese characters, English letters, numbers, hyphens (-), and the length is less than 20 characters',
不能选择已发布过的代码分支: 'Cannot select a code branch that has already been released',
'插件上架后,可在插件市场重新查看该插件的信息': 'After the plug-in is put on the shelves, you can re-check the plug-in information in the plug-in market',
Expand Down Expand Up @@ -2538,4 +2539,6 @@ export default {
去发布: 'To Release',
我发起的测试: 'My Initiated Tests',
'代码分支/代码 Commit/创建人/测试进度': 'Code Branch/Code Commit/Creator/Test Progress',
'S-mart 应用请在配置文件中设置并开启增强服务': 'For S-mart applications, please set and enable enhanced services in the configuration file',
'S-mart 应用暂不支持删除增强服务': 'S-mart applications do not support the deletion of enhanced services for now',
};
3 changes: 3 additions & 0 deletions webfe/package_vue/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,7 @@ export default {
无权限: '无权限',
已申请: '已申请',
当前应用不允许创建其他模块: '当前应用不允许创建其他模块',
'S-mart 应用不允许在页面上新建模块': 'S-mart 应用不允许在页面上新建模块',
'格式不正确,只能包含:汉字、英文字母、数字、连字符(-),长度小于 20 个字符': '格式不正确,只能包含:汉字、英文字母、数字、连字符(-),长度小于 20 个字符',
不能选择已发布过的代码分支: '不能选择已发布过的代码分支',
'插件上架后,可在插件市场重新查看该插件的信息': '插件上架后,可在插件市场重新查看该插件的信息',
Expand Down Expand Up @@ -2680,4 +2681,6 @@ export default {
去发布: '去发布',
我发起的测试: '我发起的测试',
'代码分支/代码 Commit/创建人/测试进度': '代码分支/代码 Commit/创建人/测试进度',
'S-mart 应用请在配置文件中设置并开启增强服务': 'S-mart 应用请在配置文件中设置并开启增强服务',
'S-mart 应用暂不支持删除增强服务': 'S-mart 应用暂不支持删除增强服务',
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="html">
<div class="right-main">
<paas-content-loader
class="app-container middle base-info-container"
class="app-container middle base-info-container shadow-card-style"
:is-loading="isLoading"
placeholder="base-info-loading"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="right-main">

<paas-content-loader
class="app-container middle role-container"
class="app-container middle role-container shadow-card-style"
:is-loading="loading"
placeholder="roles-loading"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,29 @@
<div
class="ps-switcher-wrapper"
@click="toggleSwitch(row, $index)"
v-bk-tooltips="{
content: $t('S-mart 应用请在配置文件中设置并开启增强服务'),
disabled: !isSmartApp
}"
v-if="row.isStartUp">
<bk-switcher
v-model="row.isStartUp"
:theme="row.type === 'shared' ? 'success' : 'primary'"
class="bk-small-switcher"
:disabled="isSmartApp"
/>
</div>
<div
class="ps-switcher-wrapper"
v-else
@click="toggleSwitch(row, $index)"
v-bk-tooltips="switcherTips"
v-bk-tooltips="enableTooltipsConfig"
:ref="`tooltipsHtml${$index}`"
>
<bk-switcher
v-model="row.isStartUp"
class="bk-small-switcher"
:disabled="isSmartApp"
/>
</div>
<div id="switcher-tooltip">
Expand Down Expand Up @@ -381,6 +387,18 @@ export default {
return versionData?.value || '';
};
},
isSmartApp() {
return this.curAppInfo.application?.is_smart_app;
},
enableTooltipsConfig() {
this.switcherTips.disabled = this.isSmartApp;
if (this.isSmartApp) {
return {
content: this.$t('S-mart 应用暂不支持删除增强服务'),
};
}
return this.switcherTips;
},
},
watch: {
curAppCode() {
Expand Down Expand Up @@ -458,6 +476,9 @@ export default {
},

toggleSwitch(payload, index) {
if (this.isSmartApp) {
return;
}
this.curData = payload;
this.curIndex = index;
if (payload.isStartUp) { // 已经启动的状态
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
@close-content-loader="closeContentLoader"
/>
<!-- 镜像信息 -->
<mirror @close-content-loader="closeContentLoader" @set-build-method="setBuildMethod" />
<mirror
v-if="!isSmartApp"
@close-content-loader="closeContentLoader"
@set-build-method="setBuildMethod"
/>
</template>
</paas-content-loader>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="image-container">
<paas-content-loader
class="image-content"
:class="['image-content', { 'bottom-line': curAppInfo?.feature?.ENABLE_IMAGE_APP_BIND_REPO }]"
:is-loading="isLoading"
:is-transition="false"
:offset-top="0"
Expand Down Expand Up @@ -130,9 +130,12 @@ export default {
curAppCode() {
return this.$store.state.curAppCode;
},
curAppInfo() {
return this.$store.state.curAppInfo;
},
},
watch: {
curAppCode() {
appCode() {
this.getCredentialList();
// this.isLoading = true;
},
Expand All @@ -141,6 +144,9 @@ export default {
this.credentialList = value;
},
},
created() {
this.getCredentialList();
},
methods: {

// 获取凭证列表
Expand Down Expand Up @@ -293,6 +299,10 @@ export default {
.image-content {
background: #fff;
padding-top: 0;
&.bottom-line {
margin-bottom: 24px;
border-bottom: 1px solid #eaebf0;
}
}
}
.header-title {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template lang="html">
<div :class="['right-main', { 'packages-wrapper': isCloudNativeApp }]">
<div :class="['right-main',{ 'packages-wrapper': isCloudNativeApp }, { 'bottom-line': !isSmartApp }]">
<app-top-bar
v-if="!isCloudNativeApp"
:title="$t('包版本管理')"
:can-create="canCreateModule"
:cur-module="curAppModule"
:module-list="isLesscodeApp ? curAppModuleList : []"
/>
<div class="title" v-else>{{ $t('源码信息') }}</div>
<div class="title" v-else>{{ isSmartApp ? $t('包版本管理') : $t('源码信息') }}</div>
<paas-content-loader
:is-loading="isPageLoading"
placeholder="packages-loading"
Expand Down Expand Up @@ -299,6 +299,9 @@ export default {
uploadUrl() {
return `${BACKEND_URL}/api/bkapps/applications/${this.appCode}/source_package/stash/`;
},
isSmartApp() {
return this.curAppInfo.application?.is_smart_app;
},
},
watch: {
'$route'() {
Expand Down Expand Up @@ -553,8 +556,10 @@ export default {
margin-top: 2px;
}
.packages-wrapper {
border-bottom: 1px solid #eaebf0;
margin-bottom: 24px;
&.bottom-line {
border-bottom: 1px solid #eaebf0;
}
.title {
font-weight: 700;
font-size: 14px;
Expand Down
14 changes: 14 additions & 0 deletions webfe/package_vue/src/views/dev-center/app/market/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
width: 200px;
}

.market-info-title-wrapper {
span {
font-size: 12px;
color: #979ba5;
margin-left: 18px;
}
}

.logo-uploader {
padding: 18px 0 24px 16px;

Expand Down Expand Up @@ -185,6 +193,12 @@
color: #313238;
word-wrap: break-word;
width: 290px;

&.text-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
/deep/ .bk-form-item .bk-label{
width: 140px !important;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<section v-show="!isDataLoading">
<div class="ps-action-header mark-info">
<div class="ps-action-header mark-info shadow-card-style">
<div class="release-info flex-row align-items-center">
<strong class="release-info-title">{{ $t('发布状态') }}</strong>
<div class="release-info-status">{{ appMarketConfig.enabled ? $t('已发布') : $t('未发布') }}</div>
Expand Down Expand Up @@ -60,7 +60,7 @@
<template v-if="engineAbled">
<div
v-if="!confirmRequiredWhenPublish || isSureRisk || appMarketConfig.enabled"
class="address-info mt15 flex-row align-items-center">
class="address-info mt15 flex-row align-items-center shadow-card-style">
<strong class="address-info-title">{{ $t('访问地址') }}</strong>
<!-- 编辑态 -->
<div class="address-info-url" v-if="isEditAddress">
Expand Down Expand Up @@ -102,7 +102,7 @@
{{ curAddress }}
</div>
<bk-button
class="address-info-btn"
:class="{ 'pl24': curAddress }"
theme="primary"
text
:disabled="isEditDisabled"
Expand Down Expand Up @@ -743,4 +743,7 @@ export default {
.form-input-cls{
position: relative;
}
.pl24 {
padding-left: 24px;
}
</style>
Loading