diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 771e3d1d7..cf2a7a8ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Welcome to use [issue tracker](https://github.com/alibaba/arthas/issues) to give ## Online Tutorials -Please refer to [README.MD at tutorials/katacoda](tutorials/katacoda/README.md#contribution-guide) +Please refer to [README.MD at killercoda branch](https://github.com/alibaba/arthas/tree/killercoda/README.md#contribution-guide) ## Developer @@ -79,7 +79,7 @@ Tip: you can use `--versions` to list all available versions. ## 改进在线教程 -请参考[tutorials/katacoda下的说明](tutorials/katacoda/README_CN.md#贡献指南) +请参考[killercoda 分支下的说明](https://github.com/alibaba/arthas/tree/killercoda/README_CN.md#贡献指南) ## 开发者相关 diff --git a/site/docs/.vuepress/client.js b/site/docs/.vuepress/client.js index ad348c49c..461632895 100644 --- a/site/docs/.vuepress/client.js +++ b/site/docs/.vuepress/client.js @@ -14,7 +14,7 @@ const addOldDocsContributors = () => { return contributors.find( (contributor) => contributor.name === oldContributor.name && - contributor.email === oldContributor.email + contributor.email === oldContributor.email, ); }; diff --git a/site/docs/.vuepress/config.js b/site/docs/.vuepress/config.js index 50ab0efb4..10dd75aa1 100644 --- a/site/docs/.vuepress/config.js +++ b/site/docs/.vuepress/config.js @@ -91,7 +91,7 @@ export default defineUserConfig({ .map((page) => [ page.path.replace(/^\/en\/doc\//, "/doc/en/"), page.path, - ]) + ]), ); delete redirects["/doc/en/"]; diff --git a/site/docs/.vuepress/configs/sidebar/en.js b/site/docs/.vuepress/configs/sidebar/en.js index bb4d705cb..b5f438748 100644 --- a/site/docs/.vuepress/configs/sidebar/en.js +++ b/site/docs/.vuepress/configs/sidebar/en.js @@ -7,89 +7,78 @@ export const sidebarEN = { "/en/doc/quick-start.md", "/en/doc/install-detail.md", "/en/doc/download.md", - "/en/doc/advanced-use.md", - { - text: "Other features", - collapsible: true, - children: [ - "/en/doc/async.md", - "/en/doc/save-log.md", - "/en/doc/batch-support.md", - { - text: "How to use ognl", - link: "", - children: [ - { - text: "Basic ognl example", - link: "https://github.com/alibaba/arthas/issues/11", - }, - { - text: "Ognl special uses", - link: "https://github.com/alibaba/arthas/issues/71", - }, - ], - }, - ], - }, + "/en/doc/advice-class.html", { text: "All Commands", link: "/en/doc/commands.md", collapsible: true, children: [ - "/en/doc/dashboard.md", - "/en/doc/getstatic.md", - "/en/doc/heapdump.md", - "/en/doc/jvm.md", - "/en/doc/logger.md", - "/en/doc/mbean.md", - "/en/doc/memory.md", - "/en/doc/ognl.md", - "/en/doc/perfcounter.md", - "/en/doc/sysenv.md", - "/en/doc/sysprop.md", - "/en/doc/thread.md", - "/en/doc/vmoption.md", - "/en/doc/vmtool.md", - "/en/doc/classloader.md", - "/en/doc/dump.md", - "/en/doc/jad.md", - "/en/doc/mc.md", - "/en/doc/redefine.md", - "/en/doc/retransform.md", - "/en/doc/sc.md", - "/en/doc/sm.md", - "/en/doc/monitor.md", - "/en/doc/stack.md", - "/en/doc/trace.md", - "/en/doc/tt.md", - "/en/doc/watch.md", - "/en/doc/profiler.md", - "/en/doc/jfr.md", "/en/doc/auth.md", - "/en/doc/options.md", "/en/doc/base64.md", "/en/doc/cat.md", + "/en/doc/classloader.md", "/en/doc/cls.md", + "/en/doc/dashboard.md", + "/en/doc/dump.md", "/en/doc/echo.md", + "/en/doc/getstatic.md", "/en/doc/grep.md", + "/en/doc/heapdump.md", "/en/doc/help.md", "/en/doc/history.md", + "/en/doc/jad.md", + "/en/doc/jfr.md", + "/en/doc/jvm.md", "/en/doc/keymap.md", + "/en/doc/logger.md", + "/en/doc/mbean.md", + "/en/doc/mc.md", + "/en/doc/memory.md", + "/en/doc/monitor.md", + "/en/doc/ognl.md", + "/en/doc/options.md", + "/en/doc/perfcounter.md", + "/en/doc/profiler.md", "/en/doc/pwd.md", "/en/doc/quit.md", + "/en/doc/redefine.md", "/en/doc/reset.md", + "/en/doc/retransform.md", + "/en/doc/sc.md", "/en/doc/session.md", + "/en/doc/sm.md", + "/en/doc/stack.md", "/en/doc/stop.md", + "/en/doc/sysenv.md", + "/en/doc/sysprop.md", "/en/doc/tee.md", + "/en/doc/thread.md", + "/en/doc/trace.md", + "/en/doc/tt.md", "/en/doc/version.md", + "/en/doc/vmoption.md", + "/en/doc/vmtool.md", + "/en/doc/watch.md", + ], + }, + { + text: "Other features", + link: "/en/doc/advanced-use.md", + collapsible: true, + children: [ + "/en/doc/async.md", + "/en/doc/save-log.md", + "/en/doc/docker.md", + "/en/doc/web-console.md", + "/en/doc/tunnel.md", + "/en/doc/idea-plugin.md", + "/en/doc/arthas-properties.html", + "/en/doc/agent.html", + "/en/doc/spring-boot-starter.md", + "/en/doc/http-api.md", + "/en/doc/batch-support.md", ], }, - "/en/doc/web-console.md", - "/en/doc/tunnel.md", - "/en/doc/http-api.md", - "/en/doc/docker.md", - "/en/doc/spring-boot-starter.md", - "/en/doc/idea-plugin.md", "/en/doc/faq.md", { text: "User cases", diff --git a/site/docs/.vuepress/configs/sidebar/zh.js b/site/docs/.vuepress/configs/sidebar/zh.js index 9efdc4ac1..c8d7d75fa 100644 --- a/site/docs/.vuepress/configs/sidebar/zh.js +++ b/site/docs/.vuepress/configs/sidebar/zh.js @@ -7,89 +7,78 @@ export const sidebarZH = { "/doc/quick-start.md", "/doc/install-detail.md", "/doc/download.md", - "/doc/advanced-use.md", - { - text: "其他特性", - collapsible: true, - children: [ - "/doc/async.md", - "/doc/save-log.md", - "/doc/batch-support.md", - { - text: "ognl 表达式用法", - link: "", - children: [ - { - text: "活用ognl表达式", - link: "https://github.com/alibaba/arthas/issues/11", - }, - { - text: "一些ognl特殊用法", - link: "https://github.com/alibaba/arthas/issues/71", - }, - ], - }, - ], - }, + "/doc/advice-class.html", { text: "命令列表", link: "/doc/commands.md", collapsible: true, children: [ - "/doc/dashboard.md", - "/doc/getstatic.md", - "/doc/heapdump.md", - "/doc/jvm.md", - "/doc/logger.md", - "/doc/mbean.md", - "/doc/memory.md", - "/doc/ognl.md", - "/doc/perfcounter.md", - "/doc/sysenv.md", - "/doc/sysprop.md", - "/doc/thread.md", - "/doc/vmoption.md", - "/doc/vmtool.md", - "/doc/classloader.md", - "/doc/dump.md", - "/doc/jad.md", - "/doc/mc.md", - "/doc/redefine.md", - "/doc/retransform.md", - "/doc/sc.md", - "/doc/sm.md", - "/doc/monitor.md", - "/doc/stack.md", - "/doc/trace.md", - "/doc/tt.md", - "/doc/watch.md", - "/doc/profiler.md", - "/doc/jfr.md", "/doc/auth.md", - "/doc/options.md", "/doc/base64.md", "/doc/cat.md", + "/doc/classloader.md", "/doc/cls.md", + "/doc/dashboard.md", + "/doc/dump.md", "/doc/echo.md", + "/doc/getstatic.md", "/doc/grep.md", + "/doc/heapdump.md", "/doc/help.md", "/doc/history.md", + "/doc/jad.md", + "/doc/jfr.md", + "/doc/jvm.md", "/doc/keymap.md", + "/doc/logger.md", + "/doc/mbean.md", + "/doc/mc.md", + "/doc/memory.md", + "/doc/monitor.md", + "/doc/ognl.md", + "/doc/options.md", + "/doc/perfcounter.md", + "/doc/profiler.md", "/doc/pwd.md", "/doc/quit.md", + "/doc/redefine.md", "/doc/reset.md", + "/doc/retransform.md", + "/doc/sc.md", "/doc/session.md", + "/doc/sm.md", + "/doc/stack.md", "/doc/stop.md", + "/doc/sysenv.md", + "/doc/sysprop.md", "/doc/tee.md", + "/doc/thread.md", + "/doc/trace.md", + "/doc/tt.md", "/doc/version.md", + "/doc/vmoption.md", + "/doc/vmtool.md", + "/doc/watch.md", + ], + }, + { + text: "其他特性", + link: "/doc/advanced-use.md", + collapsible: true, + children: [ + "/doc/async.md", + "/doc/save-log.md", + "/doc/docker.md", + "/doc/web-console.md", + "/doc/tunnel.md", + "/doc/idea-plugin.md", + "/doc/arthas-properties.html", + "/doc/agent.html", + "/doc/spring-boot-starter.md", + "/doc/http-api.md", + "/doc/batch-support.md", ], }, - "/doc/web-console.md", - "/doc/tunnel.md", - "/doc/http-api.md", - "/doc/docker.md", - "/doc/spring-boot-starter.md", - "/doc/idea-plugin.md", "/doc/faq.md", { text: "用户案例", @@ -108,7 +97,7 @@ export const sidebarZH = { link: "https://github.com/alibaba/arthas/releases", }, { - text: "QQ群/钉钉群", + text: "QQ 群/钉钉群", link: "/doc/contact-us.md", }, ], diff --git a/site/docs/.vuepress/plugins/vuepress-plugin-loadVersion/index.js b/site/docs/.vuepress/plugins/vuepress-plugin-loadVersion/index.js index 53d1c9ce1..33edb752f 100644 --- a/site/docs/.vuepress/plugins/vuepress-plugin-loadVersion/index.js +++ b/site/docs/.vuepress/plugins/vuepress-plugin-loadVersion/index.js @@ -8,7 +8,7 @@ export function loadVersionPlugin() { const getVersionByMaven = async () => { return await fetch( - "https://search.maven.org/solrsearch/select?q=arthas&rows=1&wt=json" + "https://search.maven.org/solrsearch/select?q=arthas&rows=1&wt=json", ) .then((res) => res.json()) .then((res) => res.response.docs[0].latestVersion); diff --git a/site/docs/.vuepress/public/doc/arthas-tutorials.html b/site/docs/.vuepress/public/doc/arthas-tutorials.html index ac1439d6e..e00bf1aac 100644 --- a/site/docs/.vuepress/public/doc/arthas-tutorials.html +++ b/site/docs/.vuepress/public/doc/arthas-tutorials.html @@ -1,4 +1,4 @@ - + @@ -67,7 +67,7 @@ -
+
+ -
-
+ + +
+
@@ -300,15 +327,47 @@ return decodeURIComponent(results[2].replace(/\+/g, " ")); } + function getCookie(cname) { + let name = cname + "="; + let decodedCookie = decodeURIComponent(document.cookie); + let ca = decodedCookie.split(";"); + for (let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) == " ") { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ""; + } + + function setCookie(cname, cvalue, exdays) { + const d = new Date(); + d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000); + let expires = "expires=" + d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; + } + var app = new Vue({ el: "#app", data: { message: "Hello Vue!", language: "en", + iframeHeight: 0, languages: [ { text: "English", value: "en" }, { text: "中文", value: "cn" }, ], + alertLoginContent: { + en: "If you haven’t logged in to killercoda, please click the link to navigate to killercoda.com and log in before continuing with the tutorial", + cn: "如果没有登陆 killercoda 请先点击链接跳转到 killercoda.com 登录后继续使用教程", + }, + alertChangeBrowser: { + en: "Please use Firefox or Chrome to open the tutorial or visit killercoda.com/arthas", + cn: "请使用 Firefox 或 Chrome 打开教程或访问 killercoda.com/arthas", + }, tutorialId: "arthas-basics", tutorials: [ { @@ -316,7 +375,7 @@ type: "TUTORIAL", names: { en: "Arthas Basics", - cn: "Arthas基础教程", + cn: "Arthas 基础教程", }, ids: { en: "arthas-basics-en", @@ -328,7 +387,7 @@ type: "TUTORIAL", names: { en: "Arthas Advanced", - cn: "Arthas进阶教程", + cn: "Arthas 进阶教程", }, ids: { en: "arthas-advanced-en", @@ -904,7 +963,7 @@ type: "USERCASE", names: { en: "Debug ognl express", - cn: "调试ognl表达式", + cn: "调试 ognl 表达式", }, ids: { en: "case-ognl-practise-en", @@ -916,7 +975,7 @@ type: "USERCASE", names: { en: "Find CPU usage Top N threads", - cn: "查找Top N线程", + cn: "查找 Top N 线程", }, ids: { en: "case-thread-en", @@ -928,7 +987,7 @@ type: "USERCASE", names: { en: "Change Logger Level", - cn: "动态更新应用Logger Level", + cn: "动态更新应用 Logger Level", }, ids: { en: "case-ognl-update-logger-level-en", @@ -940,7 +999,7 @@ type: "USERCASE", names: { en: "Troubleshoot logger conflicts", - cn: "排查logger冲突问题", + cn: "排查 logger 冲突问题", }, ids: { en: "case-logger-config-problem-en", @@ -959,24 +1018,12 @@ cn: "case-jad-mc-redefine-cn", }, }, - { - id: "case-http-404", - type: "USERCASE", - names: { - en: "Troubleshooting HTTP request returns 404", - cn: "排查HTTP请求返回404", - }, - ids: { - en: "case-http-404-en", - cn: "case-http-404-cn", - }, - }, { id: "case-http-401", type: "USERCASE", names: { en: "Troubleshooting HTTP request returns 401", - cn: "排查HTTP请求返回401", + cn: "排查 HTTP 请求返回 401", }, ids: { en: "case-http-401-en", @@ -988,7 +1035,7 @@ type: "USERCASE", names: { en: "Get the Spring Context", - cn: "获取Spring Context", + cn: "获取 Spring Context", }, ids: { en: "case-get-spring-context-en", @@ -1000,7 +1047,7 @@ type: "USERCASE", names: { en: "The ClassLoaders in Spring Boot application", - cn: "理解Spring Boot应用的ClassLoader结构", + cn: "理解 Spring Boot 应用的 ClassLoader 结构", }, ids: { en: "case-classloader-en", @@ -1012,7 +1059,7 @@ type: "USERCASE", names: { en: "Arthas boot supported options", - cn: " arthas-boot支持的参数", + cn: " arthas-boot 支持的参数", }, ids: { en: "case-boot-details-en", @@ -1035,7 +1082,9 @@ }, methods: { getTutorials: function (type) { - return this.tutorials.filter((v) => v.type === type); + return this.tutorials + .filter((v) => v.type === type) + .sort((a, b) => a.id.charCodeAt(0) - b.id.charCodeAt(0)); }, languageChange: function (event) { // alert(event.target.value) @@ -1107,7 +1156,7 @@ // https://katacoda.com/embed/arthas/arthas-advanced-cn/?embed=true for (index in this.tutorials) { if (this.tutorials[index].id == this.tutorialId) { - return "arthas/" + this.tutorials[index].ids[this.language]; + return this.tutorials[index].id; } } }, @@ -1125,25 +1174,41 @@ height: e[a + "Height"] - terminalDivRect.top, }; }, + isSafari: function () { + return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + }, }, beforeMount() { - var l = getUrlParam("language"); + let l = getUrlParam("language"); if (l != null) { this.language = l; } - var id = getUrlParam("id"); + let id = getUrlParam("id"); if (id != null) { this.tutorialId = id; } }, + mounted() { + let _this = this; + + // set an alert cookie when the alert is closed + $("div.alert.alert-warning").on("closed.bs.alert", () => { + setCookie("alert", "closed", 60); + }); + + this.iframeHeight = this.calculateKataSize().height; + window.onresize = () => { + _this.iframeHeight = _this.calculateKataSize().height; + }; + }, }); diff --git a/site/docs/.vuepress/theme/components/AutoLink.vue b/site/docs/.vuepress/theme/components/AutoLink.vue index cbf4d6d44..af9121536 100644 --- a/site/docs/.vuepress/theme/components/AutoLink.vue +++ b/site/docs/.vuepress/theme/components/AutoLink.vue @@ -31,7 +31,7 @@ const { item } = toRefs(props); const hasHttpProtocol = computed(() => isLinkHttp(item.value.link)); // if the link has non-http protocol const hasNonHttpProtocol = computed( - () => isLinkMailto(item.value.link) || isLinkTel(item.value.link) + () => isLinkMailto(item.value.link) || isLinkTel(item.value.link), ); // resolve the `target` attr const linkTarget = computed(() => { @@ -45,7 +45,7 @@ const isBlankTarget = computed(() => linkTarget.value === "_blank"); // is `` or not const isRouterLink = computed( () => - !hasHttpProtocol.value && !hasNonHttpProtocol.value && !isBlankTarget.value + !hasHttpProtocol.value && !hasNonHttpProtocol.value && !isBlankTarget.value, ); // resolve the `rel` attr const linkRel = computed(() => { diff --git a/site/docs/.vuepress/theme/components/HomeBadges.vue b/site/docs/.vuepress/theme/components/HomeBadges.vue index a7da6d3a8..9de24152b 100644 --- a/site/docs/.vuepress/theme/components/HomeBadges.vue +++ b/site/docs/.vuepress/theme/components/HomeBadges.vue @@ -17,11 +17,11 @@ const fork = ref(6494); const getStarForkData = async () => { const stars = await fetch("https://arthas.aliyun.com/api/starCount").then( - (res) => res.json() + (res) => res.json(), ); const forks = await fetch("https://arthas.aliyun.com/api/forkCount").then( - (res) => res.json() + (res) => res.json(), ); star.value = stars || star.value; diff --git a/site/docs/.vuepress/theme/components/HomeHero.vue b/site/docs/.vuepress/theme/components/HomeHero.vue index f889ea469..f511877bc 100644 --- a/site/docs/.vuepress/theme/components/HomeHero.vue +++ b/site/docs/.vuepress/theme/components/HomeHero.vue @@ -31,7 +31,7 @@ const heroText = computed(() => { }); const heroAlt = computed( - () => frontmatter.value.heroAlt || heroText.value || "hero" + () => frontmatter.value.heroAlt || heroText.value || "hero", ); const tagline = computed(() => { diff --git a/site/docs/.vuepress/theme/components/NavbarBrand.vue b/site/docs/.vuepress/theme/components/NavbarBrand.vue index cd73c9514..0477a0549 100644 --- a/site/docs/.vuepress/theme/components/NavbarBrand.vue +++ b/site/docs/.vuepress/theme/components/NavbarBrand.vue @@ -19,7 +19,7 @@ const themeLocale = useThemeLocaleData(); const version = ref(pageData.value.version); const navbarBrandLink = computed( - () => themeLocale.value.home || routeLocale.value + () => themeLocale.value.home || routeLocale.value, ); const navbarBrandTitle = computed(() => siteLocale.value.title); const navbarBrandLogo = computed(() => { @@ -35,7 +35,7 @@ const NavbarBrandVersion = () => { class: "navbar-version", }, - `v${version.value}` + `v${version.value}`, ); const NavbarBrandLogo = () => { diff --git a/site/docs/.vuepress/theme/components/NavbarDropdown.vue b/site/docs/.vuepress/theme/components/NavbarDropdown.vue index d13ff30e2..4aabb7f1d 100644 --- a/site/docs/.vuepress/theme/components/NavbarDropdown.vue +++ b/site/docs/.vuepress/theme/components/NavbarDropdown.vue @@ -16,7 +16,7 @@ const props = defineProps({ const { item } = toRefs(props); const dropdownAriaLabel = computed( - () => item.value.ariaLabel || item.value.text + () => item.value.ariaLabel || item.value.text, ); const open = ref(false); @@ -25,7 +25,7 @@ watch( () => route.path, () => { open.value = false; - } + }, ); /** diff --git a/site/docs/.vuepress/theme/components/RightMenu.vue b/site/docs/.vuepress/theme/components/RightMenu.vue index 3a6bd5950..868cedcb6 100644 --- a/site/docs/.vuepress/theme/components/RightMenu.vue +++ b/site/docs/.vuepress/theme/components/RightMenu.vue @@ -18,7 +18,7 @@ SRC: https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/vdoing/compone > {{ item.title }} @@ -35,7 +35,7 @@ SRC: https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/vdoing/compone > {{ subItem.title }} @@ -82,7 +82,7 @@ watch(useRoute(), () => {