feed: add a support diagnostics post (browser_info, browser_url_vars) #24
@@ -64,16 +64,26 @@ Those are the services that run customer code. The viewer's `viewlibs`, `viewtab
|
|||||||
|
|
||||||
## Reading them in a hook
|
## Reading them in a hook
|
||||||
|
|
||||||
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. A URL parameter by name:
|
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. Take an embedded editor opened at:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://datacontroller.io/#/editor/SASHELP.CLASS?labels=true&embed=va
|
||||||
|
```
|
||||||
|
|
||||||
|
`browser_url_vars` then holds a row per parameter - `labels=true` and `embed=va` - and a hook can read either by name:
|
||||||
|
|
||||||
```sas
|
```sas
|
||||||
%let labels=N;
|
%let labels=N;
|
||||||
|
%let embed=N;
|
||||||
|
|
||||||
%if %sysfunc(exist(work.browser_url_vars)) %then %do;
|
%if %sysfunc(exist(work.browser_url_vars)) %then %do;
|
||||||
proc sql noprint;
|
proc sql noprint;
|
||||||
select value into :labels
|
select value into :labels
|
||||||
from work.browser_url_vars
|
from work.browser_url_vars
|
||||||
where name = 'labels';
|
where name = 'labels';
|
||||||
|
select value into :embed
|
||||||
|
from work.browser_url_vars
|
||||||
|
where name = 'embed';
|
||||||
quit;
|
quit;
|
||||||
%end;
|
%end;
|
||||||
```
|
```
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 53 KiB |
Reference in New Issue
Block a user