Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#7380 from normal-wls/hb_merge_master
Browse files Browse the repository at this point in the history
minor: hb merge master
  • Loading branch information
normal-wls authored Mar 11, 2024
2 parents 99cc4e8 + e13003a commit c8333da
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 71 deletions.
2 changes: 1 addition & 1 deletion app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ is_use_celery: True
author: 蓝鲸智云
introduction: 标准运维是通过一套成熟稳定的任务调度引擎,把在多系统间的工作整合到一个流程,助力运维实现跨系统调度自动化的SaaS应用。
introduction_en: SOPS is a SaaS application that utilizes a set of mature and stable task scheduling engines to help realize cross-system scheduling automation, and integrates the work among multiple systems into a single process.
version: 3.32.0-alpha3
version: 3.32.0-alpha4
category: 运维工具
language_support: 中文
desktop:
Expand Down
2 changes: 1 addition & 1 deletion app_desc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spec_version: 2
app_version: "3.32.0-alpha3"
app_version: "3.32.0-alpha4"
app:
region: default
bk_app_code: bk_sops
Expand Down
5 changes: 4 additions & 1 deletion config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
# mako模板中:<script src="/a.js?v=${ STATIC_VERSION }"></script>
# 如果静态资源修改了以后,上线前改这个版本号即可

STATIC_VERSION = "3.32.0-alpha3"
STATIC_VERSION = "3.32.0-alpha4"
DEPLOY_DATETIME = datetime.datetime.now().strftime("%Y%m%d%H%M%S")

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
Expand Down Expand Up @@ -845,6 +845,9 @@ def check_engine_admin_permission(request, *args, **kwargs):
REMOTE_PLUGIN_FIX_INTERVAL_CODES = env.REMOTE_PLUGIN_FIX_INTERVAL_CODES
REMOTE_PLUGIN_FIX_INTERVAL = env.REMOTE_PLUGIN_FIX_INTERVAL

# 通知中心
BK_NOTICE = {"BK_API_URL_TMPL": env.BK_APIGW_URL_TMPL or ""}

# 支持限制接口的 app
ALLOWED_LIMITED_API_APPS = env.ALLOWED_LIMITED_API_APPS

