Skip to content

luci-app-upnp: Add Expires to port map listing - #7481

Merged
systemcrash merged 1 commit into
openwrt:masterfrom
Self-Hosting-Group:add-expires
Dec 24, 2024
Merged

luci-app-upnp: Add Expires to port map listing#7481
systemcrash merged 1 commit into
openwrt:masterfrom
Self-Hosting-Group:add-expires

Conversation

@Self-Hosting-Group

Copy link
Copy Markdown
Contributor

Status/overview UI:

openwrt-status-overview
Screenshot 23.05 release

The Port Control Protocol (PCP) is the successor to NAT-PMP, has similar protocol concepts and packet formats, but adds support for IPv6 port maps and options/extensions. For more information, see:
Port Mapping Protocols Overview and Comparison 2024: About UPnP IGD & PCP/NAT-PMP
https://github.com/Self-Hosting-Group/wiki/wiki/Port-Mapping-Protocols-Overview

Maintainer: @jow-

Previous improvement: #7407

@Self-Hosting-Group

Self-Hosting-Group commented Dec 18, 2024

Copy link
Copy Markdown
Contributor Author

Draft, as the cell should have a text-align: right to display correctly, the following CSS would still need to be inserted, or can the alignment be set via the LuCI API?

#upnp_status_table th:nth-child(6),
#upnp_status_table td:nth-child(6) {
	text-align: right;
}

The time calculation is done on the client, the backend would probably be more accurate.

I chose expires because it is clear, short and should be easy to translate. However, another term could be used, the following come to mind:

Port map ...

  • valid until
  • expiration
  • time left
  • duration
  • lifetime
  • expires
  • expiry
  • valid

Could be a nice thing for the 24.10 release.

Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 18, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 23, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
@Self-Hosting-Group
Self-Hosting-Group marked this pull request as ready for review December 23, 2024 15:51
Comment thread applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js Outdated
Comment thread applications/luci-app-upnp/htdocs/luci-static/resources/view/upnp/upnp.js Outdated
Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 23, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 23, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

Thanks for simplifying the code. I have taken your suggestions and re-tested. The code runs on the frontend, which is fine, only the noted CSS would complete the PR.

@systemcrash

Copy link
Copy Markdown
Contributor

OK, did you re-run i18n-sync after the js changes?

@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

OK, did you re-run i18n-sync after the js changes?

Yes. Can the CSS code above be added?

@systemcrash

Copy link
Copy Markdown
Contributor

Above?

@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

Above?

First comment.

@systemcrash

Copy link
Copy Markdown
Contributor

Sure. Test the CSS for that column. But it might be a bit over-engineered to do so. Maybe Expiry would be better?

@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

Sure. Test the CSS for that column. But it might be a bit over-engineered to do so. Maybe Expiry would be better?

But the Expires can also include hours and the right-hand alignment would actually be good. I understand Expires better as a non-native speaker. CSS is already tested.

@systemcrash

Copy link
Copy Markdown
Contributor

Add the equivalent style to that column.

Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 23, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
Self-Hosting-Group added a commit to Self-Hosting-Group/luci that referenced this pull request Dec 24, 2024
Close openwrt#7481

Signed-off-by: Self-Hosting-Group <selfhostinggroup-git+openwrt@shost.ing>
@Self-Hosting-Group
Self-Hosting-Group force-pushed the add-expires branch 2 times, most recently from a6c15f9 to cb1d696 Compare December 24, 2024 07:00
@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

I discovered the CSS class right, I think this is the most elegant solution, and set the class via JS.

I have also just written the first ucode to perform the most important function of the expires calculation with the backend/router time.

@systemcrash
systemcrash merged commit 075b59f into openwrt:master Dec 24, 2024
@systemcrash

Copy link
Copy Markdown
Contributor

Merged. Thanks @Self-Hosting-Group

@Self-Hosting-Group

Copy link
Copy Markdown
Contributor Author

@systemcrash Happy 2025! Thanks to you too. Cool how quickly we were able to get this PR done.

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