-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/hf2/feat/merge-ap-and-agen…
…t' into _V2.4.X/dev_issue#1683_2.4.5_2_2_42
- Loading branch information
Showing
79 changed files
with
6,145 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { request } from '../base'; | ||
|
||
export const listPackage = request('GET', 'api/agent/package/'); | ||
export const listPackageNew = request('POST', 'api/agent/package/search/{{pk}}'); | ||
export const updatePackage = request('PUT', 'api/agent/package/{{pk}}/'); | ||
export const deletePackage = request('DELETE', 'api/agent/package/{{pk}}/'); | ||
export const quickSearchCondition = request('GET', 'api/agent/package/quick_search_condition/'); | ||
export const uploadPackage = request('POST', 'api/agent/package/upload/'); | ||
export const parsePackage = request('POST', 'api/agent/package/parse/'); | ||
export const createAgentRegisterTask = request('POST', 'api/agent/package/create_register_task/'); | ||
export const queryAgentRegisterTask = request('GET', 'api/agent/package/query_register_task/'); | ||
export const getTags = request('GET', 'api/agent/package/tags/'); | ||
export const getVersion = request('POST', 'api/agent/package/version/'); | ||
export const getDeployedHostsCount = request('POST', 'api/agent/package/deployed_hosts_count/'); | ||
export const createAgentTags = request('POST', 'api/agent/package/create_agent_tags/'); | ||
export const versionCompare = request('POST', 'api/agent/package/version_compare/'); | ||
|
||
export default { | ||
listPackage, | ||
updatePackage, | ||
listPackageNew, | ||
deletePackage, | ||
quickSearchCondition, | ||
uploadPackage, | ||
parsePackage, | ||
createAgentRegisterTask, | ||
queryAgentRegisterTask, | ||
getTags, | ||
getVersion, | ||
getDeployedHostsCount, | ||
createAgentTags, | ||
versionCompare, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ref } from 'vue'; | ||
|
||
export default function useFormLabelWidth() { | ||
const minWidth = ref(0); | ||
|
||
const initLabelWidth = (form: Vue) => { | ||
const el = form ? form.$el : null; | ||
if (!el) return; | ||
let max = 0; | ||
const leftPadding = 28; | ||
const safePadding = 8; | ||
const $labelEleList = el.querySelectorAll('.bk-label'); | ||
$labelEleList.forEach((item) => { | ||
const spanEle = item.querySelector('span'); | ||
if (spanEle) { | ||
const { width } = spanEle.getBoundingClientRect(); | ||
max = Math.max(minWidth.value, max, width); | ||
} | ||
}); | ||
const width = Math.ceil(max + leftPadding + safePadding); | ||
$labelEleList.forEach((item) => { | ||
(item as HTMLElement).style.width = `${width}px`; | ||
}); | ||
el.querySelectorAll('.bk-form-content').forEach((item) => { | ||
(item as HTMLElement).style.marginLeft = `${width}px`; | ||
}); | ||
return width; | ||
}; | ||
|
||
return { | ||
minWidth, | ||
initLabelWidth, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.