Skip to content

WebUIの追加#116

Merged
ayutaz merged 28 commits intodevelopfrom
feat/add_web_ui
Feb 3, 2025
Merged

WebUIの追加#116
ayutaz merged 28 commits intodevelopfrom
feat/add_web_ui

Conversation

@eiei114
Copy link
Contributor

@eiei114 eiei114 commented Feb 2, 2025

変更事項

  • WebUI追加
  • ローカルホストサーブ機能追加
  • 二重でサーバーを建てないようにした
  • WebUIからサーバーとタブを落とす機能追加
  • WebUIのボタンを押すとしゃべる機能追加

確認方法

  • 開いたらキャラクターを右クリックしWebUIボタンを押す
  • どのブラウザで開くかオプションが出てwebUIを開くブラウザを選択
    image
  • ボイス再生ボタンを押したらランダムで声を出す
    image
    この表示が出ていたら正常
    image
  • WebUIの処理を停止して終了ボタンを押すとWebUIタブが閉じる
    image

ビルド成果物

https://github.com/MidraLab/uDesktopMascot/actions/runs/13100222095
https://github.com/MidraLab/uDesktopMascot/actions/runs/13100430544
https://github.com/MidraLab/uDesktopMascot/actions/runs/13107293891 <---こちら

- Implement WebServer initialization in SystemManager
- Create PlayVoiceHandler and PlayVoiceUseCase for voice control
- Add Router to manage API routes
- Automatically open WebUI HTML on server startup
@eiei114 eiei114 requested a review from ayutaz February 2, 2025 13:20
@eiei114 eiei114 self-assigned this Feb 2, 2025
…Handler

- Remove default CreateHandlerAction method from IRequestHandler interface
- Remove implementation of CreateHandlerAction in PlayVoiceHandler
- Simplify request handler interface design
- Modify PostBuildProcessor to copy WebUI files to StreamingAssets during build
- Update SystemManager to use StreamingAssets path for WebUI in non-editor builds
- Improve WebUI file handling and error logging
- Enable WebUI button in TabletMenu prefab
- Implement WebUI button click handler in MenuPresenter
- Add WebUI action to MenuView for opening WebUI HTML
- Remove WebUI opening logic from SystemManager
- Implement ShutdownHandler and ShutdownUseCase for graceful web server shutdown
- Update SystemManager to initialize web server on demand and prevent multiple instances
- Modify Router to include shutdown route
- Enhance NetWrapper with improved server stop and disposal methods
- Implement shutdown button in WebUI index.html
- Add client-side shutdown function with GET request to /api/shutdown
- Include beforeunload event listener for automatic shutdown attempt
- Add warning text explaining the need to use shutdown button
- Update SystemManager to handle existing web server instances more gracefully
- Modify ShutdownUseCase to ensure proper server disposal
- Add CORS header to shutdown API response for cross-origin support
…ng classes

- Add comprehensive XML documentation to SystemManager, MenuPresenter, and web-related classes
- Include method descriptions, parameter explanations, and return value details
- Improve code readability and provide better inline documentation for web server components
…UseCase

- Add comprehensive XML documentation to ShutdownHandler methods
- Include method descriptions, parameter explanations, and return value details
- Enhance PlayVoiceUseCase with XML documentation for methods and their purposes
@eiei114 eiei114 changed the title 【WIP】WebUIの追加 WebUIの追加 Feb 2, 2025
- Remove redundant Log.Info calls in PlayRandomVoiceUseCase and PlaySpecificVoiceUseCase
- Maintain existing voice playback functionality
- Improve code cleanliness by eliminating unnecessary logging
- Move inline styles from index.html to a new external CSS file (styles.css)
- Create css folder in WebUI directory
- Update index.html to link external stylesheet
- Add necessary meta files for Unity compatibility
- Consolidate HTTP method handlers into a single nested dictionary
- Streamline RegisterHandler method to support multiple HTTP methods
- Improve request processing logic with more concise method routing
- Add System.Net.Http.HttpMethod for better method type handling
- Move Handlers and UseCases into the main Web.Application namespace
- Update import statements across affected files
- Simplify namespace organization for Web Application components
- Update StopServer method to accept a custom timeout parameter
- Default timeout remains 1 second for backward compatibility
- Improve flexibility of server shutdown process
- Replace NetWrapper direct usage in SystemManager with WebServiceHost
- Create new WebServiceHost class to encapsulate web server initialization and lifecycle
- Simplify web server startup and shutdown logic
- Remove direct NetWrapper dependencies from ShutdownUseCase
- Update SystemManager to use WebServiceHost for web server operations
- Remove unnecessary UnityEngine import from ShutdownHandler
- Clean up import statements to reduce unused dependencies
- Remove unnecessary empty method in SystemManager
- Clean up code by eliminating redundant whitespace and empty method
- Improve XML documentation comment for WebServiceHost
- Replace generic comment with a more descriptive explanation of the class's purpose
- Enhance code readability by providing a clearer class description
…k namespace

- Update namespace declarations for Web components
- Remove nested Framework namespace from Infrastructure
- Update import statements across affected files
- Consolidate namespace organization for Web infrastructure classes
- Reorder and clean up import statements in WebServiceHost, NetWrapper, and Router
- Improve code readability by standardizing import order
- Remove unnecessary imports and consolidate existing ones
…use cases

- Remove unnecessary domain interfaces and consolidate import statements
- Update import statements in PlayVoiceHandler and ShutdownHandler
- Add missing uDesktopMascot namespace import in use case files
- Simplify and standardize namespace imports across Web Application components
- Clean up import statements in Web Application and Infrastructure files
- Remove unused UnityEngine and uDesktopMascot imports
- Simplify namespace imports across multiple components
- Refactor PlayVoiceHandler and ShutdownHandler to use separate async methods
- Extract async request handling logic from lambda expressions
- Simplify UniTask usage in handler methods
- Update Router import statements to remove unnecessary dependencies
- Remove redundant comment about 1-second wait timeout
- Improve code clarity by removing unnecessary inline comment
@ayutaz ayutaz merged commit e149f10 into develop Feb 3, 2025
5 checks passed
@ayutaz ayutaz deleted the feat/add_web_ui branch February 3, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants