diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 771e3d1d73..cf2a7a8ea9 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/configs/sidebar/en.js b/site/docs/.vuepress/configs/sidebar/en.js index bb4d705cbf..b5f4387483 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/auth.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/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/cls.md", - "/en/doc/echo.md", - "/en/doc/grep.md", - "/en/doc/help.md", - "/en/doc/history.md", - "/en/doc/keymap.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 9efdc4ac16..c8d7d75fa5 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/auth.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/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/cls.md", - "/doc/echo.md", - "/doc/grep.md", - "/doc/help.md", - "/doc/history.md", - "/doc/keymap.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/public/doc/arthas-tutorials.html b/site/docs/.vuepress/public/doc/arthas-tutorials.html index 63121ffa5b..e00bf1aac0 100644 --- a/site/docs/.vuepress/public/doc/arthas-tutorials.html +++ b/site/docs/.vuepress/public/doc/arthas-tutorials.html @@ -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,17 +1174,33 @@ 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/RightMenu.vue b/site/docs/.vuepress/theme/components/RightMenu.vue index 3a6bd5950d..868cedcb62 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(), () => {