mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08fcd7a87d | ||
|
|
f39c7a15c7 | ||
|
|
1c239d435b | ||
|
|
d8cba97d05 | ||
|
|
a362a3fa7f | ||
|
|
4163f2a53f | ||
|
|
e556dd1804 | ||
|
|
96ad55b930 | ||
|
|
9dc1a10255 | ||
|
|
db4a041bc4 | ||
|
|
661f591bf5 | ||
|
|
e81bcfbfee | ||
|
|
e8ba07aebd | ||
|
|
9930226dc0 | ||
|
|
48491767cb | ||
|
|
49229b9dac | ||
|
|
ecf3287e61 | ||
|
|
206b305ae6 | ||
|
|
70e7a87189 | ||
|
|
5aef1c0a89 | ||
|
|
7745abbb8a | ||
|
|
e577dba7c9 | ||
|
|
ed63d5c029 | ||
|
|
2aa82a73a0 |
@@ -0,0 +1,55 @@
|
||||
name: Package
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B install --file pom.xml
|
||||
|
||||
- name: Rename GUI artifact
|
||||
run: mv vripper-gui/target/vripper-gui-*.jar vripper-gui/target/vripper-gui.jar
|
||||
|
||||
- name: Rename WEB artifact
|
||||
run: mv vripper-web/target/vripper-web-*.jar vripper-web/target/vripper-web.jar
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Package Linux binaries
|
||||
run: |
|
||||
cd jpackage
|
||||
cp ../vripper-gui/target/vripper-gui.jar jar/vripper-gui.jar
|
||||
jpackage --type deb "@jpackage.cfg" "@jpackage-linux.cfg"
|
||||
jpackage --type rpm "@jpackage.cfg" "@jpackage-linux.cfg"
|
||||
ls -la dist
|
||||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Package Windows binaries
|
||||
run: |
|
||||
cd jpackage
|
||||
cp ../vripper-gui/target/vripper-gui.jar jar/vripper-gui.jar
|
||||
jpackage "@jpackage.cfg" "@jpackage-windows.cfg"
|
||||
dir dist
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Package macOS binaries
|
||||
run: |
|
||||
cd jpackage
|
||||
cp ../vripper-gui/target/vripper-gui.jar jar/vripper-gui.jar
|
||||
jpackage "@jpackage.cfg" "@jpackage-macos.cfg"
|
||||
ls -la dist
|
||||
+123
-22
@@ -1,6 +1,3 @@
|
||||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
|
||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
|
||||
|
||||
name: Release
|
||||
|
||||
on:
|
||||
@@ -9,11 +6,13 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
@@ -22,22 +21,124 @@ jobs:
|
||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B install --file pom.xml
|
||||
- name: Rename GUI artifact
|
||||
run: mv vripper-gui/target/vripper-gui-*.jar vripper-gui/target/vripper-gui.jar
|
||||
- name: Upload GUI Binary
|
||||
uses: skx/github-action-publish-binaries@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build Core Jar
|
||||
run: mvn -B -q install --file vripper-core/pom.xml
|
||||
|
||||
- name: Build GUI Jar
|
||||
run: mvn -B -q install --file vripper-gui/pom.xml
|
||||
|
||||
- name: Rename GUI Jar
|
||||
run: mv vripper-gui/target/vripper-gui-${{ github.event.release.tag_name }}.jar vripper-gui/target/vripper-noarch-gui-${{ github.event.release.tag_name }}.jar
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Upload GUI Jar
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
args: 'vripper-gui/target/vripper-gui.jar'
|
||||
- name: Rename WEB artifact
|
||||
run: mv vripper-web/target/vripper-web-*.jar vripper-web/target/vripper-web.jar
|
||||
- name: Upload WEB Binary
|
||||
uses: skx/github-action-publish-binaries@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: vripper-gui/target/vripper-noarch-gui-${{ github.event.release.tag_name }}.jar
|
||||
|
||||
# Start building WEB jar in ubuntu only
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Build WEB Jar
|
||||
run: |
|
||||
mvn -B -q install --file vripper-web-ui/pom.xml
|
||||
mvn -B -q install --file vripper-web/pom.xml
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Rename WEB Jar
|
||||
run: mv vripper-web/target/vripper-web-${{ github.event.release.tag_name }}.jar vripper-web/target/vripper-noarch-web-${{ github.event.release.tag_name }}.jar
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Upload WEB Jar
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
args: 'vripper-web/target/vripper-web.jar'
|
||||
files: vripper-web/target/vripper-noarch-web-${{ github.event.release.tag_name }}.jar
|
||||
# End building WEB jar in ubuntu only
|
||||
|
||||
- name: Prepare Packaging
|
||||
run: |
|
||||
cp vripper-gui/target/vripper-noarch-gui-${{ github.event.release.tag_name }}.jar jpackage/jar/vripper-gui.jar
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Package Linux
|
||||
run: |
|
||||
cd jpackage
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-app-image.cfg" --icon icon.png
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-linux.cfg" --type deb
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-linux.cfg" --type rpm
|
||||
mv dist/vripper-${{ github.event.release.tag_name }}-1.x86_64.rpm dist/vripper-linux-${{ github.event.release.tag_name }}.x86_64.rpm
|
||||
mv dist/vripper_${{ github.event.release.tag_name }}-1_amd64.deb dist/vripper-linux-${{ github.event.release.tag_name }}_amd64.deb
|
||||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Package Windows
|
||||
run: |
|
||||
cd jpackage
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-app-image.cfg" --icon icon.ico
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-windows.cfg" --type msi
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-windows.cfg" --type exe
|
||||
cd dist
|
||||
ren VRipper-${{ github.event.release.tag_name }}.msi vripper-windows-installer-${{ github.event.release.tag_name }}.msi
|
||||
ren VRipper-${{ github.event.release.tag_name }}.exe vripper-windows-installer-${{ github.event.release.tag_name }}.exe
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Package macOS
|
||||
run: |
|
||||
cd jpackage
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-app-image.cfg" --icon icon.icns
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-macos.cfg" --type pkg
|
||||
jpackage --app-version ${{ github.event.release.tag_name }} "@jpackage.cfg" "@jpackage-macos.cfg" --type dmg
|
||||
mv dist/VRipper-${{ github.event.release.tag_name }}.pkg dist/vripper-macos-${{ github.event.release.tag_name }}.pkg
|
||||
mv dist/VRipper-${{ github.event.release.tag_name }}.dmg dist/vripper-macos-${{ github.event.release.tag_name }}.dmg
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Zip portable
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
directory: 'jpackage/dist'
|
||||
path: 'VRipper'
|
||||
filename: 'vripper-linux-portable-${{ github.event.release.tag_name }}.zip'
|
||||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Zip portable
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
directory: 'jpackage/dist'
|
||||
path: 'VRipper'
|
||||
filename: 'vripper-windows-portable-${{ github.event.release.tag_name }}.zip'
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Zip portable
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
directory: 'jpackage/dist'
|
||||
path: 'VRipper.app'
|
||||
filename: 'vripper-macos-portable-${{ github.event.release.tag_name }}.zip'
|
||||
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Upload DEB and RPM package for Linux
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
jpackage/dist/vripper-linux-${{ github.event.release.tag_name }}.x86_64.rpm
|
||||
jpackage/dist/vripper-linux-${{ github.event.release.tag_name }}_amd64.deb
|
||||
jpackage/dist/vripper-linux-portable-${{ github.event.release.tag_name }}.zip
|
||||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Upload packages for Windows
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
jpackage/dist/vripper-windows-installer-${{ github.event.release.tag_name }}.msi
|
||||
jpackage/dist/vripper-windows-installer-${{ github.event.release.tag_name }}.exe
|
||||
jpackage/dist/vripper-windows-portable-${{ github.event.release.tag_name }}.zip
|
||||
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Upload package for macOS
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
jpackage/dist/vripper-macos-${{ github.event.release.tag_name }}.pkg
|
||||
jpackage/dist/vripper-macos-${{ github.event.release.tag_name }}.dmg
|
||||
jpackage/dist/vripper-macos-portable-${{ github.event.release.tag_name }}.zip
|
||||
|
||||
-763
@@ -1,763 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## [4.0.0] - 2023-05-03
|
||||
|
||||
- Drop electron app
|
||||
- Use javafx for the desktop app
|
||||
- Re-written in kotlin
|
||||
- Several enhancements
|
||||
|
||||
### Changed
|
||||
|
||||
## [3.5.4] - 2021-05-29
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix download queue bug
|
||||
|
||||
## [3.5.3] - 2021-05-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Update donation infos
|
||||
|
||||
## [3.5.1] - 2021-05-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fix
|
||||
|
||||
## [3.5.0] - 2021-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Download queue bug fix
|
||||
- Save window size and position
|
||||
- Resize confirmation box
|
||||
- Enhance metadata interruption
|
||||
- Add Added on and Order columns
|
||||
|
||||
## [3.4.2] - 2021-05-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix potential issue with imagebam host
|
||||
- Enhance download queue logic
|
||||
- Code source enhancements
|
||||
- Fix app icons
|
||||
- Fix race condition bug
|
||||
|
||||
## [3.3.8] - 2021-05-05
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix imagebam host
|
||||
- Fix font path
|
||||
|
||||
## [3.3.6] - 2021-03-20
|
||||
|
||||
### Changed
|
||||
|
||||
- Optimize build size
|
||||
|
||||
## [3.3.5] - 2021-03-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fixe
|
||||
|
||||
## [3.3.4] - 2021-03-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [3.3.3] - 2021-03-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove unnecessary event logs
|
||||
|
||||
## [3.3.2] - 2021-03-11
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix a bug with event logs
|
||||
- Change event names and add some icons
|
||||
|
||||
## [3.3.1] - 2021-02-18
|
||||
|
||||
### Added
|
||||
|
||||
- Add about menu
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix README.md
|
||||
|
||||
## [3.3.0] - 2021-02-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Add support for proxies
|
||||
- Add a Event Logs
|
||||
- Fix bugs with the database
|
||||
|
||||
## [3.2.3] - 2021-01-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Finished posts are not cleared from the UI
|
||||
|
||||
## [3.2.2] - 2021-01-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Set total download to max value
|
||||
|
||||
## [3.2.1] - 2021-01-12
|
||||
|
||||
### Added
|
||||
|
||||
- Add settings for connection timeout
|
||||
- Add settings for maximum attempts
|
||||
|
||||
### Changed
|
||||
|
||||
- Enhance posts rename logic
|
||||
- Dependencies update
|
||||
- Switch reactive from rx-java to reactor
|
||||
|
||||
## [3.2.0] - 2020-11-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix build issue
|
||||
|
||||
## [3.1.0] - 2020-11-16
|
||||
|
||||
### Changed
|
||||
|
||||
- UI revamp
|
||||
- Fix bugs
|
||||
|
||||
## [3.0.11] - 2020-10-31
|
||||
|
||||
### Added
|
||||
|
||||
- Support for vipr.im
|
||||
|
||||
## [3.0.10] - 2020-10-04
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix bug on settings update
|
||||
|
||||
## [3.0.9] - 2020-09-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Revert to appending post id to download folders
|
||||
- Fix a bug that lead to adding duplicate posts
|
||||
- Remove old unused settings
|
||||
|
||||
## [3.0.8] - 2020-08-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fix which breaks concurrent downloads
|
||||
|
||||
## [3.0.7] - 2020-08-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix MacOs build
|
||||
|
||||
## [3.0.6] - 2020-08-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix TurboImageHost
|
||||
|
||||
## [3.0.5] - 2020-08-17
|
||||
|
||||
### Changed
|
||||
|
||||
- Update packages
|
||||
- Host class refactoring
|
||||
|
||||
## [3.0.4] - 2020-08-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Improve rename UI
|
||||
|
||||
## [3.0.3] - 2020-08-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix bugs with electron app
|
||||
|
||||
## [3.0.2] - 2020-08-15
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix bugs with download queue
|
||||
|
||||
## [3.0.1] - 2020-08-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix bugs with download queue
|
||||
|
||||
## [3.0.0] - 2020-08-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Major rewrites
|
||||
- Introducing a proper database for persistence
|
||||
|
||||
## [2.12.1] - 2020-05-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix alternative name bug
|
||||
|
||||
## [2.12.0] - 2020-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Use new user hash from the api
|
||||
|
||||
## [2.11.7] - 2020-05-08
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix bug with paths creation
|
||||
- Move Open Link button
|
||||
- Rename rename all title
|
||||
|
||||
## [2.11.6] - 2020-05-04
|
||||
|
||||
### Changed
|
||||
|
||||
- PNG filenames are now correctly named
|
||||
- Fix issue with special characters in post titles
|
||||
|
||||
## [2.11.5] - 2020-05-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Reduce rows buffer size
|
||||
|
||||
## [2.11.4] - 2020-05-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Code cleanup
|
||||
- Dependencies update
|
||||
|
||||
## [2.11.3] - 2020-04-30
|
||||
|
||||
### Changed
|
||||
|
||||
- Source code restructure
|
||||
- UI fixes and enhancements
|
||||
|
||||
### Added
|
||||
|
||||
- Add menu entry to rename a gallery to first alternative title
|
||||
- Add menu on toolbar for massive rename to first alternative title
|
||||
|
||||
## [2.11.2] - 2020-04-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [2.11.1] - 2020-04-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Code source maintenance
|
||||
|
||||
### Added
|
||||
|
||||
- Added option to rename gallery
|
||||
|
||||
## [2.11.0] - 2020-03-29
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade Electron to v8
|
||||
- Upgrade Angular to v9
|
||||
- App settings are now portable in a json file
|
||||
- General code source maintenance
|
||||
|
||||
### Added
|
||||
|
||||
- Added Support for pixroute.com
|
||||
- Added grab post title from thread option
|
||||
|
||||
## [2.10.8] - 2020-01-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix app url
|
||||
|
||||
## [2.10.7] - 2020-01-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Drop SockJs and switch to WebSocket
|
||||
- Autoreconnect front to back
|
||||
|
||||
## [2.10.6] - 2020-01-19
|
||||
|
||||
### Changed
|
||||
|
||||
- Limit cache size
|
||||
|
||||
## [2.10.5] - 2020-01-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [2.10.4] - 2020-01-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Zero value for total max download will disable the limit
|
||||
- Add system notification
|
||||
- Bug fixes
|
||||
|
||||
## [2.10.3] - 2020-01-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Some bug fixes
|
||||
- Enhance download queue logic
|
||||
- Clear cache button
|
||||
- Fix the partial status
|
||||
- Sanitize URLs with spaces
|
||||
|
||||
### Added
|
||||
|
||||
- Support for Postimg host
|
||||
- Support for Imagevenue host
|
||||
|
||||
## [2.10.2] - 2019-12-29
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade electron to v7
|
||||
- Bug fix
|
||||
|
||||
## [2.10.1] - 2019-12-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fix
|
||||
|
||||
## [2.10.0] - 2019-12-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix spring dependency bug
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for imgspice
|
||||
|
||||
## [2.9.0] - 2019-12-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix build issue
|
||||
|
||||
## [2.9.0] - 2019-12-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Decrease timeout for fast fail
|
||||
|
||||
### Added
|
||||
|
||||
- Allow many hosts to run at the same time
|
||||
- Add title to gallery
|
||||
- Add global concurrent downloads
|
||||
- Add counter badge in link collector
|
||||
|
||||
## [2.8.1] - 2019-12-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix issue with path creation
|
||||
|
||||
## [2.8.0] - 2019-12-24
|
||||
|
||||
### Added
|
||||
|
||||
- Photo gallery feature
|
||||
|
||||
## [2.7.1] - 2019-12-21
|
||||
|
||||
### Added
|
||||
|
||||
- Add version to title bar
|
||||
|
||||
## [2.7.0] - 2019-12-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Add missing icon
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for pixxxels
|
||||
|
||||
## [2.6.0] - 2019-12-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Disable download button when nothing selected in Link collector grab menu
|
||||
- Better quality app icon
|
||||
- Implement context menu on download tab
|
||||
- Add stop remove and start button to context menu
|
||||
- Link will not be removed automatically from link collector tab
|
||||
- Some UI fixes
|
||||
|
||||
## [2.5.1] - 2019-12-09
|
||||
|
||||
### Changed
|
||||
|
||||
- Disable download button when nothing selected in Link collector grab menu
|
||||
|
||||
### Added
|
||||
|
||||
- Add hosts column in Link collector grab menu
|
||||
|
||||
## [2.5.0] - 2019-12-08
|
||||
|
||||
### Changed
|
||||
|
||||
- Change loading screen
|
||||
- UI Fixes
|
||||
- Fix bug with previews
|
||||
|
||||
### Added
|
||||
|
||||
- Add link collector feature
|
||||
- Add support for multiple links at a time
|
||||
|
||||
## [2.4.1] - 2019-11-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Increase attempts for establishing ws connection between front and back end
|
||||
- Change default download folder to Home folder (installer), App folder (portable)
|
||||
|
||||
## [2.4.0] - 2019-11-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Pimpandhost Host support
|
||||
|
||||
## [2.3.2] - 2019-11-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix a bug with the scan component
|
||||
|
||||
## [2.3.1] - 2019-11-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix connexion reset issue
|
||||
- Fix Post Status when autostart option is selected
|
||||
- Add stop all button
|
||||
|
||||
## [2.3.0] - 2019-11-21
|
||||
|
||||
### Changed
|
||||
|
||||
- UI enhancements and overhaul
|
||||
- Stability fixes with HTTP connections
|
||||
- MacOS official support
|
||||
- Use local sockjs and material icons font
|
||||
|
||||
## [2.2.5] - 2019-11-09
|
||||
|
||||
### Changed
|
||||
|
||||
- Exclude thumbs download for imagezilla and pixhost
|
||||
- Change retry on fail logic (may help avoid having download errors)
|
||||
|
||||
## [2.2.4] - 2019-10-05
|
||||
|
||||
### Added
|
||||
|
||||
- AppImage target for linux
|
||||
|
||||
## [2.2.3] - 2019-10-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Strip libjvm.so for debian
|
||||
|
||||
## [2.2.2] - 2019-10-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Update product name
|
||||
|
||||
## [2.2.1] - 2019-10-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Update dependency list for deb package
|
||||
|
||||
## [2.2.0] - 2019-10-01
|
||||
|
||||
### Added
|
||||
|
||||
- Embedd JRE within the app
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix 'Start' on pending items
|
||||
- Upgrade to Java 11
|
||||
|
||||
## [2.1.0] - 2019-09-30
|
||||
|
||||
### Added
|
||||
|
||||
- Add a create a subfolder per thread option
|
||||
|
||||
## [2.0.4] - 2019-09-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix some issues with ImxHost
|
||||
|
||||
## [2.0.3] - 2019-09-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Update deb dependencies
|
||||
|
||||
## [2.0.2] - 2019-09-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Add portable mode
|
||||
|
||||
## [2.0.1] - 2019-09-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Change app name
|
||||
|
||||
## [2.0.0] - 2019-09-22
|
||||
|
||||
### Added
|
||||
|
||||
- Add sub folder option
|
||||
- Add clear finished option
|
||||
|
||||
### Changed
|
||||
|
||||
- UI enhancements
|
||||
- Bug fixes
|
||||
- Change data and log paths
|
||||
|
||||
## [1.6.5] - 2019-09-18
|
||||
|
||||
### Changed
|
||||
|
||||
- electron update
|
||||
|
||||
## [1.6.4] - 2019-09-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Change menu item name
|
||||
|
||||
## [1.6.3] - 2019-09-18
|
||||
|
||||
### Changed
|
||||
|
||||
- Better multithread management
|
||||
- Fix partial state UI
|
||||
|
||||
## [1.6.2] - 2019-09-17
|
||||
|
||||
### Changed
|
||||
|
||||
- Rework UI colors
|
||||
- Fix scan input bug
|
||||
|
||||
## [1.6.1] - 2019-09-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Rework UI
|
||||
- Fix clipboard monitoring
|
||||
|
||||
## [1.6.0] - 2019-09-15
|
||||
|
||||
### Changed
|
||||
|
||||
- Rework the UI
|
||||
- Add a dark theme
|
||||
- Fix the force ordering bug
|
||||
- Other bug fixes
|
||||
|
||||
## [1.5.2] - 2019-09-01
|
||||
|
||||
### Added
|
||||
|
||||
- imx.to host fix
|
||||
|
||||
## [1.5.1] - 2019-08-24
|
||||
|
||||
### Added
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [1.5.0] - 2019-08-24
|
||||
|
||||
### Added
|
||||
|
||||
- Display logged in user
|
||||
- Add post details when clicking on main list items (Status, Post URL, Host)
|
||||
- Add open download location on main list items menu
|
||||
- Add support for multi-post threads (Show a menu to select posts to download)
|
||||
- Add link to image from details list
|
||||
|
||||
## [1.4.10] - 2019-08-15
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix a rename issue on windows
|
||||
|
||||
## [1.4.9] - 2019-08-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Update Built-By to be generic
|
||||
|
||||
## [1.4.8] - 2019-08-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Add option to force image ordering
|
||||
|
||||
## [1.4.7] - 2019-08-13
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed a bug in image filename extensions
|
||||
|
||||
## [1.4.6] - 2019-08-06
|
||||
|
||||
### Changed
|
||||
|
||||
- Fixed a bug when creating image file names
|
||||
- Remove unnecessary logs
|
||||
- Fix data.json init
|
||||
|
||||
## [1.4.5] - 2019-08-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Add min width and height for electron app
|
||||
|
||||
### Added
|
||||
|
||||
- Add download speed to status bar
|
||||
|
||||
## [1.4.4] - 2019-08-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix names for ImgboxHost
|
||||
- Enhance UI
|
||||
- Minor fixes
|
||||
|
||||
### Added
|
||||
|
||||
- Add start and stop button
|
||||
|
||||
## [1.4.3] - 2019-07-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Update some messages
|
||||
- Fix scrolling issue
|
||||
|
||||
## [1.4.2] - 2019-07-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix layout issue in web mode
|
||||
|
||||
## [1.4.1] - 2019-07-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Change title's font
|
||||
|
||||
### Added
|
||||
|
||||
- Add borders
|
||||
|
||||
## [1.4.0] - 2019-07-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Better error handling on startup
|
||||
- Better support for linux AppImage
|
||||
|
||||
### Added
|
||||
|
||||
- Clear all completed
|
||||
- Add clipboard support
|
||||
- Add option to remove all posts
|
||||
- Add confirmation on remove
|
||||
|
||||
## [1.3.0-rc0] - 2019-07-04
|
||||
|
||||
### Changed
|
||||
|
||||
- Change default setting for autostart false -> true
|
||||
- Change default setting for max concurrent downloads 1 -> 4
|
||||
|
||||
### Added
|
||||
|
||||
- Desktop app built with electron
|
||||
- Add the option to remove a post
|
||||
|
||||
## [1.2.0] - 2019-06-23
|
||||
|
||||
### Added
|
||||
|
||||
- Add a shutdown button to gracefully shutdown the app
|
||||
- Open and redirect the browser to the app address on startup
|
||||
- Add the option to run the app in headless mode (-Djava.awt.headless=true)
|
||||
|
||||
## [1.1.1] - 2019-06-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix a stability issue with progress updates when the app is runninh for a long time
|
||||
|
||||
## [1.0.0] - 2019-06-22
|
||||
|
||||
### Added
|
||||
|
||||
- Add real time communication for progress updates via websocket (SockJS)
|
||||
- Add settings for download path, max concurrent download, enable/disable integration with vipergirls
|
||||
- Add integration with vipergitls.to (possibility to auto leave thanks after grab post)
|
||||
- Add support for acidimg.cc, imagezilla.net, imgbox.com, imx.to, pixhost.to, turboimagehost.com
|
||||
@@ -12,8 +12,8 @@ To build run the following:
|
||||
|
||||
Build artifact is located under
|
||||
|
||||
vripper-project\vripper-gui\target\vripper-gui-4.0.0.jar
|
||||
vripper-project\vripper-gui\target\vripper-gui-{{version}}.jar
|
||||
|
||||
Copy the artifact into any other folder and run:
|
||||
|
||||
java -jar vripper-gui-4.0.0.jar
|
||||
java -jar vripper-gui-{{version}}.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 303 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,2 @@
|
||||
--type app-image
|
||||
--java-options "-Dbase.dir=${user.dir}"
|
||||
@@ -0,0 +1,7 @@
|
||||
--icon icon.png
|
||||
--java-options "-Dbase.dir=${user.home}/.config"
|
||||
--linux-package-name vripper
|
||||
--linux-app-release 1
|
||||
--linux-menu-group Utility
|
||||
--linux-app-category java
|
||||
--linux-shortcut
|
||||
@@ -0,0 +1,4 @@
|
||||
--icon icon.icns
|
||||
--java-options "-Dbase.dir=${user.home}/.config"
|
||||
--mac-package-identifier me.mnlr.vripper.vripper-gui
|
||||
--mac-package-name VRipper
|
||||
@@ -0,0 +1,8 @@
|
||||
--icon icon.ico
|
||||
--java-options "-Dbase.dir=${user.home}"
|
||||
--win-dir-chooser
|
||||
--win-menu
|
||||
--win-per-user-install
|
||||
--win-shortcut
|
||||
--win-shortcut-prompt
|
||||
--win-update-url https://github.com/death-claw/vripper-project/releases
|
||||
@@ -0,0 +1,8 @@
|
||||
--input jar
|
||||
--main-jar vripper-gui.jar
|
||||
--add-modules java.base,java.desktop,java.sql,jdk.unsupported,jdk.crypto.ec,java.security.jgss
|
||||
--jlink-options "--strip-native-commands --strip-debug --no-man-pages --no-header-files --compress=2"
|
||||
--name VRipper
|
||||
--description "Image ripper tool for vipergirls"
|
||||
--dest dist
|
||||
--vendor "death-claw"
|
||||
@@ -12,8 +12,5 @@
|
||||
<module>vripper-gui</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
<version>4.1.0</version>
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
<version>4.4.0</version>
|
||||
</project>
|
||||
|
||||
+10
-9
@@ -7,17 +7,19 @@
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<relativePath/>
|
||||
<version>3.0.6</version>
|
||||
<version>3.1.3</version>
|
||||
</parent>
|
||||
<groupId>me.mnlr.vripper</groupId>
|
||||
<artifactId>vripper-core</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
<name>vripper-core</name>
|
||||
<description>vripper-core</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<kotlin.version>1.8.21</kotlin.version>
|
||||
<maven.deploy.skip>false</maven.deploy.skip>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -49,6 +51,7 @@
|
||||
<dependency>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>htmlcleaner</artifactId>
|
||||
@@ -80,6 +83,11 @@
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna-platform</artifactId>
|
||||
<version>5.13.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
@@ -118,11 +126,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>github</id>
|
||||
<name>GitHub death-claw Apache Maven Packages</name>
|
||||
<url>https://maven.pkg.github.com/death-claw/vripper-project</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
|
||||
@@ -1,58 +1,19 @@
|
||||
package me.mnlr.vripper
|
||||
|
||||
import jakarta.annotation.PreDestroy
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import me.mnlr.vripper.download.DownloadService
|
||||
import org.springframework.jdbc.core.JdbcTemplate
|
||||
import org.springframework.stereotype.Component
|
||||
import me.mnlr.vripper.download.DownloadService
|
||||
import me.mnlr.vripper.services.AsyncTaskRunnerService
|
||||
import java.nio.file.Path
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
|
||||
@Component
|
||||
class Management(
|
||||
private val jdbcTemplate: JdbcTemplate,
|
||||
@Value("\${base.dir}") baseDir: String,
|
||||
@Value("\${base.dir.name}") baseDirName: String,
|
||||
private val asyncTaskRunnerService: AsyncTaskRunnerService,
|
||||
private val downloadService: DownloadService
|
||||
) {
|
||||
private val backupFolder: Path
|
||||
|
||||
init {
|
||||
backupFolder = Path.of(baseDir, baseDirName, "backup")
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
fun destroy() {
|
||||
// taskRunnerService.destroy()
|
||||
downloadService.destroy()
|
||||
jdbcTemplate.execute("SHUTDOWN")
|
||||
}
|
||||
|
||||
// @PostConstruct
|
||||
// @Scheduled(cron = "0 0 0 ? * *")
|
||||
// private fun backup() {
|
||||
//
|
||||
// for (file in Files.list(backupFolder)) {
|
||||
// val matcher = BACKUP_FILE_PATTERN.matcher(file.fileName.toString())
|
||||
// if (matcher.find()) {
|
||||
// val localDate = LocalDate.parse(matcher.group(1), FORMATTER)
|
||||
// if (localDate.isEqual(LocalDate.now())) {
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // create a backup file
|
||||
// val backupFile = backupFolder.resolve("db_${LocalDateTime.now().format(FORMATTER)}.tar.gz")
|
||||
// jdbcTemplate.execute("BACKUP DATABASE TO '${backupFile}' BLOCKING")
|
||||
// }
|
||||
|
||||
companion object {
|
||||
val FORMATTER: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
|
||||
private val BACKUP_FILE_PATTERN = Pattern.compile("^db_(\\d{4}-\\d{2}-\\d{2})\\.tar\\.gz$")
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,11 @@ class DownloadService(
|
||||
}
|
||||
accepted.clear()
|
||||
candidates.clear()
|
||||
condition.await()
|
||||
try {
|
||||
condition.await()
|
||||
} catch (e: InterruptedException) {
|
||||
Thread.currentThread().interrupt()
|
||||
}
|
||||
}
|
||||
}
|
||||
}, "Download scheduler thread"
|
||||
|
||||
@@ -4,10 +4,11 @@ import org.apache.http.client.protocol.HttpClientContext
|
||||
import me.mnlr.vripper.SpringContext
|
||||
import me.mnlr.vripper.entities.ImageDownloadState
|
||||
import me.mnlr.vripper.entities.PostDownloadState
|
||||
import me.mnlr.vripper.model.Settings
|
||||
import me.mnlr.vripper.repositories.ImageRepository
|
||||
import me.mnlr.vripper.repositories.PostDownloadStateRepository
|
||||
|
||||
class ImageDownloadContext(val imageId: Long) {
|
||||
class ImageDownloadContext(val imageId: Long, val settings: Settings) {
|
||||
|
||||
private val imageRepository: ImageRepository =
|
||||
SpringContext.getBean(ImageRepository::class.java)
|
||||
|
||||
@@ -30,7 +30,7 @@ class ImageDownloadRunnable(
|
||||
private val dataTransaction: DataTransaction = SpringContext.getBean(DataTransaction::class.java)
|
||||
private val pathService: PathService = SpringContext.getBean(PathService::class.java)
|
||||
|
||||
val context: ImageDownloadContext = ImageDownloadContext(imageInternalId)
|
||||
val context: ImageDownloadContext = ImageDownloadContext(imageInternalId, settings)
|
||||
private val image: ImageDownloadState
|
||||
get() = context.image
|
||||
private var stopped: Boolean
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.mnlr.vripper.event
|
||||
|
||||
data class Event<T>(val kind: Kind, val data: T) {
|
||||
data class Event<T>(val kind: Kind, val data: T?) {
|
||||
enum class Kind {
|
||||
POST_UPDATE, POST_REMOVE, IMAGE_UPDATE, METADATA_UPDATE, THREAD_UPDATE, THREAD_REMOVE, LOG_EVENT_UPDATE, LOG_EVENT_REMOVE, VG_USER, DOWNLOAD_STATUS, BYTES_PER_SECOND, SETTINGS_UPDATE
|
||||
POST_UPDATE, POST_REMOVE, IMAGE_UPDATE, METADATA_UPDATE, THREAD_UPDATE, THREAD_REMOVE, LOG_EVENT_UPDATE, LOG_EVENT_REMOVE, VG_USER, DOWNLOAD_STATUS, BYTES_PER_SECOND, SETTINGS_UPDATE, THREAD_CLEAR
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
package me.mnlr.vripper.host
|
||||
|
||||
import org.apache.http.Header
|
||||
import org.apache.http.client.HttpClient
|
||||
import org.apache.http.client.methods.CloseableHttpResponse
|
||||
import org.apache.http.client.protocol.HttpClientContext
|
||||
import org.apache.http.util.EntityUtils
|
||||
import org.w3c.dom.Document
|
||||
import me.mnlr.vripper.delegate.LoggerDelegate
|
||||
import me.mnlr.vripper.download.ImageDownloadContext
|
||||
import me.mnlr.vripper.exception.DownloadException
|
||||
import me.mnlr.vripper.exception.HostException
|
||||
import me.mnlr.vripper.getFileNameWithoutExtension
|
||||
import me.mnlr.vripper.services.*
|
||||
import java.io.FileOutputStream
|
||||
import org.apache.http.Header
|
||||
import org.apache.http.client.HttpClient
|
||||
import org.apache.http.client.methods.CloseableHttpResponse
|
||||
import org.apache.http.client.protocol.HttpClientContext
|
||||
import org.apache.http.util.EntityUtils
|
||||
import org.w3c.dom.Document
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.pathString
|
||||
|
||||
abstract class Host(
|
||||
private val httpService: HTTPService,
|
||||
@@ -84,10 +82,10 @@ abstract class Host(
|
||||
val mimeType = getImageMimeType(response.allHeaders)
|
||||
?: throw HostException("Unsupported image type ${response.getFirstHeader("content-type")}")
|
||||
|
||||
val tempImage = Files.createTempFile("vripper", "tmp")
|
||||
val tempImage = Files.createTempFile(Path.of(context.settings.downloadSettings.tempPath), "vripper_", ".tmp")
|
||||
return response.entity.content.use { inputStream ->
|
||||
try {
|
||||
FileOutputStream(tempImage.pathString).use { fos ->
|
||||
Files.newOutputStream(tempImage).use { fos ->
|
||||
val image = context.image
|
||||
image.total = response.entity.contentLength
|
||||
dataTransaction.update(image)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package me.mnlr.vripper.listeners
|
||||
|
||||
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent
|
||||
import org.springframework.context.ApplicationListener
|
||||
import java.io.RandomAccessFile
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.pathString
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class AppListener : ApplicationListener<ApplicationEnvironmentPreparedEvent> {
|
||||
override fun onApplicationEvent(event: ApplicationEnvironmentPreparedEvent) {
|
||||
val lock = event.environment.getProperty("base.dir")?.let { Path(it).resolve("lock") }
|
||||
if(lock == null) {
|
||||
System.err.println("Misconfiguration detected, quitting...")
|
||||
exitProcess(-1)
|
||||
}
|
||||
try {
|
||||
val randomFile = RandomAccessFile(lock.pathString, "rw")
|
||||
val channel = randomFile.channel
|
||||
val fileLock = channel.tryLock()
|
||||
if (fileLock == null) {
|
||||
System.err.println("Another instance is already running in ${lock.parent.pathString}")
|
||||
exitProcess(-1)
|
||||
} else {
|
||||
Runtime.getRuntime().addShutdownHook(Thread {
|
||||
fileLock.release()
|
||||
channel.close()
|
||||
Files.deleteIfExists(lock)
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println(e.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package me.mnlr.vripper.listeners
|
||||
|
||||
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent
|
||||
import org.springframework.context.ApplicationListener
|
||||
import java.io.RandomAccessFile
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.pathString
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class AppLock : ApplicationListener<ApplicationEnvironmentPreparedEvent> {
|
||||
override fun onApplicationEvent(event: ApplicationEnvironmentPreparedEvent) {
|
||||
val baseDir = event.environment.getProperty("base.dir")
|
||||
val appDirName = event.environment.getProperty("base.dir.name")
|
||||
if (baseDir == null || appDirName == null) {
|
||||
if (baseDir == null) {
|
||||
System.err.println("Property base.dir is undefined")
|
||||
}
|
||||
if (appDirName == null) {
|
||||
System.err.println("Property base.dir.name is undefined")
|
||||
}
|
||||
System.err.println("Misconfiguration detected, quitting...")
|
||||
exitProcess(-1)
|
||||
}
|
||||
val lock = Path(baseDir).resolve(appDirName).resolve("lock")
|
||||
try {
|
||||
val randomFile = RandomAccessFile(lock.pathString, "rw")
|
||||
val channel = randomFile.channel
|
||||
val fileLock = channel.tryLock()
|
||||
if (fileLock == null) {
|
||||
System.err.println("Another instance is already running in ${lock.parent.pathString}")
|
||||
exitProcess(-1)
|
||||
} else {
|
||||
Runtime.getRuntime().addShutdownHook(Thread {
|
||||
fileLock.release()
|
||||
channel.close()
|
||||
Files.deleteIfExists(lock)
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println(e.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.mnlr.vripper
|
||||
package me.mnlr.vripper.listeners
|
||||
|
||||
import org.springframework.context.event.ContextRefreshedEvent
|
||||
import org.springframework.context.event.EventListener
|
||||
@@ -1,12 +1,12 @@
|
||||
package me.mnlr.vripper.model
|
||||
|
||||
class Settings {
|
||||
var maxEventLog: Int = 1_000
|
||||
var connectionSettings = ConnectionSettings()
|
||||
var downloadSettings = DownloadSettings()
|
||||
var viperSettings = ViperSettings()
|
||||
var clipboardSettings = ClipboardSettings()
|
||||
}
|
||||
data class Settings(
|
||||
var maxEventLog: Int = 1_000,
|
||||
var connectionSettings: ConnectionSettings = ConnectionSettings(),
|
||||
var downloadSettings: DownloadSettings = DownloadSettings(),
|
||||
var viperSettings: ViperSettings = ViperSettings(),
|
||||
var clipboardSettings: ClipboardSettings = ClipboardSettings()
|
||||
)
|
||||
|
||||
data class ViperSettings(
|
||||
var login: Boolean = false,
|
||||
@@ -18,6 +18,7 @@ data class ViperSettings(
|
||||
|
||||
data class DownloadSettings(
|
||||
var downloadPath: String = System.getProperty("user.home"),
|
||||
var tempPath: String = System.getProperty("java.io.tmpdir"),
|
||||
var autoStart: Boolean = true,
|
||||
var autoQueueThreshold: Int = 1,
|
||||
var forceOrder: Boolean = false,
|
||||
|
||||
@@ -72,6 +72,7 @@ class ThreadRepositoryImpl @Autowired constructor(
|
||||
|
||||
override fun deleteAll() {
|
||||
jdbcTemplate.update("DELETE FROM THREAD")
|
||||
eventBus.publishEvent(Event(Event.Kind.THREAD_CLEAR, null))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package me.mnlr.vripper.services
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class AppVersion(@param:Value("\${build.version}") val version: String, @param:Value("\${build.timestamp}") val timestamp: String)
|
||||
@@ -14,7 +14,12 @@ class XpathService {
|
||||
@Throws(XpathException::class)
|
||||
fun getAsNode(source: Node?, xpathExpression: String?): Node? {
|
||||
return try {
|
||||
xpath.compile(xpathExpression).evaluate(source, XPathConstants.NODE) as Node
|
||||
val value = xpath.compile(xpathExpression).evaluate(source, XPathConstants.NODE)
|
||||
if(value != null) {
|
||||
value as Node
|
||||
} else {
|
||||
null
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
throw XpathException(e)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.mnlr.vripper.tasks
|
||||
|
||||
import me.mnlr.vripper.AppEndpointService
|
||||
import me.mnlr.vripper.SpringContext
|
||||
import me.mnlr.vripper.delegate.LoggerDelegate
|
||||
import me.mnlr.vripper.download.PostDownloadRunnable
|
||||
@@ -32,6 +33,9 @@ class ThreadLookupRunnable(private val threadId: String, private val settings: S
|
||||
private val asyncTaskRunnerService = SpringContext.getBean(
|
||||
AsyncTaskRunnerService::class.java
|
||||
)
|
||||
private val appEndpointService = SpringContext.getBean(
|
||||
AppEndpointService::class.java
|
||||
)
|
||||
private val link: String =
|
||||
"${settingsService.settings.viperSettings.host}/threads/$threadId"
|
||||
private val logEvent: LogEvent
|
||||
@@ -94,8 +98,8 @@ class ThreadLookupRunnable(private val threadId: String, private val settings: S
|
||||
|
||||
private fun autostart(lookupResult: ThreadItem) {
|
||||
if (lookupResult.postItemList.size <= settings.downloadSettings.autoQueueThreshold) {
|
||||
appEndpointService.threadRemove(listOf(lookupResult.threadId))
|
||||
lookupResult.postItemList.forEach {
|
||||
Pair(it.threadId, it.postId)
|
||||
asyncTaskRunnerService.sink.emitNext(
|
||||
PostDownloadRunnable(
|
||||
it.threadId, it.postId
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
build.version=@project.version@
|
||||
build.timestamp=@timestamp@
|
||||
logging.level.org.springframework.web=INFO
|
||||
logging.level.root=INFO
|
||||
logging.level.org.springframework.web.socket.config.WebSocketMessageBrokerStats=ERROR
|
||||
|
||||
+3
-10
@@ -7,11 +7,11 @@
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<relativePath/>
|
||||
<version>3.0.6</version> <!-- lookup parent from repository -->
|
||||
<version>3.1.3</version> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>me.mnlr.vripper</groupId>
|
||||
<artifactId>vripper-gui</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
<name>vripper-gui</name>
|
||||
<description>vripper-gui</description>
|
||||
<dependencies>
|
||||
@@ -99,7 +99,7 @@
|
||||
<dependency>
|
||||
<artifactId>vripper-core</artifactId>
|
||||
<groupId>me.mnlr.vripper</groupId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -144,11 +144,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>github</id>
|
||||
<name>GitHub death-claw Apache Maven Packages</name>
|
||||
<url>https://maven.pkg.github.com/death-claw/vripper-project</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
|
||||
@@ -6,17 +6,14 @@ import javafx.stage.Stage
|
||||
import javafx.stage.WindowEvent
|
||||
import me.mnlr.vripper.event.ApplicationInitialized
|
||||
import me.mnlr.vripper.gui.Styles
|
||||
import me.mnlr.vripper.listeners.AppLock
|
||||
import me.mnlr.vripper.view.LoadingView
|
||||
import org.springframework.boot.SpringApplication
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder
|
||||
import org.springframework.context.ConfigurableApplicationContext
|
||||
import tornadofx.App
|
||||
import tornadofx.DIContainer
|
||||
import tornadofx.FX
|
||||
import java.io.RandomAccessFile
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.pathString
|
||||
import kotlin.reflect.KClass
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
@@ -28,6 +25,10 @@ class VripperGuiApplication : App(
|
||||
|
||||
private lateinit var context: ConfigurableApplicationContext //We are going to set application context here
|
||||
private var initialized = false
|
||||
|
||||
init {
|
||||
APP_INSTANCE = this
|
||||
}
|
||||
override fun start(stage: Stage) {
|
||||
with(stage) {
|
||||
width = 1200.0
|
||||
@@ -47,18 +48,18 @@ class VripperGuiApplication : App(
|
||||
}
|
||||
stage.addEventFilter(WindowEvent.WINDOW_SHOWN) {
|
||||
val contextInitThread = Thread {
|
||||
context =
|
||||
SpringApplication.run(this.javaClass) //We start the application context and let Spring Boot to initilaize itself
|
||||
context = SpringApplicationBuilder(this.javaClass).listeners(AppLock())
|
||||
.run() //We start the application context and let Spring Boot to initialize itself
|
||||
context.autowireCapableBeanFactory.autowireBean(this) //We ask the context to inject all needed dependencies into the current instence (if needed)
|
||||
|
||||
FX.dicontainer = object :
|
||||
DIContainer { // Here we have to implement an interface for TornadoFX DI support
|
||||
override fun <T : Any> getInstance(type: KClass<T>): T =
|
||||
context.getBean(type.java) // We find dependencies directly in Spring's application context
|
||||
FX.dicontainer =
|
||||
object : DIContainer { // Here we have to implement an interface for TornadoFX DI support
|
||||
override fun <T : Any> getInstance(type: KClass<T>): T =
|
||||
context.getBean(type.java) // We find dependencies directly in Spring's application context
|
||||
|
||||
override fun <T : Any> getInstance(type: KClass<T>, name: String): T =
|
||||
context.getBean(name, type.java)
|
||||
}
|
||||
override fun <T : Any> getInstance(type: KClass<T>, name: String): T =
|
||||
context.getBean(name, type.java)
|
||||
}
|
||||
fire(ApplicationInitialized)
|
||||
initialized = true
|
||||
}
|
||||
@@ -76,26 +77,12 @@ class VripperGuiApplication : App(
|
||||
}
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
companion object {
|
||||
lateinit var APP_INSTANCE: Application
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val lock = Path(System.getProperty("user.dir")).resolve("lock")
|
||||
try {
|
||||
val randomFile = RandomAccessFile(lock.pathString, "rw")
|
||||
val channel = randomFile.channel
|
||||
val fileLock = channel.tryLock()
|
||||
if (fileLock == null) {
|
||||
println("Already Running...")
|
||||
return
|
||||
} else {
|
||||
Runtime.getRuntime().addShutdownHook(Thread {
|
||||
fileLock.release()
|
||||
channel.close()
|
||||
Files.deleteIfExists(lock)
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println(e.toString())
|
||||
}
|
||||
Application.launch(VripperGuiApplication::class.java, *args)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package me.mnlr.vripper.controller
|
||||
|
||||
import me.mnlr.vripper.services.AppVersion
|
||||
import tornadofx.*
|
||||
|
||||
class MainController : Controller() {
|
||||
private val appVersion: AppVersion by di()
|
||||
|
||||
val version = appVersion.version
|
||||
val timestamp = appVersion.timestamp
|
||||
}
|
||||
@@ -37,6 +37,7 @@ class SettingsController : Controller() {
|
||||
settingsService.newSettings(Settings().apply {
|
||||
downloadSettings = DownloadSettings(
|
||||
downloadSettingsModel.downloadPath,
|
||||
downloadSettingsModel.tempPath,
|
||||
downloadSettingsModel.autoStart,
|
||||
downloadSettingsModel.autoQueueThreshold,
|
||||
downloadSettingsModel.forceOrder,
|
||||
|
||||
@@ -7,6 +7,9 @@ class DownloadSettingsModel {
|
||||
val downloadPathProperty = SimpleStringProperty()
|
||||
var downloadPath: String by downloadPathProperty
|
||||
|
||||
val tempPathProperty = SimpleStringProperty()
|
||||
var tempPath: String by tempPathProperty
|
||||
|
||||
val autoStartProperty = SimpleBooleanProperty()
|
||||
var autoStart: Boolean by autoStartProperty
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.mnlr.vripper.utils
|
||||
|
||||
import com.sun.jna.Native
|
||||
import com.sun.jna.WString
|
||||
import com.sun.jna.platform.win32.ShellAPI
|
||||
import com.sun.jna.platform.win32.WinDef
|
||||
import com.sun.jna.win32.StdCallLibrary
|
||||
|
||||
interface Shell32 : ShellAPI, StdCallLibrary {
|
||||
fun ShellExecuteW(
|
||||
hwnd: WinDef.HWND?,
|
||||
lpOperation: WString?,
|
||||
lpFile: WString?,
|
||||
lpParameters: WString?,
|
||||
lpDirectory: WString?,
|
||||
nShowCmd: Int
|
||||
): WinDef.HINSTANCE?
|
||||
|
||||
companion object {
|
||||
val INSTANCE = Native.load(
|
||||
"shell32",
|
||||
Shell32::class.java
|
||||
) as Shell32
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,23 @@
|
||||
package me.mnlr.vripper.view
|
||||
|
||||
import me.mnlr.vripper.controller.MainController
|
||||
import me.mnlr.vripper.view.actionbar.ActionBarView
|
||||
import me.mnlr.vripper.view.main.MainView
|
||||
import me.mnlr.vripper.view.status.StatusBarView
|
||||
import tornadofx.View
|
||||
import tornadofx.borderpane
|
||||
|
||||
class AppView : View("Vripper") {
|
||||
class AppView : View() {
|
||||
|
||||
private val mainController: MainController by inject()
|
||||
|
||||
init {
|
||||
title = "VRipper ${mainController.version}"
|
||||
}
|
||||
|
||||
override val root = borderpane {
|
||||
top<ActionBarView>()
|
||||
center<MainView>()
|
||||
bottom<StatusBarView>()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package me.mnlr.vripper.view
|
||||
|
||||
import com.sun.jna.WString
|
||||
import me.mnlr.vripper.VripperGuiApplication
|
||||
import me.mnlr.vripper.utils.Shell32
|
||||
|
||||
fun openFileDirectory(path: String) {
|
||||
val os = System.getProperty("os.name")
|
||||
if(os.contains("Windows")) {
|
||||
Shell32.INSTANCE.ShellExecuteW(null, WString("open"), WString(path), null, null, 1)
|
||||
} else if(os.contains("Linux")) {
|
||||
Runtime.getRuntime().exec("xdg-open $path")
|
||||
} else if(os.contains("Mac")) {
|
||||
Runtime.getRuntime().exec("open -R $path")
|
||||
}
|
||||
}
|
||||
|
||||
fun openLink(path: String) {
|
||||
VripperGuiApplication.APP_INSTANCE.hostServices.showDocument(path)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package me.mnlr.vripper.view
|
||||
|
||||
import javafx.application.Platform
|
||||
import reactor.core.scheduler.Schedulers
|
||||
|
||||
val FxScheduler = Schedulers.fromExecutor(Platform::runLater)
|
||||
@@ -6,7 +6,7 @@ import javafx.util.Duration
|
||||
import me.mnlr.vripper.event.ApplicationInitialized
|
||||
import tornadofx.*
|
||||
|
||||
class LoadingView : View("Vripper") {
|
||||
class LoadingView : View("VRipper") {
|
||||
|
||||
private val appView: AppView by inject()
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package me.mnlr.vripper.view
|
||||
|
||||
import javafx.beans.value.ObservableValue
|
||||
import javafx.event.EventHandler
|
||||
import javafx.scene.control.ProgressBar
|
||||
import javafx.scene.control.TableCell
|
||||
import javafx.scene.control.TableColumn
|
||||
import javafx.scene.input.MouseEvent
|
||||
|
||||
class ProgressTableCell<S> : TableCell<S, Double>() {
|
||||
|
||||
/* *************************************************************************
|
||||
* *
|
||||
* Fields *
|
||||
* *
|
||||
**************************************************************************/
|
||||
private var progressBar: ProgressBar
|
||||
|
||||
private var observable: ObservableValue<Double>? = null
|
||||
|
||||
init {
|
||||
styleClass.add("progress-bar-table-cell")
|
||||
progressBar = ProgressBar()
|
||||
progressBar.maxWidth = Double.MAX_VALUE
|
||||
}
|
||||
|
||||
fun setOnMouseClick(clickEvent: EventHandler<in MouseEvent>) {
|
||||
progressBar.onMouseClicked = clickEvent
|
||||
}
|
||||
|
||||
override fun updateItem(item: Double?, empty: Boolean) {
|
||||
super.updateItem(item, empty)
|
||||
if (empty) {
|
||||
setGraphic(null)
|
||||
} else {
|
||||
progressBar.progressProperty().unbind()
|
||||
val column: TableColumn<S, Double>? = tableColumn
|
||||
observable = column?.getCellObservableValue(index)
|
||||
if (observable != null) {
|
||||
progressBar.progressProperty().bind(observable)
|
||||
} else if (item != null) {
|
||||
progressBar.progress = item
|
||||
}
|
||||
setGraphic(progressBar)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import me.mnlr.vripper.gui.Styles
|
||||
import me.mnlr.vripper.view.settings.SettingsView
|
||||
import tornadofx.*
|
||||
|
||||
class ActionBarView : View("Vripper") {
|
||||
class ActionBarView : View() {
|
||||
|
||||
override val root = borderpane {
|
||||
padding = insets(all = 5)
|
||||
|
||||
@@ -46,7 +46,6 @@ class ThreadActionsView : View() {
|
||||
action {
|
||||
confirm("Clean threads", "Confirm removal of threads", ButtonType.YES, ButtonType.NO) {
|
||||
threadController.clearAll()
|
||||
threadTableView.tableView.items.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class DownloadSettingsView : View("Download Settings") {
|
||||
override fun onDock() {
|
||||
val downloadSettings = settingsController.findDownloadSettings()
|
||||
downloadSettingsModel.downloadPath = downloadSettings.downloadPath
|
||||
downloadSettingsModel.tempPath = downloadSettings.tempPath
|
||||
downloadSettingsModel.autoStart = downloadSettings.autoStart
|
||||
downloadSettingsModel.autoQueueThreshold = downloadSettings.autoQueueThreshold
|
||||
downloadSettingsModel.forceOrder = downloadSettings.forceOrder
|
||||
@@ -38,6 +39,19 @@ class DownloadSettingsView : View("Download Settings") {
|
||||
}
|
||||
}
|
||||
}
|
||||
field("Temporary Path") {
|
||||
textfield(downloadSettingsModel.tempPathProperty) {
|
||||
isEditable = false
|
||||
}
|
||||
button("Browse") {
|
||||
action {
|
||||
val directory = chooseDirectory(title = "Select temporary folder")
|
||||
if(directory != null) {
|
||||
downloadSettingsModel.tempPathProperty.set(directory.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
field("Auto start downloads") {
|
||||
checkbox {
|
||||
bind(downloadSettingsModel.autoStartProperty)
|
||||
|
||||
@@ -3,12 +3,17 @@ package me.mnlr.vripper.view.tables
|
||||
import javafx.collections.FXCollections
|
||||
import javafx.collections.ObservableList
|
||||
import javafx.geometry.Pos
|
||||
import javafx.scene.control.TableView
|
||||
import javafx.scene.control.*
|
||||
import javafx.scene.image.ImageView
|
||||
import javafx.scene.input.MouseButton
|
||||
import javafx.util.Callback
|
||||
import me.mnlr.vripper.controller.ImageController
|
||||
import me.mnlr.vripper.event.Event
|
||||
import me.mnlr.vripper.event.EventBus
|
||||
import me.mnlr.vripper.model.ImageModel
|
||||
import me.mnlr.vripper.view.ProgressTableCell
|
||||
import me.mnlr.vripper.view.openLink
|
||||
import me.mnlr.vripper.view.FxScheduler
|
||||
import tornadofx.*
|
||||
|
||||
class ImagesTableView : Fragment("Photos") {
|
||||
@@ -27,36 +32,53 @@ class ImagesTableView : Fragment("Photos") {
|
||||
runLater {
|
||||
items.addAll(imageController.findImages(postId))
|
||||
tableView.sort()
|
||||
}
|
||||
|
||||
val disposable = eventBus.flux()
|
||||
.filter { it!!.kind == Event.Kind.IMAGE_UPDATE }
|
||||
.subscribe { event ->
|
||||
imageController
|
||||
.findImageById(event!!.data as Long)
|
||||
.filter { it.postId == postId }
|
||||
.ifPresent {
|
||||
// search
|
||||
val find = items
|
||||
.find { image -> image.id == it.id }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
progress = it.progress
|
||||
status = it.status
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
}
|
||||
}
|
||||
val disposable = eventBus
|
||||
.flux()
|
||||
.filter { it!!.kind == Event.Kind.IMAGE_UPDATE }
|
||||
.map { imageController.findImageById(it!!.data as Long) }
|
||||
.filter { it.isPresent }
|
||||
.map { it.get() }
|
||||
.filter { it.postId == postId }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
val find = items
|
||||
.find { image -> image.id == it.id }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
progress = it.progress
|
||||
status = it.status
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
}
|
||||
|
||||
whenUndocked {
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
whenUndocked {
|
||||
disposable.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
override val root = vbox(alignment = Pos.CENTER_RIGHT) {
|
||||
tableView = tableview(items) {
|
||||
setRowFactory {
|
||||
val tableRow = TableRow<ImageModel>()
|
||||
val urlItem = MenuItem("Open link").apply {
|
||||
setOnAction {
|
||||
openLink(tableRow.item.url)
|
||||
}
|
||||
graphic = ImageView("open-in-browser.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
val contextMenu = ContextMenu()
|
||||
contextMenu.items.addAll(urlItem)
|
||||
tableRow.contextMenuProperty().bind(tableRow.emptyProperty()
|
||||
.map { empty -> if (empty) null else contextMenu })
|
||||
tableRow
|
||||
}
|
||||
column("Index", ImageModel::indexProperty) {
|
||||
sortOrder.add(this)
|
||||
}
|
||||
@@ -64,31 +86,21 @@ class ImagesTableView : Fragment("Photos") {
|
||||
prefWidth = 200.0
|
||||
}
|
||||
column("Progress", ImageModel::progressProperty) {
|
||||
cellFormat {
|
||||
addClass(Stylesheet.progressBarTableCell)
|
||||
graphic = cache {
|
||||
progressbar(itemProperty().doubleBinding { it?.toDouble() ?: 0.0 }) {
|
||||
setOnMouseClicked {
|
||||
when (it.clickCount) {
|
||||
1 -> {
|
||||
this@tableview.requestFocus()
|
||||
this@tableview.focusModel.focus(this@cellFormat.tableRow.index)
|
||||
if (it.isControlDown && it.button.equals(MouseButton.PRIMARY)) {
|
||||
if (this@tableview.selectionModel.isSelected(this@cellFormat.tableRow.index)) {
|
||||
this@tableview.selectionModel.clearSelection(this@cellFormat.tableRow.index)
|
||||
} else {
|
||||
this@tableview.selectionModel.select(this@cellFormat.tableRow.index)
|
||||
}
|
||||
} else if (it.button.equals(MouseButton.PRIMARY)) {
|
||||
this@tableview.selectionModel.clearSelection()
|
||||
this@tableview.selectionModel.select(this@cellFormat.tableRow.index)
|
||||
}
|
||||
}
|
||||
cellFactory = Callback {
|
||||
val cell = ProgressTableCell<ImageModel>()
|
||||
cell.setOnMouseClick {
|
||||
when (it.clickCount) {
|
||||
1 -> {
|
||||
this@tableview.requestFocus()
|
||||
this@tableview.focusModel.focus(cell.tableRow.index)
|
||||
if (it.button.equals(MouseButton.PRIMARY)) {
|
||||
this@tableview.selectionModel.clearSelection()
|
||||
this@tableview.selectionModel.select(cell.tableRow.index)
|
||||
}
|
||||
}
|
||||
useMaxWidth = true
|
||||
}
|
||||
}
|
||||
cell as TableCell<ImageModel, Number>
|
||||
}
|
||||
}
|
||||
column("Status", ImageModel::statusProperty)
|
||||
|
||||
@@ -8,9 +8,10 @@ import me.mnlr.vripper.controller.LogController
|
||||
import me.mnlr.vripper.event.Event
|
||||
import me.mnlr.vripper.event.EventBus
|
||||
import me.mnlr.vripper.model.LogModel
|
||||
import me.mnlr.vripper.view.FxScheduler
|
||||
import tornadofx.*
|
||||
|
||||
class LogTableView : View("Log") {
|
||||
class LogTableView : View() {
|
||||
|
||||
private val logController: LogController by inject()
|
||||
private val eventBus: EventBus by di()
|
||||
@@ -20,30 +21,42 @@ class LogTableView : View("Log") {
|
||||
var items: ObservableList<LogModel> = FXCollections.observableArrayList()
|
||||
|
||||
init {
|
||||
titleProperty.bind(items.sizeProperty.map {
|
||||
if (it.toLong() > 0) {
|
||||
"Log (${it.toLong()})"
|
||||
} else {
|
||||
"Log"
|
||||
}
|
||||
})
|
||||
items.addAll(logController.findAll())
|
||||
|
||||
eventBus.flux()
|
||||
.doOnNext { event ->
|
||||
if (event!!.kind.equals(Event.Kind.LOG_EVENT_UPDATE)) {
|
||||
logController.find(event.data as Long)
|
||||
.ifPresent {
|
||||
// search
|
||||
val find = items
|
||||
.find { threadModel -> threadModel.id == it.id }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
status = it.status
|
||||
message = it.message
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
}
|
||||
}
|
||||
} else if (event.kind.equals(Event.Kind.LOG_EVENT_REMOVE)) {
|
||||
items.removeIf { it.id == event.data }
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it!!.kind == Event.Kind.LOG_EVENT_UPDATE }
|
||||
.map { logController.find(it.data as Long) }
|
||||
.filter { it.isPresent }
|
||||
.map { it.get() }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
val find = items
|
||||
.find { threadModel -> threadModel.id == it.id }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
status = it.status
|
||||
message = it.message
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
}
|
||||
}
|
||||
.subscribe()
|
||||
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it.kind == Event.Kind.LOG_EVENT_REMOVE }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe { event ->
|
||||
items.removeIf { it.id == event.data }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDock() {
|
||||
|
||||
@@ -5,14 +5,19 @@ import javafx.collections.ObservableList
|
||||
import javafx.scene.control.*
|
||||
import javafx.scene.image.ImageView
|
||||
import javafx.scene.input.MouseButton
|
||||
import javafx.util.Callback
|
||||
import me.mnlr.vripper.controller.PostController
|
||||
import me.mnlr.vripper.event.Event
|
||||
import me.mnlr.vripper.event.EventBus
|
||||
import me.mnlr.vripper.model.PostModel
|
||||
import me.mnlr.vripper.view.ProgressTableCell
|
||||
import me.mnlr.vripper.view.openFileDirectory
|
||||
import me.mnlr.vripper.view.openLink
|
||||
import me.mnlr.vripper.view.FxScheduler
|
||||
import tornadofx.*
|
||||
|
||||
|
||||
class PostsTableView : View("Download") {
|
||||
class PostsTableView : View() {
|
||||
|
||||
private val postController: PostController by inject()
|
||||
private val eventBus: EventBus by di()
|
||||
@@ -21,13 +26,23 @@ class PostsTableView : View("Download") {
|
||||
private var items: ObservableList<PostModel> = FXCollections.observableArrayList()
|
||||
|
||||
init {
|
||||
titleProperty.bind(items.sizeProperty.map {
|
||||
if (it.toLong() > 0) {
|
||||
"Download (${it.toLong()})"
|
||||
} else {
|
||||
"Download"
|
||||
}
|
||||
})
|
||||
items.addAll(postController.findAllPosts())
|
||||
|
||||
eventBus.flux().filter {
|
||||
it!!.kind == Event.Kind.POST_UPDATE || it.kind == Event.Kind.METADATA_UPDATE
|
||||
}.subscribe { event ->
|
||||
postController.findById(event!!.data as Long).ifPresent {
|
||||
// search
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it!!.kind == Event.Kind.POST_UPDATE || it.kind == Event.Kind.METADATA_UPDATE }
|
||||
.map { postController.findById(it!!.data as Long) }
|
||||
.filter { it.isPresent }
|
||||
.map { it.get() }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
val find = items.find { postModel -> postModel.postId == it.postId }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
@@ -40,19 +55,17 @@ class PostsTableView : View("Download") {
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
runLater {
|
||||
this.tableView.refresh()
|
||||
}
|
||||
this.tableView.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
eventBus.flux().filter {
|
||||
it!!.kind == Event.Kind.POST_REMOVE
|
||||
}.subscribe { event ->
|
||||
items.removeIf { p -> p.postId == event.data as String }
|
||||
}
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it!!.kind == Event.Kind.POST_REMOVE }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
items.removeIf { p -> p.postId == it.data as String }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDock() {
|
||||
@@ -70,45 +83,69 @@ class PostsTableView : View("Download") {
|
||||
}
|
||||
}
|
||||
|
||||
val startItem = MenuItem("Start").apply {
|
||||
setOnAction {
|
||||
startSelected()
|
||||
}
|
||||
graphic = ImageView("play.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val stopItem = MenuItem("Stop").apply {
|
||||
setOnAction {
|
||||
stopSelected()
|
||||
}
|
||||
graphic = ImageView("pause.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val deleteItem = MenuItem("Delete").apply {
|
||||
setOnAction {
|
||||
deleteSelected()
|
||||
}
|
||||
graphic = ImageView("trash.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val detailsItem = MenuItem("Images").apply {
|
||||
setOnAction {
|
||||
openPhotos(tableRow.item.postId)
|
||||
}
|
||||
graphic = ImageView("details.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val locationItem = MenuItem("Open containing folder").apply {
|
||||
setOnAction {
|
||||
openFileDirectory(tableRow.item.path)
|
||||
}
|
||||
graphic = ImageView("file-explorer.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val urlItem = MenuItem("Open link").apply {
|
||||
setOnAction {
|
||||
openLink(tableRow.item.url)
|
||||
}
|
||||
graphic = ImageView("open-in-browser.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val contextMenu = ContextMenu()
|
||||
val startItem = MenuItem("Start")
|
||||
startItem.setOnAction {
|
||||
startSelected()
|
||||
}
|
||||
val playIcon = ImageView("play.png")
|
||||
playIcon.fitWidth = 18.0
|
||||
playIcon.fitHeight = 18.0
|
||||
startItem.graphic = playIcon
|
||||
|
||||
val stopItem = MenuItem("Stop")
|
||||
stopItem.setOnAction {
|
||||
stopSelected()
|
||||
}
|
||||
val stopIcon = ImageView("pause.png")
|
||||
stopIcon.fitWidth = 18.0
|
||||
stopIcon.fitHeight = 18.0
|
||||
stopItem.graphic = stopIcon
|
||||
|
||||
val deleteItem = MenuItem("Delete")
|
||||
deleteItem.setOnAction {
|
||||
deleteSelected()
|
||||
}
|
||||
val deleteIcon = ImageView("trash.png")
|
||||
deleteIcon.fitWidth = 18.0
|
||||
deleteIcon.fitHeight = 18.0
|
||||
deleteItem.graphic = deleteIcon
|
||||
|
||||
val detailsItem = MenuItem("Images")
|
||||
detailsItem.setOnAction {
|
||||
openPhotos(tableRow.item.postId)
|
||||
}
|
||||
val detailsIcon = ImageView("details.png")
|
||||
detailsIcon.fitWidth = 18.0
|
||||
detailsIcon.fitHeight = 18.0
|
||||
detailsItem.graphic = detailsIcon
|
||||
|
||||
contextMenu.items.addAll(
|
||||
startItem, stopItem, deleteItem, SeparatorMenuItem(), detailsItem
|
||||
startItem, stopItem, deleteItem, SeparatorMenuItem(), detailsItem, locationItem, urlItem
|
||||
)
|
||||
tableRow.contextMenuProperty()
|
||||
.bind(tableRow.emptyProperty().map { empty -> if (empty) null else contextMenu })
|
||||
@@ -118,32 +155,41 @@ class PostsTableView : View("Download") {
|
||||
prefWidth = 300.0
|
||||
}
|
||||
column("Progress", PostModel::progressProperty) {
|
||||
cellFormat {
|
||||
addClass(Stylesheet.progressBarTableCell)
|
||||
graphic = cache {
|
||||
progressbar(itemProperty().doubleBinding { it?.toDouble() ?: 0.0 }) {
|
||||
setOnMouseClicked {
|
||||
cellFactory = Callback {
|
||||
val cell = ProgressTableCell<PostModel>()
|
||||
cell.setOnMouseClick {
|
||||
when (it.button) {
|
||||
MouseButton.SECONDARY -> {
|
||||
this@tableview.requestFocus()
|
||||
this@tableview.focusModel.focus(cell.tableRow.index)
|
||||
if (!this@tableview.selectionModel.isSelected(cell.tableRow.index)) {
|
||||
this@tableview.selectionModel.clearSelection()
|
||||
this@tableview.selectionModel.select(cell.tableRow.index)
|
||||
}
|
||||
}
|
||||
MouseButton.PRIMARY -> {
|
||||
when (it.clickCount) {
|
||||
1 -> {
|
||||
this@tableview.requestFocus()
|
||||
this@tableview.focusModel.focus(this@cellFormat.tableRow.index)
|
||||
this@tableview.focusModel.focus(cell.tableRow.index)
|
||||
if (it.isControlDown && it.button.equals(MouseButton.PRIMARY)) {
|
||||
if (this@tableview.selectionModel.isSelected(this@cellFormat.tableRow.index)) {
|
||||
this@tableview.selectionModel.clearSelection(this@cellFormat.tableRow.index)
|
||||
if (this@tableview.selectionModel.isSelected(cell.tableRow.index)) {
|
||||
this@tableview.selectionModel.clearSelection(cell.tableRow.index)
|
||||
} else {
|
||||
this@tableview.selectionModel.select(this@cellFormat.tableRow.index)
|
||||
this@tableview.selectionModel.select(cell.tableRow.index)
|
||||
}
|
||||
} else if (it.button.equals(MouseButton.PRIMARY)) {
|
||||
this@tableview.selectionModel.clearSelection()
|
||||
this@tableview.selectionModel.select(this@cellFormat.tableRow.index)
|
||||
this@tableview.selectionModel.select(cell.tableRow.index)
|
||||
}
|
||||
}
|
||||
2 -> openPhotos(this@cellFormat.tableRow.item.postId)
|
||||
2 -> openPhotos(cell.tableRow.item.postId)
|
||||
}
|
||||
}
|
||||
useMaxWidth = true
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
cell as TableCell<PostModel, Number>
|
||||
}
|
||||
}
|
||||
column("Status", PostModel::statusProperty)
|
||||
|
||||
+19
-5
@@ -3,12 +3,12 @@ package me.mnlr.vripper.view.tables
|
||||
import javafx.collections.FXCollections
|
||||
import javafx.collections.ObservableList
|
||||
import javafx.geometry.Pos
|
||||
import javafx.scene.control.Label
|
||||
import javafx.scene.control.SelectionMode
|
||||
import javafx.scene.control.TableRow
|
||||
import javafx.scene.control.TableView
|
||||
import javafx.scene.control.*
|
||||
import javafx.scene.image.ImageView
|
||||
import javafx.scene.input.MouseButton
|
||||
import me.mnlr.vripper.controller.ThreadController
|
||||
import me.mnlr.vripper.model.ThreadSelectionModel
|
||||
import me.mnlr.vripper.view.openLink
|
||||
import tornadofx.*
|
||||
|
||||
class ThreadSelectionTableView : Fragment("Thread") {
|
||||
@@ -37,12 +37,26 @@ class ThreadSelectionTableView : Fragment("Thread") {
|
||||
val tableRow = TableRow<ThreadSelectionModel>()
|
||||
|
||||
tableRow.setOnMouseClicked {
|
||||
if (it.clickCount == 2 && tableRow.item != null) {
|
||||
if (it.button.equals(MouseButton.PRIMARY) && it.clickCount == 2 && tableRow.item != null) {
|
||||
threadController.download(listOf(tableRow.item))
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
val urlItem = MenuItem("Open link").apply {
|
||||
setOnAction {
|
||||
openLink(tableRow.item.url)
|
||||
}
|
||||
graphic = ImageView("open-in-browser.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
val contextMenu = ContextMenu()
|
||||
contextMenu.items.addAll(urlItem)
|
||||
tableRow.contextMenuProperty().bind(tableRow.emptyProperty()
|
||||
.map { empty -> if (empty) null else contextMenu })
|
||||
|
||||
tableRow
|
||||
}
|
||||
column("Post Index", ThreadSelectionModel::indexProperty) {
|
||||
|
||||
@@ -8,10 +8,11 @@ import me.mnlr.vripper.controller.ThreadController
|
||||
import me.mnlr.vripper.event.Event
|
||||
import me.mnlr.vripper.event.EventBus
|
||||
import me.mnlr.vripper.model.ThreadModel
|
||||
import me.mnlr.vripper.view.main.MainView
|
||||
import me.mnlr.vripper.view.openLink
|
||||
import me.mnlr.vripper.view.FxScheduler
|
||||
import tornadofx.*
|
||||
|
||||
class ThreadTableView : View("Threads") {
|
||||
class ThreadTableView : View() {
|
||||
|
||||
private val threadController: ThreadController by inject()
|
||||
private val eventBus: EventBus by di()
|
||||
@@ -21,25 +22,48 @@ class ThreadTableView : View("Threads") {
|
||||
private var items: ObservableList<ThreadModel> = FXCollections.observableArrayList()
|
||||
|
||||
init {
|
||||
titleProperty.bind(items.sizeProperty.map {
|
||||
if (it.toLong() > 0) {
|
||||
"Threads (${it.toLong()})"
|
||||
} else {
|
||||
"Threads"
|
||||
}
|
||||
})
|
||||
items.addAll(threadController.findAll())
|
||||
|
||||
eventBus.flux().filter { it!!.kind == Event.Kind.THREAD_UPDATE }.subscribe { event ->
|
||||
threadController.find(event!!.data as Long).ifPresent {
|
||||
// search
|
||||
val find = items.find { threadModel -> threadModel.threadId == it.threadId }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
total = it.total
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
runLater {
|
||||
find<MainView>().root.selectionModel.select(1)
|
||||
tableView.selectionModel.clearSelection()
|
||||
tableView.selectionModel.select(it)
|
||||
}
|
||||
}
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it!!.kind == Event.Kind.THREAD_UPDATE }
|
||||
.map { threadController.find(it.data as Long) }
|
||||
.filter { it.isPresent }
|
||||
.map { it.get() }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
val find =
|
||||
items.find { threadModel -> threadModel.threadId == it.threadId }
|
||||
if (find != null) {
|
||||
find.apply {
|
||||
total = it.total
|
||||
}
|
||||
} else {
|
||||
items.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it.kind == Event.Kind.THREAD_REMOVE }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe { event ->
|
||||
tableView.items.removeIf { it.threadId == event.data as String }
|
||||
}
|
||||
|
||||
eventBus
|
||||
.flux()
|
||||
.filter { it.kind == Event.Kind.THREAD_CLEAR }
|
||||
.publishOn(FxScheduler)
|
||||
.subscribe {
|
||||
tableView.items.clear()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,28 +83,40 @@ class ThreadTableView : View("Threads") {
|
||||
}
|
||||
}
|
||||
|
||||
val selectItem = MenuItem("Select posts").apply {
|
||||
setOnAction {
|
||||
selectPosts(tableRow.item.threadId)
|
||||
}
|
||||
graphic = ImageView("popup.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val urlItem = MenuItem("Open link").apply {
|
||||
setOnAction {
|
||||
openLink(tableRow.item.link)
|
||||
}
|
||||
graphic = ImageView("open-in-browser.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val deleteItem = MenuItem("Delete").apply {
|
||||
setOnAction {
|
||||
deleteSelected()
|
||||
}
|
||||
graphic = ImageView("trash.png").apply {
|
||||
fitWidth = 18.0
|
||||
fitHeight = 18.0
|
||||
}
|
||||
}
|
||||
|
||||
val contextMenu = ContextMenu()
|
||||
val selectItem = MenuItem("Select posts")
|
||||
selectItem.setOnAction {
|
||||
selectPosts(tableRow.item.threadId)
|
||||
}
|
||||
val selectIcon = ImageView("popup.png")
|
||||
selectIcon.fitWidth = 18.0
|
||||
selectIcon.fitHeight = 18.0
|
||||
selectItem.graphic = selectIcon
|
||||
|
||||
val deleteItem = MenuItem("Delete")
|
||||
deleteItem.setOnAction {
|
||||
deleteSelected()
|
||||
}
|
||||
val deleteIcon = ImageView("trash.png")
|
||||
deleteIcon.fitWidth = 18.0
|
||||
deleteIcon.fitHeight = 18.0
|
||||
deleteItem.graphic = deleteIcon
|
||||
|
||||
contextMenu.items.addAll(selectItem, SeparatorMenuItem(), deleteItem)
|
||||
tableRow.contextMenuProperty()
|
||||
.bind(tableRow.emptyProperty().map { empty -> if (empty) null else contextMenu })
|
||||
contextMenu.items.addAll(selectItem, urlItem, SeparatorMenuItem(), deleteItem)
|
||||
tableRow.contextMenuProperty().bind(tableRow.emptyProperty()
|
||||
.map { empty -> if (empty) null else contextMenu })
|
||||
tableRow
|
||||
}
|
||||
column("URL", ThreadModel::linkProperty) {
|
||||
@@ -99,7 +135,6 @@ class ThreadTableView : View("Threads") {
|
||||
ButtonType.NO
|
||||
) {
|
||||
threadController.delete(threadIdList)
|
||||
tableView.items.removeIf { threadIdList.contains(it.threadId) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 364 B |
Binary file not shown.
|
After Width: | Height: | Size: 702 B |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" dumb="true">
|
||||
<excludeFolder url="file://$MODULE_DIR$/vripper-web-ui/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vripper-web-ui/tmp" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
||||
Generated
+6
-6
@@ -13952,9 +13952,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-parser": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz",
|
||||
"integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==",
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz",
|
||||
"integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
@@ -15572,9 +15572,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
|
||||
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>me.mnlr</groupId>
|
||||
<artifactId>vripper-web-ui</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
<name>vripper-web-ui</name>
|
||||
<build>
|
||||
<resources>
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
</mat-icon>
|
||||
</ng-template>
|
||||
<app-thread-table
|
||||
(rowCountChange)="threadCount.set($event)"
|
||||
[clear]="clearThreads"></app-thread-table>
|
||||
(rowCountChange)="threadCount.set($event)"></app-thread-table>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface ConnectionSettings {
|
||||
|
||||
export interface DownloadSettings {
|
||||
downloadPath: string;
|
||||
tempPath: string;
|
||||
autoStart: boolean;
|
||||
autoQueueThreshold: number;
|
||||
forceOrder: boolean;
|
||||
|
||||
@@ -45,6 +45,12 @@ export class ApplicationEndpointService {
|
||||
return this.threadRemove;
|
||||
}
|
||||
|
||||
private threadRemoveAll!: Observable<void>;
|
||||
|
||||
get threadRemoveAll$(): Observable<void> {
|
||||
return this.threadRemoveAll;
|
||||
}
|
||||
|
||||
private logs!: Observable<Log[]>;
|
||||
|
||||
get logs$(): Observable<Log[]> {
|
||||
@@ -130,6 +136,13 @@ export class ApplicationEndpointService {
|
||||
share()
|
||||
);
|
||||
|
||||
this.threadRemoveAll = this.rxStomp.watch('/topic/threads/deletedAll').pipe(
|
||||
map(() => {
|
||||
return;
|
||||
}),
|
||||
share()
|
||||
);
|
||||
|
||||
this.globalState = this.rxStomp.watch('/topic/state').pipe(
|
||||
map(e => {
|
||||
const state: GlobalState = JSON.parse(e.body);
|
||||
@@ -205,12 +218,6 @@ export class ApplicationEndpointService {
|
||||
.pipe(map(v => v.map(p => ({ ...p, hosts: p.hosts }))));
|
||||
}
|
||||
|
||||
// send(wsMessage: WSMessage) {
|
||||
// this.rxStomp.publish({
|
||||
// destination: wsMessage.destination,
|
||||
// body: wsMessage.payload,
|
||||
// });
|
||||
// }
|
||||
startDownload() {
|
||||
return this.httpClient.post<void>(
|
||||
this.baseUrl + '/api/post/restart/all',
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
name="downloadPath"
|
||||
required />
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Temporary Path</mat-label>
|
||||
<input formControlName="tempPath" matInput name="tempPath" required />
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label
|
||||
|
||||
@@ -62,6 +62,7 @@ export class SettingsComponent {
|
||||
|
||||
downloadSettingsForm = new FormGroup({
|
||||
downloadPath: new FormControl(''),
|
||||
tempPath: new FormControl(''),
|
||||
autoStart: new FormControl(false),
|
||||
autoQueueThreshold: new FormControl(0),
|
||||
forceOrder: new FormControl(false),
|
||||
|
||||
@@ -56,12 +56,9 @@ import {
|
||||
styleUrls: ['./thread-table.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ThreadTableComponent implements OnInit, OnDestroy {
|
||||
export class ThreadTableComponent implements OnDestroy {
|
||||
@ViewChild('agGrid') agGrid!: AgGridAngular;
|
||||
|
||||
@Input({ required: true })
|
||||
clear!: Observable<void>;
|
||||
|
||||
@Output()
|
||||
rowCountChange = new EventEmitter<number>();
|
||||
|
||||
@@ -181,10 +178,6 @@ export class ThreadTableComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.clear.subscribe(() => this.agGrid.api.setRowData([]));
|
||||
}
|
||||
|
||||
private connect() {
|
||||
this.subscriptions.push(
|
||||
this.applicationEndpoint.threads$.subscribe((e: Thread[]) => {
|
||||
@@ -214,6 +207,12 @@ export class ThreadTableComponent implements OnInit, OnDestroy {
|
||||
this.agGrid.api.applyTransaction({ remove: toRemove });
|
||||
})
|
||||
);
|
||||
|
||||
this.subscriptions.push(
|
||||
this.applicationEndpoint.threadRemoveAll$.subscribe(() => {
|
||||
this.agGrid.api.setRowData([]);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private disconnect() {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" dumb="true">
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
||||
+4
-4
@@ -5,12 +5,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.0.4</version>
|
||||
<version>3.1.3</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>me.mnlr.vripper</groupId>
|
||||
<artifactId>vripper-web</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
<name>vripper-web</name>
|
||||
<description>vripper-web</description>
|
||||
<properties>
|
||||
@@ -41,12 +41,12 @@
|
||||
<dependency>
|
||||
<groupId>me.mnlr.vripper</groupId>
|
||||
<artifactId>vripper-core</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.mnlr</groupId>
|
||||
<artifactId>vripper-web-ui</artifactId>
|
||||
<version>4.1.0</version>
|
||||
<version>4.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package me.mnlr.vripper
|
||||
|
||||
import me.mnlr.vripper.listeners.AppLock
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder
|
||||
|
||||
@SpringBootApplication
|
||||
class VripperWebApplication
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<VripperWebApplication>(*args)
|
||||
SpringApplicationBuilder(VripperWebApplication::class.java).listeners(AppLock()).run(*args)
|
||||
}
|
||||
|
||||
@@ -82,6 +82,11 @@ class DataBroadcast constructor(
|
||||
eventList
|
||||
.map { (_, data): Event<*> -> data as String })
|
||||
|
||||
Event.Kind.THREAD_CLEAR -> template.convertAndSend(
|
||||
"/topic/threads/deletedAll",
|
||||
eventList
|
||||
.map { true })
|
||||
|
||||
Event.Kind.LOG_EVENT_UPDATE -> template.convertAndSend(
|
||||
"/topic/logs",
|
||||
eventList
|
||||
|
||||
Reference in New Issue
Block a user