show->field($field, $label)->as(function ($value) { return DEV_STATUS::getAll()[$value] ?? '未知'; }); } /** * 显示开发日志类型 * * @param string $field 字段名 * @param string $label 标签名 * @return Show\Field */ public function fieldDevLogType(string $field = 'type', string $label = '日志类型'): Show\Field { return $this->show->field($field, $label)->as(function ($value) { return DEV_LOG_TYPE::getAll()[$value] ?? '未知'; }); } /** * 显示开发日志内容 * * @param string $field 字段名 * @param string $label 标签名 * @return Show\Field */ public function fieldDevLogContent(string $field = 'content', string $label = '日志内容'): Show\Field { return $this->show->field($field, $label); } /** * 显示开发日志额外数据 * * @param string $field 字段名 * @param string $label 标签名 * @return Show\Field */ public function fieldDevLogExtraData(string $field = 'extra_data', string $label = '额外数据'): Show\Field { return $this->show->field($field, $label)->json(); } /** * 显示开发配置值 * * @param string $field 字段名 * @param string $label 标签名 * @return Show\Field */ public function fieldDevConfigValue(string $field = 'value', string $label = '配置值'): Show\Field { return $this->show->field($field, $label); } /** * 显示系统信息 * * @param array $systemInfo 系统信息 * @return Show\Field */ public function fieldSystemInfo(array $systemInfo): void { $this->show->divider('系统信息'); foreach ($systemInfo as $key => $value) { $label = ucwords(str_replace('_', ' ', $key)); $this->show->field($key, $label)->as(function () use ($value) { return $value; }); } } }