|
11 | 11 | // location to redirect to, with trailing slash and history endpoint path |
12 | 12 | define("REDIRECT_LOCATION", WEBCAT_LOCATION . "/rest/history/"); |
13 | 13 | // Show information page first and not directly redirect via HTTP header |
14 | | -define("SHOW_INFO_PAGE", false); |
| 14 | +define("SHOW_INFO_PAGE", true); |
15 | 15 |
|
16 | 16 | // path of the current workspace |
17 | 17 | define("COOKIE_PATH", "combinearchiveweba"); |
|
27 | 27 | if( isset($_COOKIE[COOKIE_HISTORY]) and $_COOKIE[COOKIE_HISTORY] != "" ) { |
28 | 28 | // history cookie is set -> decode it |
29 | 29 | $history = base64_decode($_COOKIE[COOKIE_HISTORY]); |
30 | | - $history = json_decode($history); |
| 30 | + $history = json_decode($history, true); |
31 | 31 |
|
32 | 32 | $result = array(); |
| 33 | + $names = array(); |
33 | 34 | foreach( $history as $history_entry ) { |
34 | 35 | if( isset($history_entry['current']) and $history_entry['current'] == true ) { |
35 | 36 | // this entry is the current workspace entry, so put it on the beginning of the result array |
36 | | - array_unshift( $result, $history_entry ); |
| 37 | + array_unshift( $result, $history_entry["workspaceId"] ); |
| 38 | + $names[$history_entry["workspaceId"]] = $history_entry["name"]; |
37 | 39 | } |
38 | 40 | else { |
39 | 41 | // normal, not current, entry. |
40 | | - array_push( $result, $history_entry ); |
| 42 | + array_push( $result, $history_entry["workspaceId"] ); |
| 43 | + $names[$history_entry["workspaceId"]] = $history_entry["name"]; |
41 | 44 | } |
42 | 45 | } |
43 | 46 |
|
|
61 | 64 | .frame { width: 570px; height: 100%; margin: 0 auto; padding: 2em 5px; text-align: left; background-color: #EEE; border: 1px solid #AAA; border-style: none solid none solid; } |
62 | 65 | .content { } |
63 | 66 | h1 { width: 100%; font 1.5em bold; line-height: 1.05em; margin-bottom: 2em; } |
64 | | - p { margin-bottom: 3em; padding: 0 5px; text-align: justify; } |
| 67 | + p, div.ws-list { margin-bottom: 3em; padding: 0 5px; text-align: justify; } |
65 | 68 | p.button { text-align: center; } |
66 | 69 | a.button { display: box; padding: 0.5em 1em; color: #FFF; background-color: #0D0; text-align: center; vertical-align: center; font: 1.3em bold; text-decoration: none; } |
67 | | - a.button:hover { background-color: #F00 !important; } |
| 70 | + a.button:hover { background-color: #090 !important; } |
68 | 71 | </style> |
69 | 72 | </head> |
70 | 73 |
|
|
82 | 85 | It does not seem, that you do not had any workspaces stored at this place. So you can just click at the button below to |
83 | 86 | access webCAT at the new domain. |
84 | 87 | <?php } ?> |
| 88 | + |
85 | 89 | </p> |
| 90 | + |
86 | 91 | <p class="button"> |
87 | 92 | <a class="button" href="<?php echo($redirect_url); ?>"><?php echo($success ? "Migrate Workspaces" : "Go to new Instance"); ?></a> |
88 | 93 | </p> |
| 94 | + |
89 | 95 | <?php if($success) { ?> |
90 | | - <p class="ws-list"> |
| 96 | + <div class="ws-list"> |
91 | 97 | Following workspaces were found: |
92 | 98 | <ul> |
93 | | - <?php foreach( $result as $entry ) { ?><li><code><?php echo($entry); ?></code></li><?php } ?> |
| 99 | + <?php foreach( $result as $entry ) { ?> |
| 100 | + <li> |
| 101 | + <?php echo($names[$entry]); ?><br /> |
| 102 | + <code><?php echo($entry); ?></code> |
| 103 | + </li> |
| 104 | + <?php } ?> |
94 | 105 | </ul> |
95 | | - </p> |
| 106 | + </div> |
96 | 107 | <?php } ?> |
97 | 108 | </div> |
98 | 109 | </div> |
|
0 commit comments