Adapt website modules and update logs#2
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the Websites feature set by introducing dedicated Config/Domains/SSL management pages, updating website/SSL/OpenResty API models and endpoints accordingly, refreshing localization strings, and improving integration-test logging (moving away from debugPrint to appLogger with raw/parsed response visibility).
Changes:
- Add dedicated website pages for config, domains, and SSL management; simplify Website Detail to navigate into these pages.
- Expand/adjust website + SSL models/APIs (e.g., HTTPS config typed models, PHP version update endpoint, richer
WebsiteInfofields). - Update website/OpenResty integration tests to log via
appLoggerand include raw vs parsed payloads; refresh l10n strings.
Reviewed changes
Copilot reviewed 37 out of 41 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/api_client/website_ssl_api_client_test.dart | Replaces debugPrint with structured logger output; adds raw/parsed request logging for SSL/HTTPS endpoints. |
| test/api_client/website_domain_api_client_test.dart | Adds destructive domain add/update/delete integration coverage with raw request logging. |
| test/api_client/website_config_api_client_test.dart | Adds integration coverage for config/scope/nginx update endpoints with raw/parsed logging. |
| test/api_client/website_api_client_test.dart | Improves integration test config validation + adds raw/parsed logging for website search/detail endpoints. |
| test/api_client/openresty_api_client_test.dart | Improves OpenResty tests with raw/parsed logging and adds scope endpoint coverage. |
| pubspec.lock | Updates resolved transitive dependency versions. |
| lib/l10n/generated/app_localizations_zh.dart | Adds new zh strings for new Websites/OpenResty UI and common actions. |
| lib/l10n/generated/app_localizations_en.dart | Adds new en strings for new Websites/OpenResty UI and common actions. |
| lib/l10n/generated/app_localizations.dart | Adds new localization keys to the generated interface. |
| lib/l10n/app_zh.arb | Adds new zh ARB entries for new pages/actions. |
| lib/l10n/app_en.arb | Adds new en ARB entries for new pages/actions. |
| lib/features/websites/websites_page.dart | Uses WebsiteInfo.displayDomain for safer display of website name/domain. |
| lib/features/websites/website_ssl_page.dart | New SSL management page + provider (HTTPS config, cert list/actions, download/apply/resolve/update). |
| lib/features/websites/website_domain_page.dart | New domain management page + provider (list/add/toggle SSL/delete). |
| lib/features/websites/website_detail_page.dart | Refactors detail page into overview/actions + navigation to new management pages. |
| lib/features/websites/website_config_page.dart | New config management page + provider (nginx file editor, scope params editing, PHP version update). |
| lib/data/models/website_models.dart | Expands website request/response models; introduces displayDomain, scope-related models, richer domain/server info. |
| lib/data/models/ssl_models.dart | Expands SSL models; adds typed Website HTTPS config + update request models; refines SSL create/apply/resolve/search/update/upload models. |
| lib/api/v2/website_v2.dart | Updates website endpoints to use typed HTTPS models; adds PHP version update API; removes status filter parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+149
to
+152
| final configContent = provider.nginxConfigFile?.content ?? ''; | ||
| if (_configController.text.isEmpty || _configController.text == configContent) { | ||
| _configController.text = configContent; | ||
| } |
Comment on lines
+185
to
+189
| await provider.updatePhpVersion(runtimeId); | ||
| if (!context.mounted) return; | ||
| ScaffoldMessenger.of(context).showSnackBar( | ||
| SnackBar(content: Text(l10n.commonSaveSuccess)), | ||
| ); |
Comment on lines
+78
to
+83
| try { | ||
| final resp = await _sslApi!.getWebsiteSSLByWebsiteId(websiteId); | ||
| websiteSsl = resp.data; | ||
| } catch (_) { | ||
| websiteSsl = null; | ||
| } |
Comment on lines
+142
to
+146
| final rawScope = await _rawPost(client, '/websites/config', data: scopeRequest); | ||
| final scopeData = (rawScope.data ?? const {})['data']; | ||
|
|
||
| if (scopeData is! Map<String, dynamic> || !scopeData.containsKey('params')) { | ||
| appLogger.wWithPackage('test.api_client.website_config', 'scope 返回不包含 params,跳过 /websites/config/update'); |
Comment on lines
+256
to
+270
| FilledButton.icon( | ||
| onPressed: isRunning ? null : () => onOperate('start'), | ||
| icon: const Icon(Icons.play_arrow), | ||
| label: Text(l10n.websitesActionStart), | ||
| ), | ||
| ), | ||
| const SizedBox(width: 12), | ||
| FilledButton( | ||
| onPressed: onLoad, | ||
| child: Text(l10n.commonLoad), | ||
| ), | ||
| const SizedBox(width: 12), | ||
| FilledButton.icon( | ||
| onPressed: onSave, | ||
| icon: const Icon(Icons.save), | ||
| label: Text(l10n.commonSave), | ||
| ), | ||
| ], | ||
| ), | ||
| const SizedBox(height: 12), | ||
| Expanded( | ||
| child: TextField( | ||
| controller: contentController, | ||
| expands: true, | ||
| maxLines: null, | ||
| minLines: null, | ||
| textAlignVertical: TextAlignVertical.top, | ||
| decoration: InputDecoration( | ||
| hintText: l10n.websitesRewriteHint, | ||
| border: const OutlineInputBorder(), | ||
| ), | ||
| FilledButton.icon( | ||
| onPressed: isRunning ? () => onOperate('stop') : null, | ||
| icon: const Icon(Icons.stop), | ||
| label: Text(l10n.websitesActionStop), | ||
| ), | ||
| OutlinedButton.icon( | ||
| onPressed: isRunning ? () => onOperate('restart') : null, | ||
| icon: const Icon(Icons.refresh), | ||
| label: Text(l10n.websitesActionRestart), | ||
| ), |
Comment on lines
+135
to
+136
| onToggleSsl: (value) => provider.updateDomainSsl(id: domain.id!, ssl: value), | ||
| onDelete: () => provider.deleteDomain(domain.id!), |
Comment on lines
+225
to
+231
| await provider.updateCertificate( | ||
| WebsiteSSLUpdate( | ||
| id: ssl.id ?? 0, | ||
| primaryDomain: ssl.primaryDomain ?? '', | ||
| provider: ssl.provider ?? '', | ||
| autoRenew: value, | ||
| ), |
Comment on lines
35
to
39
| /// @param status 网站状态(可选) | ||
| /// @param page 页码(可选,默认为1) | ||
| /// @param pageSize 每页数量(可选,默认为10) | ||
| /// @return 网站列表 | ||
| Future<PageResult<WebsiteInfo>> getWebsites({ |
Comment on lines
+225
to
+231
| onPressed: onReload, | ||
| icon: const Icon(Icons.refresh), | ||
| label: Text(l10n.commonRefresh), | ||
| ), | ||
| const SizedBox(width: 12), | ||
| FilledButton.icon( | ||
| onPressed: onSave, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add dedicated website config/domain/SSL pages with expanded API/models and refreshed localization strings. Refresh website-related module API analysis outputs and add official-doc notes plus API test observations in docs. Replace debugPrint usage in website/OpenResty API tests with appLogger while improving raw/parsed logging. Tests not run (requires env/destructive).