feature: use an X to show offline status instead of orange circle
This commit is contained in:
		
							
								
								
									
										20
									
								
								.github/patches/xoffline.diff
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.github/patches/xoffline.diff
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart
 | 
			
		||||
index 0a15eb45b..d776dd556 100644
 | 
			
		||||
--- a/flutter/lib/common/widgets/peer_card.dart
 | 
			
		||||
+++ b/flutter/lib/common/widgets/peer_card.dart
 | 
			
		||||
@@ -1328,8 +1328,13 @@ Widget getOnline(double rightPadding, bool online) {
 | 
			
		||||
       waitDuration: const Duration(seconds: 1),
 | 
			
		||||
       child: Padding(
 | 
			
		||||
           padding: EdgeInsets.fromLTRB(0, 4, rightPadding, 4),
 | 
			
		||||
-          child: CircleAvatar(
 | 
			
		||||
-              radius: 3, backgroundColor: online ? Colors.green : kColorWarn)));
 | 
			
		||||
+          child: online
 | 
			
		||||
+              ? CircleAvatar(radius: 3, backgroundColor: Colors.green)
 | 
			
		||||
+              : Icon(
 | 
			
		||||
+                  Icons.close, // Red X for offline (Material Icon)
 | 
			
		||||
+                  color: Colors.red,
 | 
			
		||||
+                  size: 6.0, // Adjust size as needed
 | 
			
		||||
+                )));
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
 Widget build_more(BuildContext context, {bool invert = false}) {
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/workflows/generator-android.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/generator-android.yml
									
									
									
									
										vendored
									
									
								
							@@ -385,6 +385,13 @@ jobs:
 | 
			
		||||
          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: |
 | 
			
		||||
          wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
 | 
			
		||||
          git apply xoffline.diff
 | 
			
		||||
 | 
			
		||||
      - name: Report Status
 | 
			
		||||
        uses: fjogeleit/http-request-action@v1
 | 
			
		||||
        with:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/workflows/generator-linux.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/generator-linux.yml
									
									
									
									
										vendored
									
									
								
							@@ -322,6 +322,13 @@ jobs:
 | 
			
		||||
          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: |
 | 
			
		||||
          wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
 | 
			
		||||
          git apply xoffline.diff
 | 
			
		||||
 | 
			
		||||
      - name: Restore bridge files
 | 
			
		||||
        if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
 | 
			
		||||
        uses: actions/download-artifact@master
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/workflows/generator-windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/generator-windows.yml
									
									
									
									
										vendored
									
									
								
							@@ -359,6 +359,13 @@ jobs:
 | 
			
		||||
          Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff -OutFile 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/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff -OutFile xoffline.diff
 | 
			
		||||
          git apply xoffline.diff
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      - name: run as admin
 | 
			
		||||
        continue-on-error: true
 | 
			
		||||
 
 | 
			
		||||
@@ -67,4 +67,6 @@ class GenerateForm(forms.Form):
 | 
			
		||||
    defaultManual = forms.CharField(widget=forms.Textarea, required=False)
 | 
			
		||||
    overrideManual = forms.CharField(widget=forms.Textarea, required=False)
 | 
			
		||||
 | 
			
		||||
    #custom added features
 | 
			
		||||
    cycleMonitor = forms.BooleanField(initial=False, required=False)
 | 
			
		||||
    xOffline = forms.BooleanField(initial=False, required=False)
 | 
			
		||||
@@ -214,7 +214,8 @@
 | 
			
		||||
                    {{ form.defaultManual }}<br><br>
 | 
			
		||||
                    <label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
 | 
			
		||||
                    {{ form.overrideManual }}<br><br>
 | 
			
		||||
                    <label for="{{ form.cycleMonitor.id_for_label }}">{{ form.cycleMonitor }} Add a button to cycle through available monitors to the minimized toolbar.</label>
 | 
			
		||||
                    <label for="{{ form.cycleMonitor.id_for_label }}">{{ form.cycleMonitor }} Add a button to cycle through available monitors to the minimized toolbar.</label><br>
 | 
			
		||||
                    <label for="{{ form.xOffline.id_for_label }}">{{ form.xOffline }} Display an X for offline devices in the addressbook.</label><br>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="platform">
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@ def generator_view(request):
 | 
			
		||||
            version = form.cleaned_data['version']
 | 
			
		||||
            delayFix = form.cleaned_data['delayFix']
 | 
			
		||||
            cycleMonitor = form.cleaned_data['cycleMonitor']
 | 
			
		||||
            xOffline = form.cleaned_data['xOffline']
 | 
			
		||||
            server = form.cleaned_data['serverIP']
 | 
			
		||||
            key = form.cleaned_data['key']
 | 
			
		||||
            apiServer = form.cleaned_data['apiServer']
 | 
			
		||||
@@ -157,6 +158,7 @@ def generator_view(request):
 | 
			
		||||
            extras['version'] = version
 | 
			
		||||
            extras['rdgen'] = 'true'
 | 
			
		||||
            extras['cycleMonitor'] = 'true' if cycleMonitor else 'false'
 | 
			
		||||
            extras['xOffline'] = 'true' if xOffline else 'false'
 | 
			
		||||
            extra_input = json.dumps(extras)
 | 
			
		||||
 | 
			
		||||
            ####from here run the github action, we need user, repo, access token.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user