Skip to content

Commit

Permalink
v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz committed Jul 25, 2015
1 parent d2fa500 commit ed79708
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 10 deletions.
34 changes: 26 additions & 8 deletions src/CoreOS-xhyve UI/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ - (IBAction)Start:(id)sender {
- (IBAction)Stop:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.informativeText = @"CoreOS-xhyve VM will be stopped";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"VM will be stopped";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *scriptName = [[NSString alloc] init];
Expand All @@ -124,7 +125,8 @@ - (IBAction)Stop:(id)sender {
- (IBAction)Restart:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.informativeText = @"CoreOS-xhyve VM will be reloaded";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"VM will be reloaded";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand All @@ -137,8 +139,8 @@ - (IBAction)Restart:(id)sender {
- (IBAction)updates:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"OS X clients will be updated";
// notification.informativeText = @"and OS X clients will be updated";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"OS X clients will be updated";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand All @@ -151,8 +153,8 @@ - (IBAction)updates:(id)sender {
- (IBAction)fetchLatestISO:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS ISO image";
notification.informativeText = @"will be updated";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"CoreOS ISO image will be updated";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand All @@ -168,7 +170,8 @@ - (IBAction)fetchLatestISO:(id)sender {
- (IBAction)changeReleaseChannel:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.informativeText = @"CoreOS-xhyve release channel change";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"CoreOS release channel change";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand All @@ -179,7 +182,8 @@ - (IBAction)changeReleaseChannel:(id)sender {
- (IBAction)destroy:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.informativeText = @"CoreOS-xhyve VM will be destroyed";
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"VM will be destroyed";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
Expand Down Expand Up @@ -248,6 +252,7 @@ - (IBAction)About:(id)sender {
- (IBAction)runShell:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"OS X shell will be opened";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

Expand All @@ -259,6 +264,7 @@ - (IBAction)runShell:(id)sender {
- (IBAction)runSsh:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"VM ssh shell will be opened";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

Expand All @@ -269,6 +275,12 @@ - (IBAction)runSsh:(id)sender {


- (IBAction)fleetUI:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"Fleet UI dashboard will be opened";

[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
NSString *file_path = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-xhyve-ui/.env/ip_address"];
// read IP from file
NSString *vm_ip = [NSString stringWithContentsOfFile:file_path
Expand All @@ -279,6 +291,12 @@ - (IBAction)fleetUI:(id)sender {
}

- (IBAction)dockerUI:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS-xhyve UI";
notification.informativeText = @"DockerUI dashboard wiil opened";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *file_path = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-xhyve-ui/.env/ip_address"];
// read IP from file
NSString *vm_ip = [NSString stringWithContentsOfFile:file_path
Expand Down
4 changes: 2 additions & 2 deletions src/CoreOS-xhyve UI/CoreOS-xhyve UI-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.3</string>
<string>0.1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>25</string>
<string>27</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
9 changes: 9 additions & 0 deletions src/coreos-xhyve.command
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@ res_folder=$(cat ~/coreos-xhyve-ui/.env/resouces_path)
#vm_ip=$( ~/coreos-xhyve-ui/mac2ip.sh $(cat ~/coreos-xhyve-ui/.env/mac_address))
vm_ip=$(cat ~/coreos-xhyve-ui/.env/ip_address)

# check VM status
status=$(ps aux | grep "[c]oreos-xhyve-ui" | awk '{print $2}')
if [ "$status" = "" ]; then
echo " "
echo "CoreOS VM is not running, please start VM !!!"
###pause "Press any key to continue ..."
exit 1
fi

# pass some arguments via $1 $2 ...
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no core@$vm_ip $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12}
Binary file modified src/icon.icns
Binary file not shown.
Binary file modified src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/os_shell.command
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ res_folder=$(cat ~/coreos-xhyve-ui/.env/resouces_path)
#vm_ip=$(cat ~/coreos-xhyve-ui/.env/ip_address)
vm_ip=$(<~/coreos-xhyve-ui/.env/ip_address)

function pause(){
read -p "$*"
}

# check VM status
status=$(ps aux | grep "[c]oreos-xhyve-ui" | awk '{print $2}')
if [ "$status" = "" ]; then
echo " "
echo "CoreOS VM is not running, please start VM !!!"
pause "Press any key to continue ..."
exit 1
fi


# Set the environment variable for the docker daemon
export DOCKER_HOST=tcp://$vm_ip:2375

Expand Down
9 changes: 9 additions & 0 deletions src/reload.command
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function pause(){
read -p "$*"
}

# check VM status
status=$(ps aux | grep "[c]oreos-xhyve-ui" | awk '{print $2}')
if [ "$status" = "" ]; then
echo " "
echo "CoreOS VM is not running, please start VM !!!"
pause "Press any key to continue ..."
exit 1
fi

# Stop VM
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no core@$vm_ip sudo halt
# wait till VM is stopped
Expand Down
16 changes: 16 additions & 0 deletions src/up.command
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@
# up.command
#

#


# get App's Resources folder
res_folder=$(cat ~/coreos-xhyve-ui/.env/resouces_path)

# get VM IP
vm_ip=$(cat ~/coreos-xhyve-ui/.env/ip_address)

function pause(){
read -p "$*"
}

# check if VM is already running
status=$(ps aux | grep "[c]oreos-xhyve-ui" | awk '{print $2}')
if [[ "$status" -ne "" ]]; then
echo " "
pause "CoreOS VM is already running, press any key to continue ..."
exit 1
fi


echo " "
# Check if set channel's images are present
CHANNEL=$(cat ~/coreos-xhyve-ui/custom.conf | grep CHANNEL= | head -1 | cut -f2 -d"=")
Expand Down
10 changes: 10 additions & 0 deletions src/update_osx_clients_units.command
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ function pause(){
read -p "$*"
}

# check VM status
status=$(ps aux | grep "[c]oreos-xhyve-ui" | awk '{print $2}')
if [ "$status" = "" ]; then
echo " "
echo "CoreOS VM is not running, please start VM !!!"
pause "Press any key to continue ..."
exit 1
fi
#

# copy files to ~/coreos-xhyve-ui/bin
cp -f "${res_folder}"/files/* ~/coreos-xhyve-ui/bin
chmod 755 ~/coreos-xhyve-ui/bin/*
Expand Down

0 comments on commit ed79708

Please sign in to comment.