diff --git a/web/app/app.js b/web/app/app.js index 1bc4d0c..010680e 100644 --- a/web/app/app.js +++ b/web/app/app.js @@ -13,13 +13,13 @@ App = Ember.Application.extend({ Resolver }); -// if (config.environment === 'production') { - // Ember.$.ajaxSetup({ - // beforeSend(jqXHR, opt) { - // opt.url = '/api/' + opt.url; - // } - // }); -// } +if (config.environment === 'production') { + Ember.$.ajaxSetup({ + beforeSend(jqXHR, opt) { + opt.url = '/crm-api/' + opt.url; + } + }); +} loadInitializers(App, config.modulePrefix); diff --git a/web/app/templates/index.hbs b/web/app/templates/index.hbs index adffe68..648ea06 100644 --- a/web/app/templates/index.hbs +++ b/web/app/templates/index.hbs @@ -1,15 +1,42 @@ {{!home-board}} {{#main-content}}
-

User Tips:

+

User tips:

    Customer Status:

        Active – Auto assigned, Active customer, with PO in current year

        Occasional – Auto assigned, Not very active, no PO in current year, but occasional PO within past 2 years

        Sleeping – Auto assigned, Sleeping customer and no PO within past 2 years, still use PUSH-PULL

        NA – Manually assigned, Not PUSH-PULL customer anymore

- + +

    LMCN Week Goals:

+

        每次访客时100%向需要的客户推广:新产品、光纤、组件和技术研讨会。

+

Admin Tips:

-

    Step 1 – Import Customers: QAD 2.2.23

-

    Step 2 – Import Sales Data: QAD 7.17.13

+

    Step 1 – Import Customers: QAD 2.2.23

+

    Step 2 – Import Sales Data: QAD 7.17.13

+ + {{!-- + +User Tips: + Customer Status: + + Active – Auto assigned, active customer, with PO in current year + + Occasional – Auto assigned, not very active, no PO in current year, but occasional PO within past 2 years + + Sleeping – Auto assigned, no PO in current year and in past 2 years, but still use PUSH-PULL + + NA – Manually assigned, not PUSH-PULL customer anymore + + + LMCN week goals: + 每次访客时100%向需要的客户推广:新产品、光纤、组件和技术研讨会。 + +Admin Tips: + Step 1 – Import Customers: QAD 2.2.23 + + Step 2 – Import Sales Data: QAD 7.17.13 + + --}}
{{/main-content}} \ No newline at end of file diff --git a/web/build_jar b/web/build_jar new file mode 100755 index 0000000..c8bb2cb --- /dev/null +++ b/web/build_jar @@ -0,0 +1,32 @@ +#!/bin/sh + +# get real path of softlink +get_real_path() { + local f="$1" + while [ -h "$f" ]; do + ls=`ls -ld "$f"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + f="$link" + else + f=`dirname "$f"`/"$link" + fi + done + eval "$2"="'$f'" +} + +currDir=$(pwd) +get_real_path "$0" prg_path +echo "Script Path [$prg_path]" + +# Service Home +pushd $(dirname "$prg_path") > /dev/null +PROJECT_HOME=$(dirname $(pwd)) +popd > /dev/null + +# ember build +targetPath="$PROJECT_HOME/server/crm/src/main/resources/static" +rm -rf "$targetPath" +cd "$PROJECT_HOME/web" +ember b -prod -o "$targetPath" +cd "$currDir" diff --git a/web/deploy b/web/deploy index c8bb2cb..c361d6e 100755 --- a/web/deploy +++ b/web/deploy @@ -25,8 +25,39 @@ PROJECT_HOME=$(dirname $(pwd)) popd > /dev/null # ember build -targetPath="$PROJECT_HOME/server/crm/src/main/resources/static" -rm -rf "$targetPath" cd "$PROJECT_HOME/web" -ember b -prod -o "$targetPath" + +if [ "$1" = "prod" ]; then + SERVER=lemo@116.62.189.211 +else + # SERVER=ambition@101.236.35.13 + SERVER=lemo@116.62.189.211 +fi + +projName="lemo-crm-web" +targetPath="/data/program" +tgzFile="${projName}.tgz" +backupDir="${projName}_prev" + +ember b -prod -o "${projName}" + +# package dist +echo "tar czf ${tgzFile} ${projName}" +tar czf "${tgzFile}" "${projName}" + +# remove backup +echo "ssh ${SERVER} rm -rf ${targetPath}/${backupDir} && mv ${targetPath}/${projName} ${targetPath}/${backupDir}" +ssh "${SERVER}" "rm -rf ${targetPath}/${backupDir} && mv ${targetPath}/${projName} ${targetPath}/${backupDir}" + +# copy pakage to server +echo "scp ${tgzFile} ${SERVER}:${targetPath}/" +scp "${tgzFile}" "${SERVER}:${targetPath}/" + +# extract package +ssh "${SERVER}" "tar xzf ${targetPath}/${tgzFile} -C ${targetPath} && rm -rf ${targetPath}/${tgzFile}" + +# clean up +echo "rm -rf ${projName} ${tgzFile}" +rm -rf "${projName}" "${tgzFile}" + cd "$currDir" diff --git a/web/run b/web/run index ec16deb..fd7d4d7 100755 --- a/web/run +++ b/web/run @@ -2,8 +2,8 @@ rm -rf tmp dist -if [ "$1" = "test" ]; then - ember s -p 4201 -pr http://101.236.35.13/ +if [ "$1" = "prod" ]; then + ember s -p 4201 -pr http://116.62.189.211/ else ember s -pr http://127.0.0.1:8088/ fi