|
@@ -37,6 +37,8 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
String installDirectory = "D:/WingServer";
|
|
|
final TextEditingController _directoryController = TextEditingController();
|
|
|
String domain = "";
|
|
|
+ int getwayPort = 8303;
|
|
|
+ int remotePort = 9304;
|
|
|
String ipAddress = ""; //IP+端口
|
|
|
String remoteDeployServerIp = ""; //IP+端口
|
|
|
String emailAccount = '';
|
|
@@ -90,8 +92,9 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
|
|
|
Future<void> _startDeployment(BuildContext context) async {
|
|
|
setState(() {
|
|
|
+ _fetchIpAddress();
|
|
|
_isInstallDirectoryValid = isValidPath(installDirectory);
|
|
|
- _isIpValid = isValidIPAndPort(ipAddress);
|
|
|
+ _isIpValid = getwayPort > 0;
|
|
|
_isEmailValid = emailAccount.trim() != '' && isEmail(emailAccount);
|
|
|
_isEmailServerValid = emailServer.trim() != '';
|
|
|
_isEmailPortValid = smtpPort > 0;
|
|
@@ -105,7 +108,7 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
_isCFSServerUrlValid = cfsServerUrl.trim() != '';
|
|
|
}
|
|
|
if (isRemoteDeployable) {
|
|
|
- _isRemoteDeployServerIpValid = isValidIPAndPort(remoteDeployServerIp);
|
|
|
+ _isRemoteDeployServerIpValid = remotePort > 0;
|
|
|
}
|
|
|
_isShareDirectoryValid = isValidPath(shareDirectory);
|
|
|
});
|
|
@@ -219,8 +222,8 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
void _fetchIpAddress() async {
|
|
|
String? ipAddress = await _publishService.getLocalIPv4Address();
|
|
|
setState(() {
|
|
|
- this.ipAddress = (ipAddress ?? "127.0.0.1") + ":8303";
|
|
|
- this.remoteDeployServerIp = (ipAddress ?? "127.0.0.1") + ":8305";
|
|
|
+ this.ipAddress = (ipAddress ?? "127.0.0.1") + ":$getwayPort";
|
|
|
+ this.remoteDeployServerIp = (ipAddress ?? "127.0.0.1") + ":$remotePort";
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -389,12 +392,12 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
SizedBox(
|
|
|
height: 40,
|
|
|
child: TextFormField(
|
|
|
- controller: TextEditingController(text: ipAddress),
|
|
|
+ initialValue: getwayPort.toString(),
|
|
|
decoration: InputDecoration(
|
|
|
contentPadding:
|
|
|
EdgeInsets.symmetric(vertical: 0.0, horizontal: 10),
|
|
|
- labelText: 'IP',
|
|
|
- hintText: AppLocalizations.of(context)!.ipAuto,
|
|
|
+ labelText: AppLocalizations.of(context)!.getwayPort,
|
|
|
+ hintText: AppLocalizations.of(context)!.getwayPort,
|
|
|
border: OutlineInputBorder(
|
|
|
borderSide: BorderSide(
|
|
|
color: Colors.grey.withOpacity(0.5),
|
|
@@ -418,9 +421,8 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
),
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- ipAddress = value;
|
|
|
- _isIpValid =
|
|
|
- value.trim() != '' && isValidIPAndPort(value);
|
|
|
+ getwayPort = int.tryParse(value) ?? 0;
|
|
|
+ _isIpValid = getwayPort > 0;
|
|
|
});
|
|
|
},
|
|
|
),
|
|
@@ -965,13 +967,13 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
if (isRemoteDeployable) ...[
|
|
|
SizedBox(height: 18),
|
|
|
TextFormField(
|
|
|
- initialValue: remoteDeployServerIp,
|
|
|
+ initialValue: remotePort.toString(),
|
|
|
decoration: InputDecoration(
|
|
|
contentPadding:
|
|
|
EdgeInsets.symmetric(vertical: 0.0, horizontal: 10),
|
|
|
labelText: AppLocalizations.of(context)!.remoteDeployIp,
|
|
|
hintText: AppLocalizations.of(context)!
|
|
|
- .remoteDeployIpHintText,
|
|
|
+ .remoteDeployIp,
|
|
|
border: OutlineInputBorder(
|
|
|
borderSide: BorderSide(
|
|
|
color: Colors.grey.withOpacity(0.5),
|
|
@@ -995,9 +997,8 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
),
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- remoteDeployServerIp = value;
|
|
|
- _isRemoteDeployServerIpValid =
|
|
|
- value.trim() != '' && isValidIPAndPort(value);
|
|
|
+ remotePort = int.tryParse(value) ?? 0;
|
|
|
+ _isRemoteDeployServerIpValid = remotePort > 0;
|
|
|
});
|
|
|
},
|
|
|
),
|
|
@@ -1231,14 +1232,14 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
},
|
|
|
),
|
|
|
),
|
|
|
- SizedBox(height: 35),
|
|
|
+ SizedBox(height: 50),
|
|
|
],
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
if (_isDeploying)
|
|
|
Container(
|
|
|
- color: Colors.black.withOpacity(0.2),
|
|
|
+ color: Colors.black.withOpacity(0.1),
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
height: MediaQuery.of(context).size.height,
|
|
|
child: Column(
|
|
@@ -1256,7 +1257,7 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
),
|
|
|
bottomNavigationBar: _isDeploying
|
|
|
? Container(
|
|
|
- color: Colors.black.withOpacity(0.2),
|
|
|
+ color: Colors.black.withOpacity(0.1),
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
height: MediaQuery.of(context).size.height,
|
|
|
child: Column(
|
|
@@ -1271,10 +1272,11 @@ class _PublishProcessViewState extends State<PublishProcessView> {
|
|
|
),
|
|
|
)
|
|
|
: Container(
|
|
|
- height: 100,
|
|
|
+ height: 150,
|
|
|
child: Align(
|
|
|
alignment: FractionalOffset.center, // 将对齐设置为底部容器的中心
|
|
|
child: ElevatedButton(
|
|
|
+ style: ElevatedButton.styleFrom(minimumSize: Size(150,50)),
|
|
|
onPressed: () => _startDeployment(context),
|
|
|
child: Text(AppLocalizations.of(context)!.startDeployment),
|
|
|
),
|