B.4. 사용자 인터페이스 플러그인 배포 예

Red Hat Enterprise Virtualization Manager 관리 포털에 로그인 시 Hello World! 프로그램을 실행하는 사용자 인터페이스 플러그인을 생성하기 위해 다음과 같은 지시 사항을 따릅니다.

절차 B.2. Hello World! 플러그인 배포

  1. /usr/share/ovirt-engine/ui-plugins/helloWorld.json에 있는 Manager에 다음과 같은 파일을 생성하여 플러그인 설명자를 생성합니다:
    {
        "name": "HelloWorld",
        "url": "/ovirt-engine/webadmin/plugin/HelloWorld/start.html",
        "resourcePath": "hello-files"
    }
    
  2. /usr/share/ovirt-engine/ui-plugins/hello-files/start.html에 있는 Manager에 다음과 같은 파일을 생성하여 플러그인 호스트 페이지를 생성합니다:
    <!DOCTYPE html><html><head>
    <script>
        var api = parent.pluginApi('HelloWorld');
        api.register({
    	UiInit: function() { window.alert('Hello world'); }
        });
        api.ready();
    </script>
    </head><body></body></html>
    
Hello World! 플러그인을 성공적으로 구현했을 경우 관리 포털에 로그인했을 때 다음과 같은 화면이 표시됩니다:
Hello World! 플러그인의 구현

그림 B.1. Hello World! 플러그인의 구현