|
99 | 99 |
|
100 | 100 | <div class="container"> |
101 | 101 |
|
102 | | - <div class="units js-units-container"> |
103 | | - <div class="header units-header"> |
104 | | - <div class="l-unit__col l-unit__col--right"> |
105 | | - <div class="clearfix l-unit__stat-col--left super-compact"> |
106 | | - <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>> |
107 | | - </div> |
108 | | - <div class="clearfix l-unit__stat-col--left wide-3"><b><?= _("Name") ?></b></div> |
109 | | - <div class="clearfix l-unit__stat-col--left u-text-right"><b> </b></div> |
110 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("Disk") ?></b></div> |
111 | | - <div class="clearfix l-unit__stat-col--left u-text-center compact"><b><?= _("Type") ?></b></div> |
112 | | - <div class="clearfix l-unit__stat-col--left u-text-center wide"><b><?= _("Username") ?></b></div> |
113 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("Hostname") ?></b></div> |
114 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("Charset") ?></b></div> |
| 102 | + <div class="units-table js-units-container"> |
| 103 | + <div class="units-table-header"> |
| 104 | + <div class="units-table-cell"> |
| 105 | + <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>> |
115 | 106 | </div> |
| 107 | + <div class="units-table-cell"><?= _("Name") ?></div> |
| 108 | + <div class="units-table-cell"></div> |
| 109 | + <div class="units-table-cell u-text-center"><?= _("Disk") ?></div> |
| 110 | + <div class="units-table-cell u-text-center"><?= _("Type") ?></div> |
| 111 | + <div class="units-table-cell u-text-center"><?= _("Username") ?></div> |
| 112 | + <div class="units-table-cell u-text-center"><?= _("Hostname") ?></div> |
| 113 | + <div class="units-table-cell u-text-center"><?= _("Charset") ?></div> |
116 | 114 | </div> |
117 | 115 |
|
118 | 116 | <!-- Begin database list item loop --> |
|
125 | 123 | $spnd_action = 'unsuspend'; |
126 | 124 | $spnd_action_title = _('Unsuspend'); |
127 | 125 | $spnd_icon = 'fa-play'; |
| 126 | + $spnd_icon_class = 'icon-green'; |
128 | 127 | $spnd_confirmation = _('Are you sure you want to unsuspend database %s?') ; |
129 | 128 | } else { |
130 | 129 | $status = 'active'; |
131 | 130 | $spnd_action = 'suspend'; |
132 | 131 | $spnd_action_title = _('Suspend'); |
133 | 132 | $spnd_icon = 'fa-pause'; |
| 133 | + $spnd_icon_class = 'icon-highlight'; |
134 | 134 | $spnd_confirmation = _('Are you sure you want to suspend database %s?') ; |
135 | 135 | } |
136 | 136 | if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST']; |
|
141 | 141 | if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "https://".$http_host."/phppgadmin/"; |
142 | 142 | if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_ALIAS']))) $db_admin_link = $_SESSION['DB_PGA_ALIAS']; |
143 | 143 | ?> |
144 | | - <div class="l-unit <?php if($status == 'suspended') echo 'l-unit--suspended'; ?> animate__animated animate__fadeIn js-unit" |
145 | | - data-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" |
146 | | - data-sort-name="<?=$key?>" |
147 | | - data-sort-disk="<?=$data[$key]['U_DISK']?>" |
148 | | - data-sort-user="<?=$data[$key]['DBUSER']?>" |
149 | | - data-sort-server="<?=$data[$key]['HOST']?>" |
150 | | - data-sort-charset="<?=$data[$key]['CHARSET']?>"> |
151 | | - <div class="l-unit__col l-unit__col--right"> |
| 144 | + <div class="units-table-row <?php if ($data[$key]['SUSPENDED'] == 'yes') echo 'disabled'; ?> animate__animated animate__fadeIn js-unit" |
| 145 | + data-sort-date="<?= strtotime($data[$key]['DATE'].' '.$data[$key]['TIME']) ?>" |
| 146 | + data-sort-name="<?= $key ?>" |
| 147 | + data-sort-disk="<?= $data[$key]['U_DISK'] ?>" |
| 148 | + data-sort-user="<?= $data[$key]['DBUSER'] ?>" |
| 149 | + data-sort-server="<?= $data[$key]['HOST'] ?>" |
| 150 | + data-sort-charset="<?= $data[$key]['CHARSET'] ?>"> |
| 151 | + <div class="units-table-cell"> |
152 | 152 | <div> |
153 | | - <div class="clearfix l-unit__stat-col--left super-compact"> |
154 | | - <input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="database[]" value="<?= $key ?>" <?= $display_mode ?>> |
155 | | - </div> |
156 | | - <div class="clearfix l-unit__stat-col--left wide-3 truncate"> |
157 | | - <?php if ($read_only === "true" || $data[$key]["SUSPENDED"] == "yes") { ?> |
158 | | - <b><?= $key ?></b> |
159 | | - <?php } else { ?> |
160 | | - <b><a href="/edit/db/?database=<?= $key ?>&token=<?= $_SESSION["token"] ?>" title="<?= _("Edit Database") ?>: <?= $key ?>"><?= $key ?></a></b> |
161 | | - <?php } ?> |
162 | | - </div> |
163 | | - <!-- START QUICK ACTION TOOLBAR AREA --> |
164 | | - <div class="clearfix l-unit__stat-col--left u-text-right"> |
165 | | - <div class="l-unit-toolbar__col l-unit-toolbar__col--right u-noselect"> |
166 | | - <div class="actions-panel clearfix"> |
167 | | - <?php if ($read_only === "true") { ?> |
168 | | - <!-- Restrict the ability to edit, delete, or suspend domain items when impersonating 'admin' user --> |
169 | | - |
170 | | - <?php } else { ?> |
171 | | - <?php if ($data[$key]['SUSPENDED'] == 'no') {?> |
172 | | - <div class="actions-panel__col actions-panel__logs shortcut-enter" data-key-action="href"> |
173 | | - <a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?= _("Edit Database") ?>"> |
174 | | - <i class="fas fa-pencil icon-orange icon-dim"></i> |
175 | | - </a> |
176 | | - </div> |
177 | | - <?php } ?> |
178 | | - <?php if ($data[$key]['TYPE'] == 'mysql' && isset($_SESSION['PHPMYADMIN_KEY']) && $_SESSION['PHPMYADMIN_KEY'] != '' && !ipUsed()) { $time = time(); ?> |
179 | | - <div class="actions-panel__col actions-panel__logs shortcut-enter" data-key-action="href"> |
180 | | - <a target="_blank" href="<?=$db_myadmin_link?>hestia-sso.php?database=<?=$key?>&user=<?=$user_plain?>&exp=<?=$time?>&hestia_token=<?=password_hash($key.$user_plain.$_SESSION['user_combined_ip'].$time.$_SESSION['PHPMYADMIN_KEY'], PASSWORD_DEFAULT)?>" title="phpMyAdmin"> |
181 | | - <i class="fas fa-right-to-bracket icon-orange icon-dim"></i> |
182 | | - </a> |
183 | | - </div> |
184 | | - <?php } ?> |
185 | | - <div class="actions-panel__col actions-panel__logs shortcut-enter" data-key-action="href"> |
186 | | - <a href="/download/database/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?= _("Download Database") ?>"> |
187 | | - <i class="fas fa-download icon-orange icon-dim"></i> |
188 | | - </a> |
189 | | - </div> |
190 | | - <div class="actions-panel__col actions-panel__suspend shortcut-s" data-key-action="js"> |
191 | | - <a |
192 | | - class="data-controls js-confirm-action" |
193 | | - href="/<?= $spnd_action ?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" |
194 | | - data-confirm-title="<?= $spnd_action_title ?>" |
195 | | - data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>" |
196 | | - > |
197 | | - <i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i> |
198 | | - </a> |
199 | | - </div> |
200 | | - <div class="actions-panel__col actions-panel__delete shortcut-delete" data-key-action="js"> |
201 | | - <a |
202 | | - class="data-controls js-confirm-action" |
203 | | - href="/delete/db/?database=<?= $key ?>&token=<?= $_SESSION["token"] ?>" |
204 | | - data-confirm-title="<?= _("Delete") ?>" |
205 | | - data-confirm-message="<?= sprintf(_("Are you sure you want to delete database %s?"), $key) ?>" |
206 | | - > |
207 | | - <i class="fas fa-trash icon-red icon-dim"></i> |
208 | | - </a> |
209 | | - </div> |
210 | | - <?php } ?> |
211 | | - </div> |
212 | | - </div> |
213 | | - </div> |
214 | | - <!-- END QUICK ACTION TOOLBAR AREA --> |
215 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><b><?= humanize_usage_size($data[$key]["U_DISK"]) ?></b> <span class="u-text-small"><?= humanize_usage_measure($data[$key]["U_DISK"]) ?></span></div> |
216 | | - <div class="clearfix l-unit__stat-col--left u-text-center compact"><?= $data[$key]["TYPE"] ?></div> |
217 | | - <div class="clearfix l-unit__stat-col--left u-text-center wide"><b><?= $data[$key]["DBUSER"] ?></b></div> |
218 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><b><?= $data[$key]["HOST"] ?></b></div> |
219 | | - <div class="clearfix l-unit__stat-col--left u-text-center"><?= $data[$key]["CHARSET"] ?></div> |
| 153 | + <input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="database[]" value="<?= $key ?>" <?= $display_mode ?>> |
| 154 | + <label for="check<?= $i ?>" class="u-hide-desktop"><?= _("Select") ?></label> |
220 | 155 | </div> |
221 | 156 | </div> |
| 157 | + <div class="units-table-cell units-table-heading-cell u-text-bold"> |
| 158 | + <span class="u-hide-desktop"><?= _("Name") ?>:</span> |
| 159 | + <?php if ($read_only === "true" || $data[$key]["SUSPENDED"] == "yes") { ?> |
| 160 | + <?= $key ?> |
| 161 | + <?php } else { ?> |
| 162 | + <a href="/edit/db/?database=<?= $key ?>&token=<?= $_SESSION["token"] ?>" title="<?= _("Edit Database") ?>: <?= $key ?>"> |
| 163 | + <?= $key ?> |
| 164 | + </a> |
| 165 | + <?php } ?> |
| 166 | + </div> |
| 167 | + <div class="units-table-cell"> |
| 168 | + <?php if (!$read_only) { ?> |
| 169 | + <ul class="units-table-row-actions"> |
| 170 | + <?php if ($data[$key]["SUSPENDED"] == "no") { ?> |
| 171 | + <li class="units-table-row-action shortcut-enter" data-key-action="href"> |
| 172 | + <a |
| 173 | + class="units-table-row-action-link" |
| 174 | + href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" |
| 175 | + title="<?= _("Edit Database") ?>" |
| 176 | + > |
| 177 | + <i class="fas fa-pencil icon-orange"></i> |
| 178 | + <span class="u-hide-desktop"><?= _("Edit Database") ?></span> |
| 179 | + </a> |
| 180 | + </li> |
| 181 | + <?php } ?> |
| 182 | + <?php if ($data[$key]['TYPE'] == 'mysql' && isset($_SESSION['PHPMYADMIN_KEY']) && $_SESSION['PHPMYADMIN_KEY'] != '' && !ipUsed()) { $time = time(); ?> |
| 183 | + <li class="units-table-row-action shortcut-enter" data-key-action="href"> |
| 184 | + <a |
| 185 | + class="units-table-row-action-link" |
| 186 | + href="<?=$db_myadmin_link?>hestia-sso.php?database=<?=$key?>&user=<?=$user_plain?>&exp=<?=$time?>&hestia_token=<?=password_hash($key.$user_plain.$_SESSION['user_combined_ip'].$time.$_SESSION['PHPMYADMIN_KEY'], PASSWORD_DEFAULT)?>" |
| 187 | + title="phpMyAdmin" |
| 188 | + > |
| 189 | + <i class="fas fa-right-to-bracket icon-orange"></i> |
| 190 | + <span class="u-hide-desktop">phpMyAdmin</span> |
| 191 | + </a> |
| 192 | + </li> |
| 193 | + <?php } ?> |
| 194 | + <li class="units-table-row-action shortcut-enter" data-key-action="href"> |
| 195 | + <a |
| 196 | + class="units-table-row-action-link" |
| 197 | + href="/download/database/?database=<?=$key?>&token=<?=$_SESSION['token']?>" |
| 198 | + title="<?= _("Download Database") ?>" |
| 199 | + > |
| 200 | + <i class="fas fa-download icon-orange"></i> |
| 201 | + <span class="u-hide-desktop"><?= _("Download Database") ?></span> |
| 202 | + </a> |
| 203 | + </li> |
| 204 | + <li class="units-table-row-action shortcut-s" data-key-action="js"> |
| 205 | + <a |
| 206 | + class="units-table-row-action-link data-controls js-confirm-action" |
| 207 | + href="/<?= $spnd_action ?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" |
| 208 | + title="<?= $spnd_action_title ?>" |
| 209 | + data-confirm-title="<?= $spnd_action_title ?>" |
| 210 | + data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>" |
| 211 | + > |
| 212 | + <i class="fas <?= $spnd_icon ?> <?= $spnd_icon_class ?>"></i> |
| 213 | + <span class="u-hide-desktop"><?= $spnd_action_title ?></span> |
| 214 | + </a> |
| 215 | + </li> |
| 216 | + <li class="units-table-row-action shortcut-delete" data-key-action="js"> |
| 217 | + <a |
| 218 | + class="units-table-row-action-link data-controls js-confirm-action" |
| 219 | + href="/delete/db/?database=<?= $key ?>&token=<?= $_SESSION["token"] ?>" |
| 220 | + title="<?= _("Delete") ?>" |
| 221 | + data-confirm-title="<?= _("Delete") ?>" |
| 222 | + data-confirm-message="<?= sprintf(_("Are you sure you want to delete database %s?"), $key) ?>" |
| 223 | + > |
| 224 | + <i class="fas fa-trash icon-red"></i> |
| 225 | + <span class="u-hide-desktop"><?= _("Delete") ?></span> |
| 226 | + </a> |
| 227 | + </li> |
| 228 | + </ul> |
| 229 | + <?php } ?> |
| 230 | + </div> |
| 231 | + <div class="units-table-cell u-text-center-desktop"> |
| 232 | + <span class="u-hide-desktop u-text-bold"><?= _("Disk") ?>:</span> |
| 233 | + <span class="u-text-bold"> |
| 234 | + <?= humanize_usage_size($data[$key]["U_DISK"]) ?> |
| 235 | + </span> |
| 236 | + <span class="u-text-small"> |
| 237 | + <?= humanize_usage_measure($data[$key]["U_DISK"]) ?> |
| 238 | + </span> |
| 239 | + </div> |
| 240 | + <div class="units-table-cell u-text-center-desktop"> |
| 241 | + <span class="u-hide-desktop u-text-bold"><?= _("Type") ?>:</span> |
| 242 | + <?= $data[$key]["TYPE"] ?> |
| 243 | + </div> |
| 244 | + <div class="units-table-cell u-text-bold u-text-center-desktop"> |
| 245 | + <span class="u-hide-desktop"><?= _("Username") ?>:</span> |
| 246 | + <?= $data[$key]["DBUSER"] ?> |
| 247 | + </div> |
| 248 | + <div class="units-table-cell u-text-bold u-text-center-desktop"> |
| 249 | + <span class="u-hide-desktop"><?= _("Hostname") ?>:</span> |
| 250 | + <?= $data[$key]["HOST"] ?> |
| 251 | + </div> |
| 252 | + <div class="units-table-cell u-text-center-desktop"> |
| 253 | + <span class="u-hide-desktop u-text-bold"><?= _("Charset") ?>:</span> |
| 254 | + <?= $data[$key]["CHARSET"] ?> |
| 255 | + </div> |
222 | 256 | </div> |
223 | 257 | <?php } ?> |
224 | 258 | </div> |
|
0 commit comments