Beispiel #1
0
void
fn_show_atacontrol(struct i_fn_args *a)
{
	struct aura_buffer *e;
	struct dfui_form *f;
	struct dfui_response *r;

	e = aura_buffer_new(1024);
	aura_buffer_cat_pipe(e, "atacontrol list");

	f = dfui_form_create(
	    "atacontrol",
	    _("ATA Devices"),
	    aura_buffer_buf(e),
	    "",

	    "p", "role", "informative",
	    "p", "minimum_width", "72",
	    "p", "monospaced", "true",

	    "a", "ok", _("OK"), "", "",
	    "p", "accelerator", "ESC",

	    NULL
	);

	if (!dfui_be_present(a->c, f, &r))
		abort_backend();

	dfui_form_free(f);
	dfui_response_free(r);

	aura_buffer_free(e);
}
Beispiel #2
0
void
view_memtest_log(struct i_fn_args *a)
{
	struct aura_buffer *error_log;
	struct dfui_form *f;
	struct dfui_response *r;

	error_log = aura_buffer_new(1024);
	aura_buffer_cat_file(error_log, "%smemtest.log", a->tmp);

	f = dfui_form_create(
	    "error_log",
	    _("Error Log"),
	    aura_buffer_buf(error_log),
	    "",

	    "p", "role", "informative",
	    "p", "minimum_width", "72",
	    "p", "monospaced", "true",

	    "a", "ok", _("OK"), "", "",
	    "p", "accelerator", "ESC",

	    NULL
	);

	if (!dfui_be_present(a->c, f, &r))
		abort_backend();

	dfui_form_free(f);
	dfui_response_free(r);

	aura_buffer_free(error_log);
}
Beispiel #3
0
void 
fn_show_dmesg(struct i_fn_args *a)
{
	struct aura_buffer *e;
	struct dfui_form *f;
	struct dfui_response *r;

	e = aura_buffer_new(1024);
	aura_buffer_cat_file(e, "%s%s", a->os_root, cmd_name(a, "DMESG_BOOT"));

	f = dfui_form_create(
	    "dmesg",
	    _("System Startup Messages (dmesg)"),
	    aura_buffer_buf(e),
	    "",

	    "p", "role", "informative",
	    "p", "minimum_width", "72",
	    "p", "monospaced", "true",

	    "a", "ok", _("OK"), "", "",
	    "p", "accelerator", "ESC",

	    NULL
	);

	if (!dfui_be_present(a->c, f, &r))
		abort_backend();

	dfui_form_free(f);
	dfui_response_free(r);

	aura_buffer_free(e);
}
Beispiel #4
0
void
show_ifconfig(struct dfui_connection *c, char *ifname)
{
	struct aura_buffer *e;

	e = aura_buffer_new(1024);
	aura_buffer_cat_pipe(e, "/sbin/ifconfig %s", ifname);
	inform(c, aura_buffer_buf(e));
	aura_buffer_free(e);
}
Beispiel #5
0
/*
 * Preview a set of commands.
 */
void
commands_preview(struct dfui_connection *c, const struct commands *cmds)
{
	struct command *cmd;
	struct aura_buffer *preview;

	preview = aura_buffer_new(1024);

	for (cmd = cmds->head; cmd != NULL; cmd = cmd->next) {
		aura_buffer_cat(preview, cmd->cmdline);
		aura_buffer_cat(preview, "\n");
	}

	inform(c, "%s", aura_buffer_buf(preview));

	aura_buffer_free(preview);
}