|
132 | 132 | @{ |
133 | 133 | if (_edit) |
134 | 134 | { |
135 | | - <span style="color:red;">edit</span> |
| 135 | + <span style="color:red;">edit</span> |
136 | 136 | } |
137 | 137 |
|
138 | 138 | async Task update() |
|
154 | 154 | Program.submodelAPIcount = 0; |
155 | 155 | break; |
156 | 156 | default: |
157 | | - { |
158 | | - if (CurrentValue.Contains("FORCE-POLICY")) |
159 | 157 | { |
160 | | - Program.withPolicy = CurrentValue.Contains("ON"); |
161 | | - } |
162 | | - else |
163 | | - { |
164 | | - if (CurrentValue.Contains("get=")) |
| 158 | + if (CurrentValue.Contains("FORCE-POLICY")) |
165 | 159 | { |
166 | | - CurrentValue = CurrentValue.Replace("get=", ""); |
167 | | - Program.getUrl = CurrentValue; |
168 | | - Program.signalNewData(2); |
169 | | - } |
170 | | - else if (CurrentValue.Contains("secret=")) |
171 | | - { |
172 | | - CurrentValue = CurrentValue.Replace("secret=", ""); |
173 | | - Program.getUrl = CurrentValue; |
174 | | - Program.signalNewData(2); |
| 160 | + Program.withPolicy = CurrentValue.Contains("ON"); |
175 | 161 | } |
176 | 162 | else |
177 | 163 | { |
178 | | - if (string.IsNullOrEmpty(_role)) |
179 | | - _role = roleList[ 0 ]; |
180 | | - if (CurrentValue.Contains("Email=") || CurrentValue.Contains("@")) |
| 164 | + if (CurrentValue.Contains("get=")) |
181 | 165 | { |
182 | | - CurrentValue = CurrentValue.Replace("Email=", ""); |
183 | | - AasxCredentials.initByEmail(cs.credentials, CurrentValue); |
184 | | - _input = CurrentValue; |
185 | | - _role = string.Empty; |
| 166 | + CurrentValue = CurrentValue.Replace("get=", ""); |
| 167 | + Program.getUrl = CurrentValue; |
| 168 | + Program.signalNewData(2); |
| 169 | + } |
| 170 | + else if (CurrentValue.Contains("secret=")) |
| 171 | + { |
| 172 | + CurrentValue = CurrentValue.Replace("secret=", ""); |
| 173 | + Program.getUrl = CurrentValue; |
| 174 | + Program.signalNewData(2); |
186 | 175 | } |
187 | | - else if (CurrentValue.Contains("CREDENTIALS-") && CurrentValue.Contains(".DAT")) |
| 176 | + else |
188 | 177 | { |
189 | | - AasxCredentials.initByFile(cs.credentials, CurrentValue); |
| 178 | + if (string.IsNullOrEmpty(_role)) |
| 179 | + _role = roleList[ 0 ]; |
| 180 | + if (CurrentValue.Contains("Email=") || CurrentValue.Contains("@")) |
| 181 | + { |
| 182 | + CurrentValue = CurrentValue.Replace("Email=", ""); |
| 183 | + AasxCredentials.initByEmail(cs.credentials, CurrentValue); |
| 184 | + _input = CurrentValue; |
| 185 | + _role = string.Empty; |
| 186 | + } |
| 187 | + else if (CurrentValue == "cb" || (CurrentValue.Contains("CREDENTIALS-") && CurrentValue.Contains(".DAT"))) |
| 188 | + { |
| 189 | + if (CurrentValue == "cb") |
| 190 | + { |
| 191 | + CurrentValue = "CREDENTIALS-BEARER.DAT"; |
| 192 | + } |
| 193 | + AasxCredentials.initByFile(cs.credentials, CurrentValue); |
190 | 194 | _input = CurrentValue; |
191 | 195 | _role = string.Empty; |
192 | 196 | } |
|
0 commit comments