update 1.0.7
This commit is contained in:
parent
6a5f4aaed0
commit
3118185b31
@ -18,4 +18,3 @@
|
||||
/package.json
|
||||
/tsconfig.json
|
||||
debug.log
|
||||
/iframe/js/s_*
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
# 1.0.7
|
||||
|
||||
1. 新增“出库自动填充 BOM”选项:开启后,打开出库界面将自动填充 BOM
|
||||
2. 新增“自动检查更新”选项:开启后,插件将在 EDA 启动时自动检查更新并提示用户
|
||||
3. 移除不必要的依赖包
|
||||
|
||||
# 1.0.6
|
||||
|
||||
1. 增加远程扫码入库功能
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"uuid": "944f7c94a8ca485e848f1118effcbb9a",
|
||||
"displayName": "LEYE",
|
||||
"description": "LEYE 电子元器件库存管理系统 EDA 联动扩展",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"publisher": "Mr_Fang",
|
||||
"engines": {
|
||||
"eda": "^3.2.80"
|
||||
@ -14,9 +14,7 @@
|
||||
"url": "https://gitea.miri.site/Mr_Fang/eext-leye"
|
||||
},
|
||||
"categories": "Schematic",
|
||||
"keywords": [
|
||||
"Tools", "库管", "库存管理"
|
||||
],
|
||||
"keywords": ["Tools", "库管", "库存管理"],
|
||||
"images": {
|
||||
"logo": "./images/logo.png"
|
||||
},
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
*, ::before, ::after {
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
@ -154,7 +156,7 @@ html,
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
/* 3 */
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
/* 4 */
|
||||
font-feature-settings: normal;
|
||||
/* 5 */
|
||||
@ -243,7 +245,7 @@ code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
||||
/* 1 */
|
||||
font-feature-settings: normal;
|
||||
/* 2 */
|
||||
@ -486,7 +488,8 @@ textarea {
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
input::-moz-placeholder,
|
||||
textarea::-moz-placeholder {
|
||||
opacity: 1;
|
||||
/* 1 */
|
||||
color: #9ca3af;
|
||||
@ -506,7 +509,7 @@ Set the default cursor for buttons.
|
||||
*/
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
[role='button'] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -550,7 +553,7 @@ video {
|
||||
|
||||
/* Make elements with the HTML hidden attribute stay hidden by default */
|
||||
|
||||
[hidden]:where(:not([hidden="until-found"])) {
|
||||
[hidden]:where(:not([hidden='until-found'])) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -632,10 +635,34 @@ video {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.top-0 {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.z-10 {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.z-40 {
|
||||
z-index: 40;
|
||||
}
|
||||
|
||||
.z-50 {
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.order-1 {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.order-2 {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.order-3 {
|
||||
order: 3;
|
||||
}
|
||||
|
||||
.col-span-2 {
|
||||
grid-column: span 2 / span 2;
|
||||
}
|
||||
@ -644,6 +671,10 @@ video {
|
||||
margin: 0.25rem;
|
||||
}
|
||||
|
||||
.m-2 {
|
||||
margin: 0.5rem;
|
||||
}
|
||||
|
||||
.m-3 {
|
||||
margin: 0.75rem;
|
||||
}
|
||||
@ -665,6 +696,10 @@ video {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.mb-3 {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
@ -778,6 +813,10 @@ video {
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.h-5 {
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
.h-\[200px\] {
|
||||
height: 200px;
|
||||
}
|
||||
@ -790,6 +829,18 @@ video {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.h-screen {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.max-h-full {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.min-h-0 {
|
||||
min-height: 0px;
|
||||
}
|
||||
|
||||
.min-h-screen {
|
||||
min-height: 100vh;
|
||||
}
|
||||
@ -830,6 +881,10 @@ video {
|
||||
width: 12rem;
|
||||
}
|
||||
|
||||
.w-5 {
|
||||
width: 1.25rem;
|
||||
}
|
||||
|
||||
.w-56 {
|
||||
width: 14rem;
|
||||
}
|
||||
@ -870,10 +925,23 @@ video {
|
||||
width: 92%;
|
||||
}
|
||||
|
||||
.w-auto {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.w-fit {
|
||||
width: -moz-fit-content;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.min-w-0 {
|
||||
min-width: 0px;
|
||||
}
|
||||
|
||||
.min-w-full {
|
||||
min-width: 100%;
|
||||
}
|
||||
@ -882,10 +950,18 @@ video {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.max-w-md {
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.flex-1 {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
|
||||
.flex-none {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.flex-shrink {
|
||||
flex-shrink: 1;
|
||||
}
|
||||
@ -903,7 +979,8 @@ video {
|
||||
}
|
||||
|
||||
.transform {
|
||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y))
|
||||
scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||
}
|
||||
|
||||
.cursor-pointer {
|
||||
@ -920,6 +997,10 @@ video {
|
||||
resize: both;
|
||||
}
|
||||
|
||||
.grid-cols-1 {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.grid-cols-2 {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
@ -928,6 +1009,10 @@ video {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.flex-col {
|
||||
flex-direction: column;
|
||||
}
|
||||
@ -936,6 +1021,10 @@ video {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.items-start {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.items-center {
|
||||
align-items: center;
|
||||
}
|
||||
@ -952,6 +1041,10 @@ video {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.gap-1 {
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.gap-2 {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
@ -960,6 +1053,10 @@ video {
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.gap-4 {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-space-x-reverse: 0;
|
||||
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
|
||||
@ -984,6 +1081,12 @@ video {
|
||||
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
|
||||
}
|
||||
|
||||
.space-x-6 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-space-x-reverse: 0;
|
||||
margin-right: calc(1.5rem * var(--tw-space-x-reverse));
|
||||
margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
|
||||
}
|
||||
|
||||
.space-y-0 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-space-y-reverse: 0;
|
||||
margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
|
||||
@ -1020,17 +1123,32 @@ video {
|
||||
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
|
||||
}
|
||||
|
||||
.space-y-5 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-space-y-reverse: 0;
|
||||
margin-top: calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));
|
||||
margin-bottom: calc(1.25rem * var(--tw-space-y-reverse));
|
||||
}
|
||||
|
||||
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-y-reverse: 0;
|
||||
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
||||
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
||||
}
|
||||
|
||||
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-opacity: 1;
|
||||
border-color: rgb(243 244 246 / var(--tw-divide-opacity, 1));
|
||||
}
|
||||
|
||||
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-opacity: 1;
|
||||
border-color: rgb(229 231 235 / var(--tw-divide-opacity, 1));
|
||||
}
|
||||
|
||||
.overflow-auto {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -1049,6 +1167,10 @@ video {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.whitespace-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rounded {
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
@ -1061,6 +1183,10 @@ video {
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.rounded-xl {
|
||||
border-radius: 0.75rem;
|
||||
}
|
||||
|
||||
.border {
|
||||
border-width: 1px;
|
||||
}
|
||||
@ -1077,10 +1203,18 @@ video {
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
|
||||
.border-b-0 {
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
|
||||
.border-l {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.border-r {
|
||||
border-right-width: 1px;
|
||||
}
|
||||
|
||||
.border-t {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
@ -1099,6 +1233,11 @@ video {
|
||||
border-color: rgb(147 197 253 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.border-blue-500 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.border-blue-600 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(37 99 235 / var(--tw-border-opacity, 1));
|
||||
@ -1159,6 +1298,11 @@ video {
|
||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-gray-200 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-gray-50 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
|
||||
@ -1184,6 +1328,11 @@ video {
|
||||
background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-slate-900 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
@ -1218,6 +1367,10 @@ video {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.p-5 {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.p-6 {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
@ -1242,6 +1395,11 @@ video {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.px-5 {
|
||||
padding-left: 1.25rem;
|
||||
padding-right: 1.25rem;
|
||||
}
|
||||
|
||||
.px-6 {
|
||||
padding-left: 1.5rem;
|
||||
padding-right: 1.5rem;
|
||||
@ -1272,6 +1430,11 @@ video {
|
||||
padding-bottom: 0.375rem;
|
||||
}
|
||||
|
||||
.py-10 {
|
||||
padding-top: 2.5rem;
|
||||
padding-bottom: 2.5rem;
|
||||
}
|
||||
|
||||
.py-2 {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
@ -1287,15 +1450,29 @@ video {
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.py-4 {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.py-6 {
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.py-8 {
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.pb-1 {
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.pb-2 {
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.pb-20 {
|
||||
padding-bottom: 5rem;
|
||||
}
|
||||
@ -1325,11 +1502,11 @@ video {
|
||||
}
|
||||
|
||||
.font-mono {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
||||
}
|
||||
|
||||
.font-sans {
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
}
|
||||
|
||||
.text-2xl {
|
||||
@ -1398,6 +1575,16 @@ video {
|
||||
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-blue-700 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(29 78 216 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-blue-800 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(30 64 175 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.text-gray-400 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
|
||||
@ -1477,6 +1664,12 @@ video {
|
||||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||
}
|
||||
|
||||
.shadow-2xl {
|
||||
--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
||||
--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
|
||||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||
}
|
||||
|
||||
.shadow-\[0_0_8px_rgba\(59\2c 130\2c 246\2c 0\.8\)\] {
|
||||
--tw-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
|
||||
--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);
|
||||
@ -1526,24 +1719,89 @@ video {
|
||||
outline-style: solid;
|
||||
}
|
||||
|
||||
.ring-blue-500 {
|
||||
--tw-ring-opacity: 1;
|
||||
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1));
|
||||
}
|
||||
|
||||
.blur {
|
||||
--tw-blur: blur(8px);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate)
|
||||
var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
|
||||
.invert {
|
||||
--tw-invert: invert(100%);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate)
|
||||
var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
|
||||
.filter {
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate)
|
||||
var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
|
||||
.backdrop-blur-sm {
|
||||
--tw-backdrop-blur: blur(4px);
|
||||
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale)
|
||||
var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale)
|
||||
var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
}
|
||||
|
||||
.backdrop-filter {
|
||||
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale)
|
||||
var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale)
|
||||
var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
}
|
||||
|
||||
.transition {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
||||
transition-property:
|
||||
color,
|
||||
background-color,
|
||||
border-color,
|
||||
text-decoration-color,
|
||||
fill,
|
||||
stroke,
|
||||
opacity,
|
||||
box-shadow,
|
||||
transform,
|
||||
filter,
|
||||
-webkit-backdrop-filter;
|
||||
transition-property:
|
||||
color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property:
|
||||
color,
|
||||
background-color,
|
||||
border-color,
|
||||
text-decoration-color,
|
||||
fill,
|
||||
stroke,
|
||||
opacity,
|
||||
box-shadow,
|
||||
transform,
|
||||
filter,
|
||||
backdrop-filter,
|
||||
-webkit-backdrop-filter;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
.transition-all {
|
||||
transition-property: all;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
.transition-colors {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
.transition-transform {
|
||||
transition-property: transform;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
@ -6,21 +6,54 @@
|
||||
<title>批量出库 - LEYE</title>
|
||||
<link href="/iframe/css/index.css" rel="stylesheet" />
|
||||
<style>
|
||||
#fixed-window { width: 1000px; height: 600px; border: 1px solid #e5e7eb; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
|
||||
.table-container { height: calc(600px - 80px - 44px - 64px); overflow-y: auto; }
|
||||
.bg-match { background-color: #f0fdf4; } /* 淡绿色:匹配成功 */
|
||||
.bg-no-match { background-color: #fefcf2; } /* 淡黄色:不匹配 */
|
||||
.bg-no-cid { background-color: #fef2f2; } /* 淡红色:无 CID */
|
||||
.sticky-header { position: sticky; top: 0; z-index: 10; }
|
||||
.designator-cell { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
#fixed-window {
|
||||
width: 1000px;
|
||||
height: 600px;
|
||||
border: 1px solid #e5e7eb;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.table-container {
|
||||
height: calc(600px - 80px - 44px - 64px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.bg-match {
|
||||
background-color: #f0fdf4;
|
||||
} /* 淡绿色:匹配成功 */
|
||||
.bg-no-match {
|
||||
background-color: #fefcf2;
|
||||
} /* 淡黄色:不匹配 */
|
||||
.bg-no-cid {
|
||||
background-color: #fef2f2;
|
||||
} /* 淡红色:无 CID */
|
||||
.sticky-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
.designator-cell {
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-100 font-sans text-sm">
|
||||
<div id="fixed-window" class="bg-gray-50 flex flex-col overflow-hidden mx-auto">
|
||||
<header class="flex-shrink-0 bg-white border-b p-4 flex items-center space-x-3">
|
||||
<span class="font-medium text-gray-700">立创商城编号导入</span>
|
||||
<input id="input-cid" type="text" placeholder="CID" class="w-48 px-3 py-1.5 border rounded-md outline-none focus:ring-2 focus:ring-blue-500" />
|
||||
<input id="input-qty" type="number" placeholder="数量" class="w-24 px-3 py-1.5 border rounded-md outline-none focus:ring-2 focus:ring-blue-500" />
|
||||
<input
|
||||
id="input-cid"
|
||||
type="text"
|
||||
placeholder="CID"
|
||||
class="w-48 px-3 py-1.5 border rounded-md outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
<input
|
||||
id="input-qty"
|
||||
type="number"
|
||||
placeholder="数量"
|
||||
class="w-24 px-3 py-1.5 border rounded-md outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
<button id="add-manual-btn" class="px-4 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700">添加</button>
|
||||
</header>
|
||||
|
||||
@ -29,9 +62,7 @@
|
||||
<button id="select-all" class="px-3 py-1 bg-white border border-gray-300 rounded hover:bg-gray-100 text-xs">全选</button>
|
||||
<button id="select-reverse" class="px-3 py-1 bg-white border border-gray-300 rounded hover:bg-gray-100 text-xs">反选</button>
|
||||
</div>
|
||||
<div class="text-gray-500 text-xs">
|
||||
待出库总数:<span id="list-count" class="font-bold text-blue-600">0</span>
|
||||
</div>
|
||||
<div class="text-gray-500 text-xs">待出库总数:<span id="list-count" class="font-bold text-blue-600">0</span></div>
|
||||
</div>
|
||||
|
||||
<main class="flex-grow bg-white m-3 border rounded-lg overflow-hidden shadow-inner">
|
||||
@ -51,7 +82,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="outbound-table-body" class="divide-y divide-gray-200 text-xs">
|
||||
<tr><td colspan="9" class="text-center py-20 text-gray-400">获取 BOM...</td></tr>
|
||||
<tr>
|
||||
<td colspan="9" class="text-center py-20 text-gray-400">获取 BOM...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -60,6 +93,7 @@
|
||||
<footer class="flex-shrink-0 p-4 bg-white border-t flex justify-end space-x-3">
|
||||
<p class="pr-24 text-red-500 py-2">建议“器件标准化”后使用此功能</p>
|
||||
<button id="cancel-btn" class="px-6 py-2 border border-gray-300 rounded-md hover:bg-gray-100">取消</button>
|
||||
<button id="fill-bom-btn" class="px-6 py-2 border border-gray-300 rounded-md hover:bg-gray-100">应用 BOM</button>
|
||||
<button id="clear-list-btn" class="px-6 py-2 border border-red-300 text-red-600 rounded-md hover:bg-red-50">清空列表</button>
|
||||
<button id="outbound-btn" class="px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 font-bold">一键出库</button>
|
||||
</footer>
|
||||
@ -76,12 +110,14 @@
|
||||
const cachedRaw = await eda.sys_Storage.getExtensionUserConfig('cache-leye-device-details');
|
||||
try {
|
||||
const details = cachedRaw ? JSON.parse(cachedRaw) : [];
|
||||
cachedCIDs = new Set(details.map(d => String(d.lcscId).toUpperCase()));
|
||||
} catch(e) { cachedCIDs = new Set(); }
|
||||
cachedCIDs = new Set(details.map((d) => String(d.lcscId).toUpperCase()));
|
||||
} catch (e) {
|
||||
cachedCIDs = new Set();
|
||||
}
|
||||
}
|
||||
|
||||
function parseProperty(comp, key) {
|
||||
if (key === "Manufacturer Part") return comp.getState_ManufacturerId();
|
||||
if (key === 'Manufacturer Part') return comp.getState_ManufacturerId();
|
||||
const props = comp.getState_OtherProperty() || {};
|
||||
return props[key] || '-';
|
||||
}
|
||||
@ -96,35 +132,35 @@
|
||||
}
|
||||
|
||||
async function scanSchematic() {
|
||||
const all = await eda.sch_PrimitiveComponent.getAll("part", true);
|
||||
const all = await eda.sch_PrimitiveComponent.getAll('part', true);
|
||||
const groups = {};
|
||||
|
||||
all.forEach(comp => {
|
||||
all.forEach((comp) => {
|
||||
const uuid = comp.getState_Component().uuid;
|
||||
if (!groups[uuid]) {
|
||||
groups[uuid] = {
|
||||
name: resolveModelName(comp),
|
||||
designators: [],
|
||||
value: parseProperty(comp, "Value"),
|
||||
footprint: parseProperty(comp, "Supplier Footprint"),
|
||||
value: parseProperty(comp, 'Value'),
|
||||
footprint: parseProperty(comp, 'Supplier Footprint'),
|
||||
brand: comp.getState_Manufacturer() || '-',
|
||||
lcscId: (comp.getState_SupplierId() || '').toUpperCase(),
|
||||
quantity: 0,
|
||||
selected: false
|
||||
selected: false,
|
||||
};
|
||||
}
|
||||
groups[uuid].quantity++;
|
||||
groups[uuid].designators.push(comp.getState_Designator());
|
||||
});
|
||||
|
||||
outboundList = Object.keys(groups).map(uuid => {
|
||||
outboundList = Object.keys(groups).map((uuid) => {
|
||||
const item = groups[uuid];
|
||||
const match = item.lcscId && cachedCIDs.has(item.lcscId);
|
||||
return {
|
||||
...item,
|
||||
designatorStr: item.designators.sort().join(', '),
|
||||
uuid: uuid,
|
||||
selected: match
|
||||
selected: match,
|
||||
};
|
||||
});
|
||||
renderTable();
|
||||
@ -138,7 +174,8 @@
|
||||
}
|
||||
|
||||
listCount.textContent = outboundList.length;
|
||||
tableBody.innerHTML = outboundList.map((item, index) => {
|
||||
tableBody.innerHTML = outboundList
|
||||
.map((item, index) => {
|
||||
const isMatch = item.lcscId && cachedCIDs.has(item.lcscId);
|
||||
let rowClass = 'bg-no-cid';
|
||||
if (item.lcscId) {
|
||||
@ -167,7 +204,8 @@
|
||||
<button onclick="removeItem(${index})" class="text-red-500 hover:underline">删除</button>
|
||||
</td>
|
||||
</tr>`;
|
||||
}).join('');
|
||||
})
|
||||
.join('');
|
||||
}
|
||||
|
||||
tableBody.addEventListener('change', (e) => {
|
||||
@ -187,7 +225,7 @@
|
||||
});
|
||||
|
||||
document.getElementById('select-all').onclick = () => {
|
||||
outboundList.forEach(item => {
|
||||
outboundList.forEach((item) => {
|
||||
if (item.lcscId && cachedCIDs.has(item.lcscId)) {
|
||||
item.selected = true;
|
||||
}
|
||||
@ -196,7 +234,7 @@
|
||||
};
|
||||
|
||||
document.getElementById('select-reverse').onclick = () => {
|
||||
outboundList.forEach(item => {
|
||||
outboundList.forEach((item) => {
|
||||
if (item.lcscId && cachedCIDs.has(item.lcscId)) {
|
||||
item.selected = !item.selected;
|
||||
}
|
||||
@ -229,7 +267,9 @@
|
||||
let detail = { name: '-', value: '-', footprint: '-', brand: '-', designatorStr: '手动添加', selected: false };
|
||||
|
||||
if (devs[0]) {
|
||||
const infoRes = await eda.sys_ClientUrl.request('https://client/api/v2/devices/' + devs[0].uuid, 'GET', null, { headers: { path: '0819f05c4eef4c71ace90d822a990e87' } });
|
||||
const infoRes = await eda.sys_ClientUrl.request('https://client/api/v2/devices/' + devs[0].uuid, 'GET', null, {
|
||||
headers: { path: '0819f05c4eef4c71ace90d822a990e87' },
|
||||
});
|
||||
const info = (await infoRes.json()).result;
|
||||
detail.name = info.attributes['Manufacturer Part'] || '-';
|
||||
detail.value = info.attributes['Value'] || '-';
|
||||
@ -249,14 +289,14 @@
|
||||
};
|
||||
|
||||
document.getElementById('outbound-btn').onclick = async () => {
|
||||
const selectedItems = outboundList.filter(item => item.selected && item.lcscId);
|
||||
const selectedItems = outboundList.filter((item) => item.selected && item.lcscId);
|
||||
|
||||
if (selectedItems.length === 0) {
|
||||
return eda.sys_Message.showToastMessage('请先勾选要出库的器件', ESYS_ToastMessageType.WARNING);
|
||||
}
|
||||
|
||||
const SERVER = await eda.sys_Storage.getExtensionUserConfig('server-host') || 'http://localhost:21816';
|
||||
const AUTO_RUN = await eda.sys_Storage.getExtensionUserConfig('server-auto-run') || true;
|
||||
const SERVER = (await eda.sys_Storage.getExtensionUserConfig('server-host')) || 'http://localhost:21816';
|
||||
const AUTO_RUN = (await eda.sys_Storage.getExtensionUserConfig('server-auto-run')) || true;
|
||||
let successCount = 0;
|
||||
let failItems = [];
|
||||
|
||||
@ -264,22 +304,16 @@
|
||||
|
||||
for (const item of selectedItems) {
|
||||
try {
|
||||
let getRes = await eda.sys_ClientUrl.request(
|
||||
`${SERVER}/getLeyeList?lcscId=${item.lcscId}`,
|
||||
'GET'
|
||||
);
|
||||
let getRes = await eda.sys_ClientUrl.request(`${SERVER}/getLeyeList?lcscId=${item.lcscId}`, 'GET');
|
||||
let getResult = await getRes.json();
|
||||
|
||||
if (AUTO_RUN && !getResult.success) {
|
||||
window.open('leye://open');
|
||||
for (let i = 0; i < 3 && !getResult.success; i++) {
|
||||
eda.sys_Message.showToastMessage('等待拉起本地服务端...', ESYS_ToastMessageType.INFO);
|
||||
getRes = await eda.sys_ClientUrl.request(
|
||||
`${SERVER}/getLeyeList?lcscId=${item.lcscId}`,
|
||||
'GET'
|
||||
);
|
||||
getRes = await eda.sys_ClientUrl.request(`${SERVER}/getLeyeList?lcscId=${item.lcscId}`, 'GET');
|
||||
getResult = await getRes.json();
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,9 +334,9 @@
|
||||
'POST',
|
||||
JSON.stringify({
|
||||
id: remoteId,
|
||||
quantity: newQuantity
|
||||
quantity: newQuantity,
|
||||
}),
|
||||
{ headers: { 'Content-Type': 'application/json' } }
|
||||
{ headers: { 'Content-Type': 'application/json' } },
|
||||
);
|
||||
|
||||
const postResult = await postRes.json();
|
||||
@ -317,7 +351,7 @@
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`出库请求异常: ${item.lcscId}`, e);
|
||||
eda.sys_Log.add(`出库请求异常: ${item.lcscId}: ${e.message}`)
|
||||
eda.sys_Log.add(`出库请求异常: ${item.lcscId}: ${e.message}`);
|
||||
failItems.push(`${item.lcscId} (网络异常)`);
|
||||
}
|
||||
}
|
||||
@ -328,16 +362,17 @@
|
||||
eda.sys_Message.showToastMessage(`成功出库 ${successCount} 项!`, ESYS_ToastMessageType.SUCCESS);
|
||||
} else {
|
||||
const errorMsg = failItems.join('; ');
|
||||
eda.sys_Message.showToastMessage(`出库完成:成功:${successCount},失败:${failItems.length}`,
|
||||
ESYS_ToastMessageType.WARNING);
|
||||
eda.sys_Message.showToastMessage(`出库完成:成功:${successCount},失败:${failItems.length}`, ESYS_ToastMessageType.WARNING);
|
||||
eda.sys_Log.add(errorMsg);
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById('fill-bom-btn').onclick = () => scanSchematic();
|
||||
|
||||
document.getElementById('cancel-btn').onclick = () => eda.sys_IFrame.closeIFrame();
|
||||
|
||||
await initCache();
|
||||
await scanSchematic();
|
||||
if (eda.sys_Storage.getExtensionUserConfig('auto-fill-bom')) await scanSchematic();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -109,16 +109,27 @@
|
||||
</label>
|
||||
<input type="checkbox" id="settings-server-auto-run" />
|
||||
</div>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<label for="settings-auto-fill-bom" class="text-gray-700">出库自动填充 BOM</label>
|
||||
<input type="checkbox" id="settings-auto-fill-bom" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white p-4 rounded-lg w-[400px]">
|
||||
<h2 class="text-lg font-semibold text-gray-800 mb-4">
|
||||
高级设置
|
||||
<span class="text-[12px] text-gray-500 font-light ml-2"> 实验或调试选项 </span>
|
||||
</h2>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<label for="settings-auto-check-update" class="text-gray-700">
|
||||
自动检查更新
|
||||
<span class="tooltip text-sm text-gray-500 font-light" data-tooltip="允许在启动 EDA 时检查更新">?</span>
|
||||
</label>
|
||||
<input type="checkbox" id="settings-auto-check-update" />
|
||||
</div>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<label for="settings-clean-cache" class="text-gray-700">
|
||||
清除缓存
|
||||
<span class="tooltip text-sm text-gray-500 font-light" data-tooltip="用于移除损坏的缓存数据">?</span>
|
||||
<span class="tooltip text-sm text-gray-500 font-light" data-tooltip="库存数据异常可尝试使用此功能修复">?</span>
|
||||
</label>
|
||||
<button id="settings-clean-cache" class="bg-red-600 text-white px-4 py-1 rounded hover:bg-red-700">清除</button>
|
||||
</div>
|
||||
@ -128,10 +139,14 @@
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const serverHostInput = document.getElementById('settings-server-host');
|
||||
const serverAutoRun = document.getElementById('settings-server-auto-run');
|
||||
const autoFillBomInput = document.getElementById('settings-auto-fill-bom');
|
||||
const autoCheckUpdateInput = document.getElementById('settings-auto-check-update');
|
||||
const cleanCacheBtn = document.getElementById('settings-clean-cache');
|
||||
|
||||
serverHostInput.value = (await eda.sys_Storage.getExtensionUserConfig('server-host')) ?? 'http://localhost:21816/api';
|
||||
serverAutoRun.checked = (await eda.sys_Storage.getExtensionUserConfig('server-auto-run')) ?? true;
|
||||
autoFillBomInput.checked = (await eda.sys_Storage.getExtensionUserConfig('auto-fill-bom')) ?? false;
|
||||
autoCheckUpdateInput.checked = (await eda.sys_Storage.getExtensionUserConfig('auto-check-update')) ?? true;
|
||||
|
||||
serverHostInput.addEventListener('change', async () => {
|
||||
saveConfig('server-host', serverHostInput.value);
|
||||
@ -139,16 +154,22 @@
|
||||
serverAutoRun.addEventListener('change', async () => {
|
||||
saveConfig('server-auto-run', serverAutoRun.checked);
|
||||
});
|
||||
autoFillBomInput.addEventListener('change', async () => {
|
||||
saveConfig('auto-fill-bom', autoFillBomInput.checked);
|
||||
});
|
||||
autoCheckUpdateInput.addEventListener('change', async () => {
|
||||
saveConfig('auto-check-update', autoCheckUpdateInput.checked);
|
||||
});
|
||||
|
||||
cleanCacheBtn.addEventListener('click', async () => {
|
||||
eda.sys_Storage.deleteExtensionUserConfig('cache-leye-device-details').then(s => {
|
||||
eda.sys_Storage.deleteExtensionUserConfig('cache-leye-device-details').then((s) => {
|
||||
if (s) {
|
||||
eda.sys_Message.showToastMessage('缓存清除成功!', ESYS_ToastMessageType.SUCCESS);
|
||||
} else {
|
||||
eda.sys_Message.showToastMessage('缓存清除失败...', ESYS_ToastMessageType.ERROR);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function saveConfig(key, value) {
|
||||
|
||||
@ -12,8 +12,7 @@
|
||||
"eslint:all": "eslint --ext .ts --fix .",
|
||||
"fix": "npm run prettier:all && npm run eslint:all",
|
||||
"tailwind": "tailwindcss -i ./iframe/css/input.css -o ./iframe/css/index.css",
|
||||
"obf": "node -e \"const g=require('glob');const {execSync}=require('child_process');const p=require('path');g.sync('iframe/js/s_*.js').forEach(f=>{const d=p.dirname(f),b=p.basename(f,'.js').slice(2)+'.js';execSync(`javascript-obfuscator \\\"${f}\\\" --string-array-encoding rc4 --output \\\"${p.join(d,b)}\\\"`)})\"",
|
||||
"build": "npm run tailwind && npm run obf && npm run compile && ts-node ./build/packaged.ts"
|
||||
"build": "npm run tailwind && npm run compile && ts-node ./build/packaged.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jlceda/pro-api-types": "^0.1.175",
|
||||
@ -36,8 +35,7 @@
|
||||
"rimraf": "^6.0.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.7.3",
|
||||
"javascript-obfuscator": "^4.1.1"
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": "eslint --cache --fix",
|
||||
|
||||
38
src/index.ts
38
src/index.ts
@ -45,38 +45,56 @@ if (!globalThis['__LEYE_INIT_FLAG__']) {
|
||||
// @ts-ignore
|
||||
globalThis['__LEYE_INIT_FLAG__'] = true;
|
||||
// @ts-ignore
|
||||
eda.sys_ShortcutKey.unregisterShortcutKey(['Shift+L']).then(r => console.log('[LEYE] 注销快捷键: ', r));
|
||||
eda.sys_ShortcutKey.unregisterShortcutKey(['Shift+L']).then((r) => console.log('[LEYE] 注销快捷键: ', r));
|
||||
// @ts-ignore
|
||||
eda.sys_ShortcutKey.registerShortcutKey(['Shift+L'], 'openLeyeIFrame', async () => {
|
||||
eda.sys_ShortcutKey
|
||||
.registerShortcutKey(['Shift+L'], 'openLeyeIFrame', async () => {
|
||||
await openLeyeIFrameNew();
|
||||
}).then(r => console.log('[LEYE] 注册快捷键: ', r));
|
||||
})
|
||||
.then((r) => console.log('[LEYE] 注册快捷键: ', r));
|
||||
|
||||
// 获取公告
|
||||
console.log('[LEYE] 获取公告和更新');
|
||||
eda.sys_ClientUrl.request('https://leye.dragon.edu.kg/release/notice.json').then(async (res: any) => {
|
||||
eda.sys_ClientUrl
|
||||
.request('https://leye.dragon.edu.kg/release/notice.json')
|
||||
.then(async (res: any) => {
|
||||
const data = await res.json();
|
||||
console.log('[LEYE] 获取公告: ', data);
|
||||
if (eda.sys_Storage.getExtensionUserConfig('cache-notice-id') !== data.notices[0].id) {
|
||||
await eda.sys_Storage.setExtensionUserConfig('cache-notice-id', data.notices[0].id);
|
||||
eda.sys_Dialog.showInformationMessage(data.notices[0].content, data.notices[0].title, '知道了');
|
||||
}
|
||||
}).catch((err: any) => {
|
||||
})
|
||||
.catch((err: any) => {
|
||||
console.error('[LEYE] 获取公告和更新失败: ', err);
|
||||
});
|
||||
|
||||
// 获取最新版本
|
||||
console.log('[LEYE] 获取最新版本');
|
||||
eda.sys_ClientUrl.request('https://leye.dragon.edu.kg/release/eext.ver.json').then(async (res: any) => {
|
||||
if (eda.sys_Storage.getExtensionUserConfig('auto-check-update') ?? true) {
|
||||
eda.sys_ClientUrl
|
||||
.request('https://leye.dragon.edu.kg/release/eext.ver.json')
|
||||
.then(async (res: any) => {
|
||||
const data = await res.json();
|
||||
console.log('[LEYE] 获取最新版本: ', data);
|
||||
if (extensionConfig.version !== data.versions[0].ver) {
|
||||
eda.sys_Dialog.showConfirmationMessage(data.versions[0].changelog, `LEYE 有新版本 ${data.versions[0].ver} 可用,是否前往下载?`, '前往下载', '算了', async (r) => {
|
||||
eda.sys_Dialog.showConfirmationMessage(
|
||||
data.versions[0].changelog,
|
||||
`LEYE 有新版本 ${data.versions[0].ver} 可用,是否前往下载?`,
|
||||
'前往下载',
|
||||
'算了',
|
||||
async (r) => {
|
||||
if (r) {
|
||||
eda.sys_Window.open('https://lrurl.top/LeyeEEXT', ESYS_WindowOpenTarget.BLANK);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch((err: any) => {
|
||||
console.error('[LEYE] 获取最新版本: ', err);
|
||||
.catch((err: any) => {
|
||||
console.error('[LEYE] 获取最新版本失败: ', err);
|
||||
});
|
||||
} else {
|
||||
console.log('[LEYE] 用户主动关闭自动检查更新');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user