mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
refactor: topology icons
This commit is contained in:
parent
f6b075c11c
commit
e125c3448b
@ -14,8 +14,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
const requireComponent: any = import.meta.glob("./technologies/*.svg");
|
const requireComponent: any = import.meta.glob("./technologies/*.png", { eager: true });
|
||||||
const requireTool: any = import.meta.glob("./tools/*.png");
|
const requireTool: any = import.meta.glob("./tools/*.png", { eager: true });
|
||||||
const result: { [key: string]: string } = {};
|
const result: { [key: string]: string } = {};
|
||||||
const t: { [key: string]: string } = {};
|
const t: { [key: string]: string } = {};
|
||||||
|
|
||||||
@ -28,19 +28,15 @@ function validateFileName(str: string): string | undefined {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Object.keys(requireComponent).forEach((filePath: string) => {
|
Object.keys(requireComponent).forEach((filePath: string) => {
|
||||||
const componentConfig = requireComponent(filePath);
|
|
||||||
|
|
||||||
const fileName = validateFileName(filePath);
|
const fileName = validateFileName(filePath);
|
||||||
if (fileName) {
|
if (fileName) {
|
||||||
result[fileName] = componentConfig;
|
result[fileName] = requireComponent[filePath].default;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.keys(requireTool).forEach((filePath: string) => {
|
Object.keys(requireTool).forEach((filePath: string) => {
|
||||||
const componentConfig = requireTool[filePath];
|
|
||||||
|
|
||||||
const fileName = validateFileName(filePath);
|
const fileName = validateFileName(filePath);
|
||||||
if (fileName) {
|
if (fileName) {
|
||||||
t[fileName] = componentConfig;
|
t[fileName] = requireTool[filePath].default;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user