From 478307221691b684fe23442be9a95f56e1208669 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 23 Mar 2015 13:45:26 +0100 Subject: Update examples for Cockpit 0.41 or later --- content/cockpit/dbus-basics.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'content/cockpit/dbus-basics.md') diff --git a/content/cockpit/dbus-basics.md b/content/cockpit/dbus-basics.md index 6b67695..9aa7479 100644 --- a/content/cockpit/dbus-basics.md +++ b/content/cockpit/dbus-basics.md @@ -4,9 +4,11 @@ Category: Cockpit, Linux Tags: cockpit, linux Slug: using-dbus-from-javascript-in-cockpit +*Note: This post has been updated for changes in Cockpit 0.41 and later.* + [Cockpit is a user interface for servers](http://cockpit-project.org). As we covered in the [last tutorial](http://stef.thewalter.net/creating-plugins-for-the-cockpit-user-interface.html) you can add user interface component to Cockpit, and build your own parts of the Server UI. -Much of Cockpit interacts with the server using DBus. We have a powerful yet simple API for doing that, and you should use DBus too when building your own Cockpit user interfaces. For this tutorial you'll need at least Cockpit 0.31. A few tweaks landed in that release to solve a couple rough edges we had in our DBus support. You can install it in [Fedora 21](https://lists.fedorahosted.org/pipermail/cockpit-devel/2014-November/000196.html) or [build it from git](https://github.com/cockpit-project/cockpit/blob/master/HACKING.md). +Much of Cockpit interacts with the server using DBus. We have a powerful yet simple API for doing that, and you should use DBus too when building your own Cockpit user interfaces. For this tutorial you'll need at least Cockpit 0.41. A few tweaks landed in that release to solve a couple rough edges we had in our DBus support. You can install it in [Fedora 21](https://lists.fedorahosted.org/pipermail/cockpit-devel/2014-November/000196.html) or [build it from git](https://github.com/cockpit-project/cockpit/blob/master/HACKING.md). Here we'll make a package called *zoner* which lets you set the time zone of your server. We use the systemd [timedated DBus API](http://www.freedesktop.org/wiki/Software/systemd/timedated/) to do actually switch time zones. @@ -47,9 +49,9 @@ You should see your timezone on your screen update immediately to reflect the ne Time Zone - - - + + +
@@ -101,8 +103,8 @@ You should see your timezone on your screen update immediately to reflect the ne First we include `jquery.js` and `cockpit.js`. `cockpit.js` defines the basic API for interacting with the system, as well as Cockpit itself. You can find [detailed documentation here](http://files.cockpit-project.org/guide/latest/api-cockpit.html). :::html - - + + We also include the cockpit.css file to make sure the look of our tool matches that of Cockpit. The HTML is pretty basic, defining a little form where the current timezone is shown, a field to type an address, a button to click change to a new one, and an area to show errors. -- cgit v1.2.3