Skip to content

Adapt website modules and update logs#2

Merged
IsKenKenYa merged 1 commit into
网站管理from
WangZhanGuanLi
Mar 13, 2026
Merged

Adapt website modules and update logs#2
IsKenKenYa merged 1 commit into
网站管理from
WangZhanGuanLi

Conversation

@IsKenKenYa
Copy link
Copy Markdown
Owner

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).

Copilot AI review requested due to automatic review settings March 13, 2026 11:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WebsiteInfo fields).
  • Update website/OpenResty integration tests to log via appLogger and 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,
@IsKenKenYa IsKenKenYa merged commit 79732b4 into 网站管理 Mar 13, 2026
4 checks passed
@IsKenKenYa IsKenKenYa deleted the WangZhanGuanLi branch March 13, 2026 11:55
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