@next-libs/cmdb-instances 7.20.4 → 7.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/instance-detail/components/instances-attachment-display/instances-attachment-display.js +1 -1
- package/dist/cjs/instance-detail/components/instances-attachment-display/instances-attachment-display.js.map +1 -1
- package/dist/esm/instance-detail/components/instances-attachment-display/instances-attachment-display.js +1 -1
- package/dist/esm/instance-detail/components/instances-attachment-display/instances-attachment-display.js.map +1 -1
- package/package.json +2 -2
|
@@ -27,7 +27,7 @@ function InstancesAttachmentDisplay(props) {
|
|
|
27
27
|
// 预览
|
|
28
28
|
const handlePreview = file => {
|
|
29
29
|
const domain = `${window.location.origin}/next`;
|
|
30
|
-
const url = `${domain}/${file.url}`;
|
|
30
|
+
const url = `${domain}/${file.url}?fileName=${file.name}`;
|
|
31
31
|
const previewUrl = `${domain}/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=${encodeURIComponent(_jsBase.Base64.encode(url)
|
|
32
32
|
// window.btoa(url)
|
|
33
33
|
)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances-attachment-display.js","names":["InstancesAttachmentDisplay","props","value","handleDownload","file","domain","window","location","origin","link","document","createElement","href","url","download","name","body","appendChild","click","removeChild","handlePreview","previewUrl","encodeURIComponent","Base64","encode","open","map","isPreview","FileUtils","sizeCompare","supportFileType","id","styles","attachmentItem","marginRight","attachmentText","attachmentSpan","attachmentIconItem"],"sources":["../../../../../src/instance-detail/components/instances-attachment-display/instances-attachment-display.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n EyeOutlined,\n DownloadOutlined,\n FileTextOutlined,\n} from \"@ant-design/icons\";\nimport { Base64 } from \"js-base64\";\nimport { FileUtils } from \"@next-libs/cmdb-utils\";\nimport styles from \"./instances-attachment-display.module.css\";\n\ninterface InstancesAttachmentDisplayProps {\n value?: Record<string, any>[];\n}\n\nexport function InstancesAttachmentDisplay(\n props: InstancesAttachmentDisplayProps\n): React.ReactElement {\n const { value } = props;\n // 下载\n const handleDownload = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const link = document.createElement(\"a\");\n link.href = `${domain}/${file.url}`;\n link.download = file.name;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n // 预览\n const handlePreview = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const url = `${domain}/${file.url}`;\n const previewUrl = `${domain}/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=${encodeURIComponent(\n Base64.encode(url)\n // window.btoa(url)\n )}`;\n window.open(previewUrl, \"_blank\");\n };\n return (\n <>\n {value?.map((file: any) => {\n // 是否支持预览\n const isPreview =\n !FileUtils.sizeCompare(file, 100) && FileUtils.supportFileType(file);\n return (\n <div key={file.id} className={styles.attachmentItem}>\n <span>\n <FileTextOutlined style={{ marginRight: \"6px\" }} />\n <span className={styles.attachmentText}>{file.name}</span>\n </span>\n <span className={styles.attachmentSpan}>\n {isPreview && (\n <EyeOutlined\n className={styles.attachmentIconItem}\n onClick={() => handlePreview(file)}\n />\n )}\n <DownloadOutlined\n className={styles.attachmentIconItem}\n onClick={() => handleDownload(file)}\n />\n </span>\n </div>\n );\n })}\n </>\n );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AAKA;AACA;AACA;AAMO,SAASA,0BAA0B,CACxCC,KAAsC,EAClB;EACpB,MAAM;IAAEC;EAAM,CAAC,GAAGD,KAAK;EACvB;EACA,MAAME,cAAc,GAAIC,IAAS,IAAW;IAC1C,MAAMC,MAAM,GAAI,GAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,OAAM;IAC/C,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,GAAG,CAAC;IACxCF,IAAI,CAACG,IAAI,GAAI,GAAEP,MAAO,IAAGD,IAAI,CAACS,GAAI,EAAC;IACnCJ,IAAI,CAACK,QAAQ,GAAGV,IAAI,CAACW,IAAI;IACzBL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAACR,IAAI,CAAC;IAC/BA,IAAI,CAACS,KAAK,EAAE;IACZR,QAAQ,CAACM,IAAI,CAACG,WAAW,CAACV,IAAI,CAAC;EACjC,CAAC;EACD;EACA,MAAMW,aAAa,GAAIhB,IAAS,IAAW;IACzC,MAAMC,MAAM,GAAI,GAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,OAAM;IAC/C,MAAMK,GAAG,GAAI,GAAER,MAAO,IAAGD,IAAI,CAACS,GAAI,EAAC;
|
|
1
|
+
{"version":3,"file":"instances-attachment-display.js","names":["InstancesAttachmentDisplay","props","value","handleDownload","file","domain","window","location","origin","link","document","createElement","href","url","download","name","body","appendChild","click","removeChild","handlePreview","previewUrl","encodeURIComponent","Base64","encode","open","map","isPreview","FileUtils","sizeCompare","supportFileType","id","styles","attachmentItem","marginRight","attachmentText","attachmentSpan","attachmentIconItem"],"sources":["../../../../../src/instance-detail/components/instances-attachment-display/instances-attachment-display.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n EyeOutlined,\n DownloadOutlined,\n FileTextOutlined,\n} from \"@ant-design/icons\";\nimport { Base64 } from \"js-base64\";\nimport { FileUtils } from \"@next-libs/cmdb-utils\";\nimport styles from \"./instances-attachment-display.module.css\";\n\ninterface InstancesAttachmentDisplayProps {\n value?: Record<string, any>[];\n}\n\nexport function InstancesAttachmentDisplay(\n props: InstancesAttachmentDisplayProps\n): React.ReactElement {\n const { value } = props;\n // 下载\n const handleDownload = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const link = document.createElement(\"a\");\n link.href = `${domain}/${file.url}`;\n link.download = file.name;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n // 预览\n const handlePreview = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const url = `${domain}/${file.url}?fileName=${file.name}`;\n const previewUrl = `${domain}/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=${encodeURIComponent(\n Base64.encode(url)\n // window.btoa(url)\n )}`;\n window.open(previewUrl, \"_blank\");\n };\n return (\n <>\n {value?.map((file: any) => {\n // 是否支持预览\n const isPreview =\n !FileUtils.sizeCompare(file, 100) && FileUtils.supportFileType(file);\n return (\n <div key={file.id} className={styles.attachmentItem}>\n <span>\n <FileTextOutlined style={{ marginRight: \"6px\" }} />\n <span className={styles.attachmentText}>{file.name}</span>\n </span>\n <span className={styles.attachmentSpan}>\n {isPreview && (\n <EyeOutlined\n className={styles.attachmentIconItem}\n onClick={() => handlePreview(file)}\n />\n )}\n <DownloadOutlined\n className={styles.attachmentIconItem}\n onClick={() => handleDownload(file)}\n />\n </span>\n </div>\n );\n })}\n </>\n );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AAKA;AACA;AACA;AAMO,SAASA,0BAA0B,CACxCC,KAAsC,EAClB;EACpB,MAAM;IAAEC;EAAM,CAAC,GAAGD,KAAK;EACvB;EACA,MAAME,cAAc,GAAIC,IAAS,IAAW;IAC1C,MAAMC,MAAM,GAAI,GAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,OAAM;IAC/C,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,GAAG,CAAC;IACxCF,IAAI,CAACG,IAAI,GAAI,GAAEP,MAAO,IAAGD,IAAI,CAACS,GAAI,EAAC;IACnCJ,IAAI,CAACK,QAAQ,GAAGV,IAAI,CAACW,IAAI;IACzBL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAACR,IAAI,CAAC;IAC/BA,IAAI,CAACS,KAAK,EAAE;IACZR,QAAQ,CAACM,IAAI,CAACG,WAAW,CAACV,IAAI,CAAC;EACjC,CAAC;EACD;EACA,MAAMW,aAAa,GAAIhB,IAAS,IAAW;IACzC,MAAMC,MAAM,GAAI,GAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,OAAM;IAC/C,MAAMK,GAAG,GAAI,GAAER,MAAO,IAAGD,IAAI,CAACS,GAAI,aAAYT,IAAI,CAACW,IAAK,EAAC;IACzD,MAAMM,UAAU,GAAI,GAAEhB,MAAO,qEAAoEiB,kBAAkB,CACjHC,cAAM,CAACC,MAAM,CAACX,GAAG;IACjB;IAAA,CACA,EAAC;IACHP,MAAM,CAACmB,IAAI,CAACJ,UAAU,EAAE,QAAQ,CAAC;EACnC,CAAC;EACD,oBACE,4DACGnB,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEwB,GAAG,CAAEtB,IAAS,IAAK;IACzB;IACA,MAAMuB,SAAS,GACb,CAACC,oBAAS,CAACC,WAAW,CAACzB,IAAI,EAAE,GAAG,CAAC,IAAIwB,oBAAS,CAACE,eAAe,CAAC1B,IAAI,CAAC;IACtE,oBACE;MAAK,GAAG,EAAEA,IAAI,CAAC2B,EAAG;MAAC,SAAS,EAAEC,yCAAM,CAACC;IAAe,gBAClD,wDACE,6BAAC,uBAAgB;MAAC,KAAK,EAAE;QAAEC,WAAW,EAAE;MAAM;IAAE,EAAG,eACnD;MAAM,SAAS,EAAEF,yCAAM,CAACG;IAAe,GAAE/B,IAAI,CAACW,IAAI,CAAQ,CACrD,eACP;MAAM,SAAS,EAAEiB,yCAAM,CAACI;IAAe,GACpCT,SAAS,iBACR,6BAAC,kBAAW;MACV,SAAS,EAAEK,yCAAM,CAACK,kBAAmB;MACrC,OAAO,EAAE,MAAMjB,aAAa,CAAChB,IAAI;IAAE,EAEtC,eACD,6BAAC,uBAAgB;MACf,SAAS,EAAE4B,yCAAM,CAACK,kBAAmB;MACrC,OAAO,EAAE,MAAMlC,cAAc,CAACC,IAAI;IAAE,EACpC,CACG,CACH;EAEV,CAAC,CAAC,CACD;AAEP"}
|
|
@@ -20,7 +20,7 @@ export function InstancesAttachmentDisplay(props) {
|
|
|
20
20
|
// 预览
|
|
21
21
|
var handlePreview = file => {
|
|
22
22
|
var domain = "".concat(window.location.origin, "/next");
|
|
23
|
-
var url = "".concat(domain, "/").concat(file.url);
|
|
23
|
+
var url = "".concat(domain, "/").concat(file.url, "?fileName=").concat(file.name);
|
|
24
24
|
var previewUrl = "".concat(domain, "/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=").concat(encodeURIComponent(Base64.encode(url)
|
|
25
25
|
// window.btoa(url)
|
|
26
26
|
));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances-attachment-display.js","names":["React","EyeOutlined","DownloadOutlined","FileTextOutlined","Base64","FileUtils","styles","InstancesAttachmentDisplay","props","value","handleDownload","file","domain","window","location","origin","link","document","createElement","href","url","download","name","body","appendChild","click","removeChild","handlePreview","previewUrl","encodeURIComponent","encode","open","map","isPreview","sizeCompare","supportFileType","id","attachmentItem","marginRight","attachmentText","attachmentSpan","attachmentIconItem"],"sources":["../../../../../src/instance-detail/components/instances-attachment-display/instances-attachment-display.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n EyeOutlined,\n DownloadOutlined,\n FileTextOutlined,\n} from \"@ant-design/icons\";\nimport { Base64 } from \"js-base64\";\nimport { FileUtils } from \"@next-libs/cmdb-utils\";\nimport styles from \"./instances-attachment-display.module.css\";\n\ninterface InstancesAttachmentDisplayProps {\n value?: Record<string, any>[];\n}\n\nexport function InstancesAttachmentDisplay(\n props: InstancesAttachmentDisplayProps\n): React.ReactElement {\n const { value } = props;\n // 下载\n const handleDownload = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const link = document.createElement(\"a\");\n link.href = `${domain}/${file.url}`;\n link.download = file.name;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n // 预览\n const handlePreview = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const url = `${domain}/${file.url}`;\n const previewUrl = `${domain}/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=${encodeURIComponent(\n Base64.encode(url)\n // window.btoa(url)\n )}`;\n window.open(previewUrl, \"_blank\");\n };\n return (\n <>\n {value?.map((file: any) => {\n // 是否支持预览\n const isPreview =\n !FileUtils.sizeCompare(file, 100) && FileUtils.supportFileType(file);\n return (\n <div key={file.id} className={styles.attachmentItem}>\n <span>\n <FileTextOutlined style={{ marginRight: \"6px\" }} />\n <span className={styles.attachmentText}>{file.name}</span>\n </span>\n <span className={styles.attachmentSpan}>\n {isPreview && (\n <EyeOutlined\n className={styles.attachmentIconItem}\n onClick={() => handlePreview(file)}\n />\n )}\n <DownloadOutlined\n className={styles.attachmentIconItem}\n onClick={() => handleDownload(file)}\n />\n </span>\n </div>\n );\n })}\n </>\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,QACX,mBAAmB;AAC1B,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,OAAOC,MAAM,MAAM,2CAA2C;AAM9D,OAAO,SAASC,0BAA0B,CACxCC,KAAsC,EAClB;EACpB,IAAM;IAAEC;EAAM,CAAC,GAAGD,KAAK;EACvB;EACA,IAAME,cAAc,GAAIC,IAAS,IAAW;IAC1C,IAAMC,MAAM,aAAMC,MAAM,CAACC,QAAQ,CAACC,MAAM,UAAO;IAC/C,IAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,GAAG,CAAC;IACxCF,IAAI,CAACG,IAAI,aAAMP,MAAM,cAAID,IAAI,CAACS,GAAG,CAAE;IACnCJ,IAAI,CAACK,QAAQ,GAAGV,IAAI,CAACW,IAAI;IACzBL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAACR,IAAI,CAAC;IAC/BA,IAAI,CAACS,KAAK,EAAE;IACZR,QAAQ,CAACM,IAAI,CAACG,WAAW,CAACV,IAAI,CAAC;EACjC,CAAC;EACD;EACA,IAAMW,aAAa,GAAIhB,IAAS,IAAW;IACzC,IAAMC,MAAM,aAAMC,MAAM,CAACC,QAAQ,CAACC,MAAM,UAAO;IAC/C,IAAMK,GAAG,aAAMR,MAAM,cAAID,IAAI,CAACS,GAAG,CAAE;
|
|
1
|
+
{"version":3,"file":"instances-attachment-display.js","names":["React","EyeOutlined","DownloadOutlined","FileTextOutlined","Base64","FileUtils","styles","InstancesAttachmentDisplay","props","value","handleDownload","file","domain","window","location","origin","link","document","createElement","href","url","download","name","body","appendChild","click","removeChild","handlePreview","previewUrl","encodeURIComponent","encode","open","map","isPreview","sizeCompare","supportFileType","id","attachmentItem","marginRight","attachmentText","attachmentSpan","attachmentIconItem"],"sources":["../../../../../src/instance-detail/components/instances-attachment-display/instances-attachment-display.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n EyeOutlined,\n DownloadOutlined,\n FileTextOutlined,\n} from \"@ant-design/icons\";\nimport { Base64 } from \"js-base64\";\nimport { FileUtils } from \"@next-libs/cmdb-utils\";\nimport styles from \"./instances-attachment-display.module.css\";\n\ninterface InstancesAttachmentDisplayProps {\n value?: Record<string, any>[];\n}\n\nexport function InstancesAttachmentDisplay(\n props: InstancesAttachmentDisplayProps\n): React.ReactElement {\n const { value } = props;\n // 下载\n const handleDownload = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const link = document.createElement(\"a\");\n link.href = `${domain}/${file.url}`;\n link.download = file.name;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n // 预览\n const handlePreview = (file: any): void => {\n const domain = `${window.location.origin}/next`;\n const url = `${domain}/${file.url}?fileName=${file.name}`;\n const previewUrl = `${domain}/api/gateway/file_previewer.preview.PreviewFile/onlinePreview?url=${encodeURIComponent(\n Base64.encode(url)\n // window.btoa(url)\n )}`;\n window.open(previewUrl, \"_blank\");\n };\n return (\n <>\n {value?.map((file: any) => {\n // 是否支持预览\n const isPreview =\n !FileUtils.sizeCompare(file, 100) && FileUtils.supportFileType(file);\n return (\n <div key={file.id} className={styles.attachmentItem}>\n <span>\n <FileTextOutlined style={{ marginRight: \"6px\" }} />\n <span className={styles.attachmentText}>{file.name}</span>\n </span>\n <span className={styles.attachmentSpan}>\n {isPreview && (\n <EyeOutlined\n className={styles.attachmentIconItem}\n onClick={() => handlePreview(file)}\n />\n )}\n <DownloadOutlined\n className={styles.attachmentIconItem}\n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AK,CAAEuB,GAAG,CAAErB,IAAS,IAAK;IACzB;IACA,IAAMsB,SAAS,GACb,CAAC5B,SAAS,CAAC6B,WAAW,CAACvB,IAAI,EAAE,GAAG,CAAC,IAAIN,SAAS,CAAC8B,eAAe,CAACxB,IAAI,CAAC;IACtE,oBACE;MAAK,GAAG,EAAEA,IAAI,CAACyB,EAAG;MAAC,SAAS,EAAE9B,MAAM,CAAC+B;IAAe,gBAClD,+CACE,oBAAC,gBAAgB;MAAC,KAAK,EAAE;QAAEC,WAAW,EAAE;MAAM;IAAE,EAAG,eACnD;MAAM,SAAS,EAAEhC,MAAM,CAACiC;IAAe,GAAE5B,IAAI,CAACW,IAAI,CAAQ,CACrD,eACP;MAAM,SAAS,EAAEhB,MAAM,CAACkC;IAAe,GACpCP,SAAS,iBACR,oBAAC,WAAW;MACV,SAAS,EAAE3B,MAAM,CAACmC,kBAAmB;MACrC,OAAO,EAAE,MAAMd,aAAa,CAAChB,IAAI;IAAE,EAEtC,eACD,oBAAC,gBAAgB;MACf,SAAS,EAAEL,MAAM,CAACmC,kBAAmB;MACrC,OAAO,EAAE,MAAM/B,cAAc,CAACC,IAAI;IAAE,EACpC,CACG,CACH;EAEV,CAAC,CAAC,CACD;AAEP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-libs/cmdb-instances",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-libs/tree/master/libs/cmdb-instances",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"immutability-helper": "^3.1.1",
|
|
52
52
|
"marked": "^2.1.3"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ca6542cb909eefa60d699c4cc0a963c51549519e"
|
|
55
55
|
}
|