Expand Down
1 change: 1 addition & 0 deletions frontend/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@blueking/bkcharts": "^2.0.11-alpha.5",
"@blueking/bkui-form": "0.0.41",
"@blueking/crypto-js-sdk": "0.0.5",
"@blueking/notice-component-vue2": "^2.0.1",
"@blueking/user-selector": "^1.0.5-beta.2",
"@vue/babel-preset-jsx": "^1.3.0",
"ajv": "^6.10.2",
Expand Down
31 changes: 27 additions & 4 deletions frontend/desktop/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
*/
<template>
<div id="app">
<navigation v-if="!hideHeader">
<notice-component
v-if="enableNoticeCenter"
:api-url="apiUrl"
@show-alert-change="hasAlertNotice = $event"
/>
<navigation v-if="!hideHeader" :class="['sops-layout-navigation', { 'with-system-notice': hasAlertNotice }]">
<template slot="page-content">
<div class="main-container">
<div :class="['main-container', { 'with-system-notice': hasAlertNotice }]">
<router-view v-if="isRouterViewShow"></router-view>
</div>
<bk-exception v-if="isProjectDisabled" class="project-exception-wrap" type="404">
Expand All @@ -30,7 +35,7 @@
</template>
</navigation>
<template v-else>
<div class="main-container">
<div :class="['main-container', { 'with-system-notice': hasAlertNotice }]">
<router-view v-if="isRouterViewShow"></router-view>
</div>
<bk-exception v-if="isProjectDisabled" class="project-exception-wrap" type="404">
Expand Down Expand Up @@ -60,14 +65,17 @@
import ErrorCodeModal from '@/components/common/modal/ErrorCodeModal.vue'
import PermissionModal from '@/components/common/modal/PermissionModal.vue'
import permissionApply from '@/components/layout/permissionApply.vue'
import NoticeComponent from '@blueking/notice-component-vue2'
import '@blueking/notice-component-vue2/dist/style.css'
export default {
name: 'App',
components: {
Navigation,
ErrorCodeModal,
permissionApply,
PermissionModal
PermissionModal,
NoticeComponent
},
mixins: [permission],
provide () {
Expand All @@ -77,6 +85,9 @@
},
data () {
return {
enableNoticeCenter: window.ENABLE_NOTICE_CENTER,
apiUrl: `${window.SITE_URL}notice/announcements/`,
hasAlertNotice: false,
footerLoading: false,
permissinApplyShow: false,
permissionData: {
Expand Down Expand Up @@ -366,9 +377,21 @@
overflow: hidden;
}
#app {
.sops-layout-navigation.with-system-notice {
height: calc(100vh - 40px);
.container-content {
max-height: calc(100vh - 92px)!important;
}
.nav-slider-list {
height: calc(100vh - 148px) !important;
}
}
.main-container {
width: 100%;
height: calc(100vh - 52px);
&.with-system-notice {
height: calc(100vh - 92px);
}
}
}
.interface-exception-notify-message {
Expand Down
2 changes: 2 additions & 0 deletions frontend/desktop/src/assets/html/index-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
var APP_CODE = 'bk_sops';
var FILE_UPLOAD_ENTRY = '/package/upload/';
var MAX_NODE_EXECUTE_TIMEOUT = 6000;
// 是否开启通知中心
var ENABLE_NOTICE_CENTER = true
function getCookie(name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
return (arr = document.cookie.match(reg)) ? unescape(arr[2]) : null;
Expand Down
2 changes: 2 additions & 0 deletions frontend/desktop/src/assets/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
var BK_DOMAIN = '{{BK_DOMAIN}}';
var BK_PAAS_ESB_HOST = '{{BK_PAAS_ESB_HOST}}'
var TASK_LIST_STATUS_FILTER_DAYS = {{TASK_LIST_STATUS_FILTER_DAYS}}
// 是否开启通知中心
var ENABLE_NOTICE_CENTER = {{ENABLE_NOTICE_CENTER}}
var MESSAGE_HELPER_URL = '{{MESSAGE_HELPER_URL}}'
function getCookie(name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@
background: #f0f1f5;
cursor: pointer;
border: none;
user-select: auto;
&:hover {
background: #eaebf0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
cursor: pointer;
white-space: nowrap;
border: none;
user-select: auto;
&:hover {
background: #eaebf0;
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/desktop/src/pages/admin/manage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@
@import '@/scss/mixins/scrollbar.scss';
.page-manage {
height: calc(100vh - 52px);
height: 100%;
display: flex;
flex-direction: column;
background: #f4f7fa;
.page-manage-content {
height: 100%;
overflow: auto;
@include scrollbar;
&.has-nav {
height: calc(100vh - 100px);
flex: 1;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/desktop/src/pages/admin/statistics/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@
@import '@/scss/mixins/scrollbar.scss';
.page-statistics {
height: calc(100vh - 52px);
height: 100%;
display: flex;
flex-direction: column;
background: #f4f7fa;
.statistics-content {
padding: 20px 24px;
Expand Down
7 changes: 5 additions & 2 deletions frontend/desktop/src/pages/task/TaskCreate/TaskParamFill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
}
try {
const taskData = await this.createTask(data)
if (this.isSelectFunctionalType || this.$route.name === 'functionTemplateStep') {
if (this.isSelectFunctionalType) {
const h = this.$createElement
const self = this
const functionClaimMsg = this.$bkMessage({
Expand Down Expand Up @@ -615,7 +615,10 @@
.param-fill-wrapper {
position: relative;
height: calc(100vh - 101px);
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
background: #fff;
}
.form-area {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@
@import '@/scss/config.scss';
.select-node-wrapper {
height: calc(100vh - 101px);
flex: 1;
}
.task-create-page {
.canvas-content {
Expand Down
8 changes: 7 additions & 1 deletion frontend/desktop/src/pages/task/TaskCreate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@
</script>
<style lang="scss" scoped>
.task-create-container {
height: calc(100vh - 52px);
display: flex;
flex-direction: column;
height: 100%;
margin-top: -1px;
.task-create-header {
flex-shrink: 0;
}
}
</style>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@
type: 'add',
id: this.nodeId,
key: variableKey,
tagCode: this.hookingVarForm
tagCode: this.hookingVarForm,
reuse: true
}
this.formData[this.hookingVarForm] = variableKey
this.$emit('hookChange', 'reuse', config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,9 @@
if (!constant) return
const sourceInfo = constant.source_info
if (type === 'add') {
if (data.reuse) { // 是否为复用变量
constant.reuse = true
}
if (sourceInfo[id]) {
sourceInfo[id].push(tagCode)
} else {
Expand Down Expand Up @@ -1619,6 +1622,11 @@
// 更新子流程已勾选的变量值
Object.keys(this.localConstants).forEach(key => {
const constantValue = this.localConstants[key]
// 复用变量不去更新变量配置和值
if (constantValue.reuse) {
delete constantValue.reuse
return
}
// 根据source_info中获取勾选的表单项code
const [formCode] = constantValue.source_info[this.nodeId] || []
if (!formCode) return
Expand Down
2 changes: 2 additions & 0 deletions frontend/desktop/src/pages/template/TemplateEdit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1976,6 +1976,8 @@
}
.pipeline-canvas-wrapper {
height: 100%;
display: flex;
flex-direction: column;
}
.template-canvas {
position: relative;
Expand Down
5 changes: 5 additions & 0 deletions gcloud/apigw/views/get_task_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def get_task_status(request, task_id, project_id):
"auto_retry_nodes": auto_retry_waiting_nodes,
}
except Exception as e:
logger.error(
"task[id={task_id}] extract failed node info error, get_task_status result: {result}".format(
task_id=task_id, result=result
)
)
message = "task[id={task_id}] extract failed node info error: {error}".format(task_id=task_id, error=e)
logger.exception(message)
return {
Expand Down
6 changes: 3 additions & 3 deletions gcloud/taskflow3/domains/node_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"""
import json
import logging
from urllib.parse import urlencode
from abc import ABCMeta, abstractmethod
from urllib.parse import urlencode

import requests
from django.conf import settings
Expand All @@ -38,7 +38,8 @@ def __init__(self):
),
"Content-Type": "application/json",
}
self.private_token = settings.PAASV3_APIGW_API_TOKEN
if settings.PAASV3_APIGW_API_TOKEN:
self.headers["Authorization"] = f"Bearer {settings.PAASV3_APIGW_API_TOKEN}"

def fetch_node_logs(self, node_id, version_id, *args, **kwargs):
page, page_size = kwargs.get("page", 1), kwargs.get("page_size", 30)
Expand All @@ -47,7 +48,6 @@ def fetch_node_logs(self, node_id, version_id, *args, **kwargs):
"page_size": page_size,
"log_type": "STRUCTURED",
"time_range": "7d",
"private_token": self.private_token,
}
url = self.url.rstrip("/") + f"/?{urlencode(url_params)}"
payload = {"query": {"query_string": f"json.node_id:{node_id} AND json.version:{version_id}"}}
Expand Down
25 changes: 4 additions & 21 deletions pipeline_plugins/components/collections/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class PauseService(Service):
def execute(self, data, parent_data):
task_id: int = parent_data.get_one_of_inputs("task_id")
send_taskflow_message.delay(
task_id=task_id,
msg_type=PENDING_PROCESSING,
use_root=True,
task_id=task_id, msg_type=PENDING_PROCESSING, use_root=True,
)
return True

Expand All @@ -53,10 +51,7 @@ def schedule(self, data, parent_data, callback_data=None):
def inputs_format(self):
return [
self.InputItem(
name=_("描述"),
key="description",
type="string",
schema=StringItemSchema(description=_("描述")),
name=_("描述"), key="description", type="string", schema=StringItemSchema(description=_("描述")),
)
]

Expand All @@ -66,10 +61,7 @@ def outputs_format(self):
name=_("API回调数据"),
key="callback_data",
type="object",
schema=ObjectItemSchema(
description=_("通过node_callback API接口回调并传入数据,支持dict数据"),
property_schemas={},
),
schema=ObjectItemSchema(description=_("通过node_callback API接口回调并传入数据,支持dict数据"), property_schemas={},),
),
]

Expand All @@ -87,16 +79,7 @@ class SleepTimerService(Service):
interval = StaticIntervalGenerator(0)
BK_TIMEMING_TICK_INTERVAL = int(os.getenv("BK_TIMEMING_TICK_INTERVAL", 60 * 60 * 24))
# 匹配年月日 时分秒 正则 yyyy-MM-dd HH:mm:ss
date_regex = re.compile(
r"%s %s"
% (
r"^(((\d{3}[1-9]|\d{2}[1-9]\d{1}|\d{1}[1-9]\d{2}|[1-9]\d{3}))|"
r"(29/02/((\d{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))))-"
r"((0[13578]|1[02])-((0[1-9]|[12]\d|3[01]))|"
r"((0[469]|11)-(0[1-9]|[12]\d|30))|(02)-(0[1-9]|[1]\d|2[0-8]))",
r"((0|[1])\d|2[0-3]):(0|[1-5])\d:(0|[1-5])\d$",
)
)
date_regex = re.compile(r"%s %s" % (r"^\d{4}-\d{2}-\d{2}", r"((0|[1])\d|2[0-3]):(0|[1-5])\d:(0|[1-5])\d$"))

seconds_regex = re.compile(r"^\d+$")

Expand Down
Loading

0 comments on commit c8333da

Please sign in to comment.