diff --git a/.github/patches/statussort.diff b/.github/patches/statussort.diff new file mode 100644 index 0000000..bb9a18d --- /dev/null +++ b/.github/patches/statussort.diff @@ -0,0 +1,33 @@ +diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart +index 3e34f882d..68d82116b 100644 +--- a/flutter/lib/common/widgets/peers_view.dart ++++ b/flutter/lib/common/widgets/peers_view.dart +@@ -25,13 +25,13 @@ class PeerSortType { + static const String remoteId = 'Remote ID'; + static const String remoteHost = 'Remote Host'; + static const String username = 'Username'; +- // static const String status = 'Status'; ++ static const String status = 'Status'; + + static List values = [ + PeerSortType.remoteId, + PeerSortType.remoteHost, + PeerSortType.username, +- // PeerSortType.status ++ PeerSortType.status + ]; + } + +@@ -384,9 +384,9 @@ class _PeersViewState extends State<_PeersView> + peers.sort((p1, p2) => + p1.username.toLowerCase().compareTo(p2.username.toLowerCase())); + break; +- // case PeerSortType.status: +- // peers.sort((p1, p2) => p1.online ? -1 : 1); +- // break; ++ case PeerSortType.status: ++ peers.sort((p1, p2) => p1.online ? -1 : 1); ++ break; + } + } + diff --git a/.github/workflows/generator-android.yml b/.github/workflows/generator-android.yml index e03740b..b0ad3a3 100644 --- a/.github/workflows/generator-android.yml +++ b/.github/workflows/generator-android.yml @@ -399,6 +399,13 @@ jobs: wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff git apply hidecm.diff + - name: statussort + continue-on-error: true + if: fromJson(inputs.extras).statussort == 'true' + run: | + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/statussort.diff + git apply statussort.diff + - name: Report Status uses: fjogeleit/http-request-action@v1 with: diff --git a/.github/workflows/generator-linux.yml b/.github/workflows/generator-linux.yml index c8dc91a..f2490bc 100644 --- a/.github/workflows/generator-linux.yml +++ b/.github/workflows/generator-linux.yml @@ -337,6 +337,13 @@ jobs: wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff git apply hidecm.diff + - name: statussort + continue-on-error: true + if: fromJson(inputs.extras).statussort == 'true' + run: | + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/statussort.diff + git apply statussort.diff + - name: Restore bridge files if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true' uses: actions/download-artifact@master diff --git a/.github/workflows/generator-macos.yml b/.github/workflows/generator-macos.yml index f8b5c0e..3a1b0fa 100644 --- a/.github/workflows/generator-macos.yml +++ b/.github/workflows/generator-macos.yml @@ -437,26 +437,33 @@ jobs: run: | sed -i '' -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs - - name: add cycle monitors to toolbar - continue-on-error: true - if: fromJson(inputs.extras).cycleMonitor == 'true' - run: | - Invoke-WebRequest -Uri https://raw.githubusercontent.com/VenimK/creator/refs/heads/master/.github/patches/cycle_monitor.diff -OutFile cycle_monitor.diff - git apply cycle_monitor.diff + - name: add cycle monitors to toolbar + continue-on-error: true + if: fromJson(inputs.extras).cycleMonitor == 'true' + run: | + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff + git apply cycle_monitor.diff - name: use X for offline display instead of orange circle continue-on-error: true if: fromJson(inputs.extras).xOffline == 'true' run: | - Invoke-WebRequest -Uri https://raw.githubusercontent.com/VenimK/creator/refs/heads/master/.github/patches/xoffline.diff -OutFile xoffline.diff + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff git apply xoffline.diff - + - name: hide-cm continue-on-error: true if: fromJson(inputs.extras).hidecm == 'true' run: | - Invoke-WebRequest -Uri https://raw.githubusercontent.com/VenimK/creator/refs/heads/master/.github/patches/hidecm.diff -OutFile hidecm.diff + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff git apply hidecm.diff + + - name: statussort + continue-on-error: true + if: fromJson(inputs.extras).statussort == 'true' + run: | + wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/statussort.diff + git apply statussort.diff - name: Install Rust toolchain diff --git a/.github/workflows/generator-windows.yml b/.github/workflows/generator-windows.yml index f673c90..2002190 100644 --- a/.github/workflows/generator-windows.yml +++ b/.github/workflows/generator-windows.yml @@ -374,6 +374,13 @@ jobs: Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff -OutFile hidecm.diff git apply hidecm.diff + - name: statussort + continue-on-error: true + if: fromJson(inputs.extras).statussort == 'true' + run: | + Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/statussort.diff -OutFile statussort.diff + git apply statussort.diff + - name: run as admin continue-on-error: true diff --git a/rdgenerator/forms.py b/rdgenerator/forms.py index de8b8d9..8a15290 100644 --- a/rdgenerator/forms.py +++ b/rdgenerator/forms.py @@ -70,4 +70,5 @@ class GenerateForm(forms.Form): #custom added features cycleMonitor = forms.BooleanField(initial=False, required=False) xOffline = forms.BooleanField(initial=False, required=False) - hidecm = forms.BooleanField(initial=False, required=False) \ No newline at end of file + hidecm = forms.BooleanField(initial=False, required=False) + statussort = forms.BooleanField(initial=False, required=False) \ No newline at end of file diff --git a/rdgenerator/templates/generator.html b/rdgenerator/templates/generator.html index 964bcc1..394b626 100644 --- a/rdgenerator/templates/generator.html +++ b/rdgenerator/templates/generator.html @@ -211,6 +211,7 @@


+
diff --git a/rdgenerator/views.py b/rdgenerator/views.py index c26288f..c3d05d5 100644 --- a/rdgenerator/views.py +++ b/rdgenerator/views.py @@ -26,6 +26,7 @@ def generator_view(request): cycleMonitor = form.cleaned_data['cycleMonitor'] xOffline = form.cleaned_data['xOffline'] hidecm = form.cleaned_data['hidecm'] + statussort = form.cleaned_data['statussort'] server = form.cleaned_data['serverIP'] key = form.cleaned_data['key'] apiServer = form.cleaned_data['apiServer'] @@ -162,6 +163,7 @@ def generator_view(request): extras['cycleMonitor'] = 'true' if cycleMonitor else 'false' extras['xOffline'] = 'true' if xOffline else 'false' extras['hidecm'] = 'true' if hidecm else 'false' + extras['statussort'] = 'true' if statussort else 'false' extra_input = json.dumps(extras) ####from here run the github action, we need user, repo, access token.