陳彥丞
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `redmine` Draw io 安裝及redmine 整合 ===================== # 安裝編譯環境 ## 安裝 java sdk ### ubuntu sudo apt-get install software-properties-common sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk ### CentOS sudo yum install -y ant java-1.8.0-openjdk-devel ### 測試是否安裝成功 (有顯示版本即可) java -version ![](https://i.imgur.com/1m4XVAI.png) javac -version ![](https://i.imgur.com/DiPQWe3.png) ## 安裝 Ant ### Ubuntu sudo apt-get install ant ### CentOS sudo yum install -y ant ### 測試是否安裝成功 (有顯示版本即可) ant -version ![](https://i.imgur.com/75tZvin.png) # 下載 Git Repository git clone https://github.com/jgraph/draw.io.git --depth=1 :::info --depth=1 : 只下載最後一個commit。 ::: ## 修改 Source code 由於要整合redmine ,需修改draw io 的source code , 作者 patch 資訊如下: ::: info https://github.com/mikitex70/redmine_drawio/blob/master/embed2js.patch ::: ### etc/build/build.xml 1. 刪掉 excludes="**/EmbedServlet2.java" ![](https://i.imgur.com/8df2abs.png) ### src/main/java/com/mxgraph/online/EmbedServlet2.java 1. 遮掉 import com.google.appengine.api.utils.SystemProperty; ``` java //import com.google.appengine.api.utils.SystemProperty; ``` 2. 替換 public EmbedServlet2() , lastModified method ``` java lastModified = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US).format(new Date()); ``` ![](https://i.imgur.com/DV3cOBd.png) # 編譯 cd draw.io/etc/build ant war # 解壓縮draw io 文件 ant 編譯成功後,預設於 "draw.io/build" 會產生 draw.war 檔 cd draw.io/build jar -xvf draw.war ::: info 解壓縮後的文件為web server 主要運行的東西,可直接解壓縮至 /var/www/ or /dev/www 相關的目錄,隨你高興,只要nginx 的root path 設對就好。 ::: # 測試 * 若有裝 python,可使用內建 HTTPServer 測試看可否運行。 draw.war 解壓縮後,於剛剛根目錄下執行以下指令: ``` bash python -m SimpleHTTPServer 8000 ``` * 開啟瀏覽器,輸入localhost:8000,測試是否可運行 ![](https://i.imgur.com/Ro4vx1S.png) # Nginx 代理伺服器設定 ## 安裝 略... ## 增加 nginx site 設定 cd /etc/nginx/ sudo vim sites-available/drawio ::: info 請自行修改 listen 、server_name 、root 等參數。 * 此範例是將draw.war 解壓縮至draw.io/build 中。 * 監聽的port 為8800。 * Http: ``` nginx server { listen 8800; server_name drawio.test.com; charset utf-8; root /home/redmine/draw.io/build; index index.html index.htm; location / { root /home/redmine/draw.io/build; index index.html index.htm; } } ``` * Https: ::: ## 建立 enabled 連結 sudo ln -s /etc/nginx/sites-available/drawio /etc/nginx/sites-enabled ## 測試 nginx site 設定是否有誤 sudo nginx -t ## 重新啟動 nginx sudo service nginx restart or sudo systemctl restart nginx ## 使用瀏覽器開啟剛剛設定的 port ![](https://i.imgur.com/6Uu5gzG.png) 成功!! # 安裝redmine draw io plugin cd redmine/plugins git clone https://github.com/mikitex70/redmine_drawio.git --depth=1 # 重啟redmine server 重新開啟 redmine service sudo service redmine restart ## 設定 redmine API ![](https://i.imgur.com/SIKDLsU.png) ## 設定 Redmine Drawio Plugin Administration -> Plugins -> Redmine Drawio Plugin -> Configure 修改前: ![](https://i.imgur.com/Jw8BenM.png) 修改後: ![](https://i.imgur.com/URiWKWA.png) ## 功能測試 注意事項: ::: info 1. 操作步驟(以建立 issue 為例): * Step 1. 點選 Textile 編輯器 ![](https://i.imgur.com/AYkttve.png) * Step 2. 點選 draw io 按鈕 ![](https://i.imgur.com/QdS8kBd.png) * Step 3. 輸入name 及選擇圖片格式後按下Insert macro,於編輯視窗內會產生一段程式碼。 ![](https://i.imgur.com/dNlRO3K.png) ![](https://i.imgur.com/YH32sMn.png) * Step 4. 按下 ![](https://i.imgur.com/jBjEr2W.png) 儲存該issue * Step 5. 進入剛建立的issue,然後於Desciption 欄位中點選以下圖示: ![](https://i.imgur.com/Fcd5INF.png) * Step 6. 點選後會跳至 draw io serice page ,編輯完成後,按下右上方的save儲存該圖片。 2. 使用draw io 首次建立該圖片的macro 時,請務必先儲存後再點選 draw io 編輯連結 **(Double clock to start drawing)** ::: :::warning * 建立新issue 時,插入draw io macro ,首次建立產生draw io的連結,需要先儲存issue 後再點選 以下圖片進行編輯: * draw io 編輯連結 ![](https://i.imgur.com/E4q8kpL.png) * 建立建立新issue ![](https://i.imgur.com/irP7SLo.png) * Wiki 建立 draw io的連結 一樣要先儲存後再編輯draw io,否則會有以下訊息: ![](https://i.imgur.com/Cd7qDB9.png) ::: ## 建議事項 測試發現由於Redmine Drawio Plugin 使用 =={{drawio_attach(test.png)}}== macro, 需要先進行儲存來產生圖檔連結,故建議修改相關檔案(drawio_jstoolbar-xx.js)的錯誤訊息: :::info Note: Drawio 可使用 DMSF plugin 的 webdav功能來處理需首次存檔產生圖檔連結問題,但需使用另一個==macro{{drawio_dmsf(test.png)}}== 此作法圖檔會統一存在DMSF plugin 所設定的 webdav 目錄,不會存在redmine 的預設檔案系統中. DMSF plugin: https://github.com/danmunn/redmine_dmsf ::: example: redmine_drawio\assets\javascripts\lang\drawio_jstoolbar-zh-tw.js ``` javascript [修改前] Drawio.strings['drawio_http_404' ] = '請確認文件總管模組的 WebDAV 功能已啟用'; [修改後] Drawio.strings['drawio_http_404' ] = 'DMSF 套件未安裝,請先按下儲存後再點擊"Double Click To Start drawing"按鈕進行編輯.\n(DMSF module not install,Please press save and then click the "Double Click To Start drawing"button to edit)'; ``` example: redmine_drawio\assets\javascripts\lang\drawio_jstoolbar-en.js ``` javascript [修改前] Drawio.strings['drawio_http_404' ] = 'Make sure WebDAV capabilities of DMSF module is enabled'; [修改後] Drawio.strings['drawio_http_404' ] = 'DMSF 套件未安裝,請先按下儲存後再點擊"Double Click To Start drawing"按鈕進行編輯.\n(DMSF module not install,Please press save and then click the "Double Click To Start drawing"button to edit)'; ``` ![](https://i.imgur.com/WknWXjL.png) 參考資料: * https://www.lefer.cn/posts/16902/ * https://github.com/mikitex70/redmine_drawio#using-a-personal-installation-of-drawio * https://github.com/jgraph/drawio/wiki/Building

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully